Skip to content

Commit 4a13aa6

Browse files
author
Yusra Syeda
committed
address review comments
1 parent 3b03227 commit 4a13aa6

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

clang/include/clang/Basic/LangOptions.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ LANGOPT(C23 , 1, 0, "C23")
9090
LANGOPT(MSVCCompat , 1, 0, "Microsoft Visual C++ full compatibility mode")
9191
LANGOPT(Kernel , 1, 0, "Kernel mode")
9292
LANGOPT(MicrosoftExt , 1, 0, "Microsoft C++ extensions")
93+
LANGOPT(ASCIICharMode , 1, 1, "z/OS Language Environment Character mode")
9394
LANGOPT(AsmBlocks , 1, 0, "Microsoft inline asm blocks")
9495
LANGOPT(Borland , 1, 0, "Borland extensions")
9596
LANGOPT(CPlusPlus , 1, 0, "C++")

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -977,21 +977,34 @@ void CodeGenModule::Release() {
977977
getModule().addModuleFlag(llvm::Module::Error, "wchar_size", WCharWidth);
978978

979979
if (getTriple().isOSzOS()) {
980-
int32_t ProductVersion, ProductRelease, ProductPatch;
981-
ProductVersion = LLVM_VERSION_MAJOR, ProductRelease = LLVM_VERSION_MINOR,
982-
ProductPatch = LLVM_VERSION_PATCH;
983980
getModule().addModuleFlag(llvm::Module::Warning, "Product Major Version",
984-
ProductVersion);
981+
uint32_t(CLANG_VERSION_MAJOR));
985982
getModule().addModuleFlag(llvm::Module::Warning, "Product Minor Version",
986-
ProductRelease);
983+
uint32_t(CLANG_VERSION_MINOR));
987984
getModule().addModuleFlag(llvm::Module::Warning, "Product Patchlevel",
988-
ProductPatch);
985+
uint32_t(CLANG_VERSION_PATCHLEVEL));
989986

990987
// Record the language because we need it for the PPA2.
991988
const char *lang_str = languageToString(
992989
LangStandard::getLangStandardForKind(LangOpts.LangStd).Language);
993990
getModule().addModuleFlag(llvm::Module::Error, "zos_cu_language",
994991
llvm::MDString::get(VMContext, lang_str));
992+
993+
std::string ProductId;
994+
#ifdef CLANG_VENDOR
995+
ProductId = #CLANG_VENDOR;
996+
#else
997+
ProductId = "clang";
998+
#endif
999+
1000+
getModule().addModuleFlag(llvm::Module::Error, "Product Id",
1001+
llvm::MDString::get(VMContext, ProductId));
1002+
1003+
getModule().addModuleFlag(
1004+
llvm::Module::Error, "zos_le_char_mode",
1005+
llvm::MDString::get(VMContext, Context.getLangOpts().ASCIICharMode
1006+
? "ascii"
1007+
: "ebcdic"));
9951008
}
9961009

9971010
llvm::Triple::ArchType Arch = Context.getTargetInfo().getTriple().getArch();

0 commit comments

Comments
 (0)