diff --git a/clang/include/clang/Basic/Version.h b/clang/include/clang/Basic/Version.h index 8e4e6928fded5..2881d8db954e0 100644 --- a/clang/include/clang/Basic/Version.h +++ b/clang/include/clang/Basic/Version.h @@ -40,9 +40,6 @@ namespace clang { /// string as getClangRevision. std::string getLLVMRevision(); - /// Retrieves the Clang vendor tag. - std::string getClangVendor(); - /// Retrieves the full repository version that is an amalgamation of /// the information in getClangRepositoryPath() and getClangRevision(). std::string getClangFullRepositoryVersion(); diff --git a/clang/lib/Basic/Version.cpp b/clang/lib/Basic/Version.cpp index 4823f566bd773..e205da7adec1d 100644 --- a/clang/lib/Basic/Version.cpp +++ b/clang/lib/Basic/Version.cpp @@ -57,14 +57,6 @@ std::string getLLVMRevision() { #endif } -std::string getClangVendor() { -#ifdef CLANG_VENDOR - return CLANG_VENDOR; -#else - return ""; -#endif -} - std::string getClangFullRepositoryVersion() { std::string buf; llvm::raw_string_ostream OS(buf); @@ -100,7 +92,10 @@ std::string getClangFullVersion() { std::string getClangToolFullVersion(StringRef ToolName) { std::string buf; llvm::raw_string_ostream OS(buf); - OS << getClangVendor() << ToolName << " version " CLANG_VERSION_STRING; +#ifdef CLANG_VENDOR + OS << CLANG_VENDOR; +#endif + OS << ToolName << " version " CLANG_VERSION_STRING; std::string repo = getClangFullRepositoryVersion(); if (!repo.empty()) { @@ -115,7 +110,10 @@ std::string getClangFullCPPVersion() { // the one we report on the command line. std::string buf; llvm::raw_string_ostream OS(buf); - OS << getClangVendor() << "Clang " CLANG_VERSION_STRING; +#ifdef CLANG_VENDOR + OS << CLANG_VENDOR; +#endif + OS << "Clang " CLANG_VERSION_STRING; std::string repo = getClangFullRepositoryVersion(); if (!repo.empty()) { diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index b2e173d0d6949..7ad26ace328ab 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -995,7 +995,12 @@ void CodeGenModule::Release() { uint32_t(CLANG_VERSION_MINOR)); getModule().addModuleFlag(llvm::Module::Warning, "zos_product_patchlevel", uint32_t(CLANG_VERSION_PATCHLEVEL)); - std::string ProductId = getClangVendor() + "clang"; + std::string ProductId; +#ifdef CLANG_VENDOR + ProductId = #CLANG_VENDOR; +#else + ProductId = "clang"; +#endif getModule().addModuleFlag(llvm::Module::Error, "zos_product_id", llvm::MDString::get(VMContext, ProductId));