aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dimitry@andric.com>2023-12-20 20:03:19 +0100
committerGitHub <noreply@github.com>2023-12-20 20:03:19 +0100
commit9055519103eadfba0b48810be926883a71890c55 (patch)
treef1fbb4e0914b28185d203161761d3637669dae26 /clang/lib/CodeGen/CodeGenModule.cpp
parent8b231d73bdd47a69ccf1350b49fb824999426bba (diff)
downloadllvm-9055519103eadfba0b48810be926883a71890c55.zip
llvm-9055519103eadfba0b48810be926883a71890c55.tar.gz
llvm-9055519103eadfba0b48810be926883a71890c55.tar.bz2
[clang] Add getClangVendor() and use it in CodeGenModule.cpp (#75935)
In 9a38a72f1d482 `ProductId` was assigned from the stringified value of `CLANG_VENDOR`, if that macro was defined. However, `CLANG_VENDOR` is supposed to be a string, as it is defined (optionally) as such in the top-level clang `CMakeLists.txt`. Move the addition of `-DCLANG_VENDOR` to the compiler flags from `clang/lib/Basic/CMakeLists.txt` to the top-level `CMakeLists.txt`, so it is consistent across the whole clang codebase. Then remove the stringification from `CodeGenModule.cpp`, to make it work correctly. Fixes: 9a38a72f1d482
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 7ad26ac..b2e173d0 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -995,12 +995,7 @@ void CodeGenModule::Release() {
uint32_t(CLANG_VERSION_MINOR));
getModule().addModuleFlag(llvm::Module::Warning, "zos_product_patchlevel",
uint32_t(CLANG_VERSION_PATCHLEVEL));
- std::string ProductId;
-#ifdef CLANG_VENDOR
- ProductId = #CLANG_VENDOR;
-#else
- ProductId = "clang";
-#endif
+ std::string ProductId = getClangVendor() + "clang";
getModule().addModuleFlag(llvm::Module::Error, "zos_product_id",
llvm::MDString::get(VMContext, ProductId));