Skip to content

Commit 5c1a41f

Browse files
committed
Revert "[clang] Add getClangVendor() and use it in CodeGenModule.cpp (#75935)"
This reverts commit 9055519, due to an incorrectly chosen commit message.
1 parent 9055519 commit 5c1a41f

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

clang/include/clang/Basic/Version.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ namespace clang {
4040
/// string as getClangRevision.
4141
std::string getLLVMRevision();
4242

43-
/// Retrieves the Clang vendor tag.
44-
std::string getClangVendor();
45-
4643
/// Retrieves the full repository version that is an amalgamation of
4744
/// the information in getClangRepositoryPath() and getClangRevision().
4845
std::string getClangFullRepositoryVersion();

clang/lib/Basic/Version.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,6 @@ std::string getLLVMRevision() {
5757
#endif
5858
}
5959

60-
std::string getClangVendor() {
61-
#ifdef CLANG_VENDOR
62-
return CLANG_VENDOR;
63-
#else
64-
return "";
65-
#endif
66-
}
67-
6860
std::string getClangFullRepositoryVersion() {
6961
std::string buf;
7062
llvm::raw_string_ostream OS(buf);
@@ -100,7 +92,10 @@ std::string getClangFullVersion() {
10092
std::string getClangToolFullVersion(StringRef ToolName) {
10193
std::string buf;
10294
llvm::raw_string_ostream OS(buf);
103-
OS << getClangVendor() << ToolName << " version " CLANG_VERSION_STRING;
95+
#ifdef CLANG_VENDOR
96+
OS << CLANG_VENDOR;
97+
#endif
98+
OS << ToolName << " version " CLANG_VERSION_STRING;
10499

105100
std::string repo = getClangFullRepositoryVersion();
106101
if (!repo.empty()) {
@@ -115,7 +110,10 @@ std::string getClangFullCPPVersion() {
115110
// the one we report on the command line.
116111
std::string buf;
117112
llvm::raw_string_ostream OS(buf);
118-
OS << getClangVendor() << "Clang " CLANG_VERSION_STRING;
113+
#ifdef CLANG_VENDOR
114+
OS << CLANG_VENDOR;
115+
#endif
116+
OS << "Clang " CLANG_VERSION_STRING;
119117

120118
std::string repo = getClangFullRepositoryVersion();
121119
if (!repo.empty()) {

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,12 @@ void CodeGenModule::Release() {
995995
uint32_t(CLANG_VERSION_MINOR));
996996
getModule().addModuleFlag(llvm::Module::Warning, "zos_product_patchlevel",
997997
uint32_t(CLANG_VERSION_PATCHLEVEL));
998-
std::string ProductId = getClangVendor() + "clang";
998+
std::string ProductId;
999+
#ifdef CLANG_VENDOR
1000+
ProductId = #CLANG_VENDOR;
1001+
#else
1002+
ProductId = "clang";
1003+
#endif
9991004
getModule().addModuleFlag(llvm::Module::Error, "zos_product_id",
10001005
llvm::MDString::get(VMContext, ProductId));
10011006

0 commit comments

Comments
 (0)