aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dimitry@andric.com>2023-12-20 20:07:56 +0100
committerDimitry Andric <dimitry@andric.com>2023-12-20 20:09:39 +0100
commit2c27013fa918211816d24c9d2530469fd822bc00 (patch)
treef1fbb4e0914b28185d203161761d3637669dae26 /clang/lib/CodeGen/CodeGenModule.cpp
parent5c1a41f8ad0c02a24345efb4adc424396b7e446b (diff)
downloadllvm-2c27013fa918211816d24c9d2530469fd822bc00.zip
llvm-2c27013fa918211816d24c9d2530469fd822bc00.tar.gz
llvm-2c27013fa918211816d24c9d2530469fd822bc00.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`. Furthermore, `CLANG_VENDOR` is only passed as a build-time define when compiling `Version.cpp`, so add a `getClangVendor()` function to `Version.h`, and use it in `CodegGenModule.cpp`, instead of relying on the macro. 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));