aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2022-12-06 22:51:39 +0000
committerDavid Blaikie <dblaikie@gmail.com>2022-12-06 22:52:47 +0000
commit6ab6085c77ef9bcdabf842342f63fba4291791a4 (patch)
tree4cd07fc324896e552df568e0b004b2ac6ba9c065 /clang/lib/CodeGen/CGDebugInfo.cpp
parent2563fd63c6f774e2b723d3f5246629e60da01eaa (diff)
downloadllvm-6ab6085c77ef9bcdabf842342f63fba4291791a4.zip
llvm-6ab6085c77ef9bcdabf842342f63fba4291791a4.tar.gz
llvm-6ab6085c77ef9bcdabf842342f63fba4291791a4.tar.bz2
Revert "DebugInfo: Add/support new DW_LANG codes for recent C and C++ versions"
Some buildbots are failing in Clang and LLDB tests. (I guess the LLDB failure is due to the explicit C language tests in DwarfUnit.cpp that need to be updated - not sure what the Clang failures are about, they seem to be still emitting C99 when we're expecting C11 and I checked those tests pass... maybe systems with a different C language version default?) This reverts commit 3c312e48f325c1b1ee11404ee6cfa08ee00037b0.
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 3e370fb..2a67f58 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -526,8 +526,7 @@ void CGDebugInfo::CreateCompileUnit() {
// Get absolute path name.
SourceManager &SM = CGM.getContext().getSourceManager();
- auto &CGO = CGM.getCodeGenOpts();
- std::string MainFileName = CGO.MainFileName;
+ std::string MainFileName = CGM.getCodeGenOpts().MainFileName;
if (MainFileName.empty())
MainFileName = "<stdin>";
@@ -563,11 +562,11 @@ void CGDebugInfo::CreateCompileUnit() {
if (LO.CPlusPlus) {
if (LO.ObjC)
LangTag = llvm::dwarf::DW_LANG_ObjC_plus_plus;
- else if (CGO.DebugStrictDwarf && CGO.DwarfVersion < 5)
- LangTag = llvm::dwarf::DW_LANG_C_plus_plus;
- else if (LO.CPlusPlus14)
+ else if (LO.CPlusPlus14 && (!CGM.getCodeGenOpts().DebugStrictDwarf ||
+ CGM.getCodeGenOpts().DwarfVersion >= 5))
LangTag = llvm::dwarf::DW_LANG_C_plus_plus_14;
- else if (LO.CPlusPlus11)
+ else if (LO.CPlusPlus11 && (!CGM.getCodeGenOpts().DebugStrictDwarf ||
+ CGM.getCodeGenOpts().DwarfVersion >= 5))
LangTag = llvm::dwarf::DW_LANG_C_plus_plus_11;
else
LangTag = llvm::dwarf::DW_LANG_C_plus_plus;
@@ -578,8 +577,6 @@ void CGDebugInfo::CreateCompileUnit() {
LangTag = llvm::dwarf::DW_LANG_OpenCL;
} else if (LO.RenderScript) {
LangTag = llvm::dwarf::DW_LANG_GOOGLE_RenderScript;
- } else if (LO.C11) {
- LangTag = llvm::dwarf::DW_LANG_C11;
} else if (LO.C99) {
LangTag = llvm::dwarf::DW_LANG_C99;
} else {