Revert "Support for DWARF-5 C++ language tags."

This reverts commit bf9c8ffb54.

llvm-svn: 372672
This commit is contained in:
Jonas Devlieghere 2019-09-23 23:49:36 +00:00
parent 5b5f1c8efd
commit 5c49c26714
9 changed files with 8 additions and 45 deletions

View File

@ -42,7 +42,6 @@
#include "llvm/ADT/PointerUnion.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/PointerLikeTypeTraits.h"
@ -2942,10 +2941,8 @@ public:
/// ensure a stable ABI for this, we choose the DW_LANG_ encodings
/// from the dwarf standard.
enum LanguageIDs {
lang_c = llvm::dwarf::DW_LANG_C,
lang_cxx = llvm::dwarf::DW_LANG_C_plus_plus,
lang_cxx_11 = llvm::dwarf::DW_LANG_C_plus_plus_11,
lang_cxx_14 = llvm::dwarf::DW_LANG_C_plus_plus_14
lang_c = /* DW_LANG_C */ 0x0002,
lang_cxx = /* DW_LANG_C_plus_plus */ 0x0004
};
private:

View File

@ -1001,19 +1001,12 @@ void DeclPrinter::VisitCXXRecordDecl(CXXRecordDecl *D) {
void DeclPrinter::VisitLinkageSpecDecl(LinkageSpecDecl *D) {
const char *l;
switch (D->getLanguage()) {
case LinkageSpecDecl::lang_c:
if (D->getLanguage() == LinkageSpecDecl::lang_c)
l = "C";
break;
case LinkageSpecDecl::lang_cxx_14:
l = "C++14";
break;
case LinkageSpecDecl::lang_cxx_11:
l = "C++11";
break;
case LinkageSpecDecl::lang_cxx:
else {
assert(D->getLanguage() == LinkageSpecDecl::lang_cxx &&
"unknown language in linkage specification");
l = "C++";
break;
}
Out << "extern \"" << l << "\" ";

View File

@ -850,12 +850,6 @@ void JSONNodeDumper::VisitLinkageSpecDecl(const LinkageSpecDecl *LSD) {
switch (LSD->getLanguage()) {
case LinkageSpecDecl::lang_c: Lang = "C"; break;
case LinkageSpecDecl::lang_cxx: Lang = "C++"; break;
case LinkageSpecDecl::lang_cxx_11:
Lang = "C++11";
break;
case LinkageSpecDecl::lang_cxx_14:
Lang = "C++14";
break;
}
JOS.attribute("language", Lang);
attributeOnlyIfTrue("hasBraces", LSD->hasBraces());

View File

@ -1766,12 +1766,6 @@ void TextNodeDumper::VisitLinkageSpecDecl(const LinkageSpecDecl *D) {
case LinkageSpecDecl::lang_cxx:
OS << " C++";
break;
case LinkageSpecDecl::lang_cxx_11:
OS << " C++11";
break;
case LinkageSpecDecl::lang_cxx_14:
OS << " C++14";
break;
}
}

View File

@ -561,10 +561,6 @@ void CGDebugInfo::CreateCompileUnit() {
if (LO.CPlusPlus) {
if (LO.ObjC)
LangTag = llvm::dwarf::DW_LANG_ObjC_plus_plus;
else if (LO.CPlusPlus14)
LangTag = llvm::dwarf::DW_LANG_C_plus_plus_14;
else if (LO.CPlusPlus11)
LangTag = llvm::dwarf::DW_LANG_C_plus_plus_11;
else
LangTag = llvm::dwarf::DW_LANG_C_plus_plus;
} else if (LO.ObjC) {
@ -882,8 +878,6 @@ llvm::DIType *CGDebugInfo::CreateType(const PointerType *Ty,
static bool hasCXXMangling(const TagDecl *TD, llvm::DICompileUnit *TheCU) {
switch (TheCU->getSourceLanguage()) {
case llvm::dwarf::DW_LANG_C_plus_plus:
case llvm::dwarf::DW_LANG_C_plus_plus_11:
case llvm::dwarf::DW_LANG_C_plus_plus_14:
return true;
case llvm::dwarf::DW_LANG_ObjC_plus_plus:
return isa<CXXRecordDecl>(TD) || isa<EnumDecl>(TD);

View File

@ -5132,9 +5132,7 @@ void CodeGenModule::EmitObjCIvarInitializations(ObjCImplementationDecl *D) {
// EmitLinkageSpec - Emit all declarations in a linkage spec.
void CodeGenModule::EmitLinkageSpec(const LinkageSpecDecl *LSD) {
if (LSD->getLanguage() != LinkageSpecDecl::lang_c &&
LSD->getLanguage() != LinkageSpecDecl::lang_cxx &&
LSD->getLanguage() != LinkageSpecDecl::lang_cxx_11 &&
LSD->getLanguage() != LinkageSpecDecl::lang_cxx_14) {
LSD->getLanguage() != LinkageSpecDecl::lang_cxx) {
ErrorUnsupported(LSD, "linkage spec");
return;
}

View File

@ -13982,10 +13982,6 @@ Decl *Sema::ActOnStartLinkageSpecification(Scope *S, SourceLocation ExternLoc,
Language = LinkageSpecDecl::lang_c;
else if (Lang == "C++")
Language = LinkageSpecDecl::lang_cxx;
else if (Lang == "C++11")
Language = LinkageSpecDecl::lang_cxx_11;
else if (Lang == "C++14")
Language = LinkageSpecDecl::lang_cxx_14;
else {
Diag(LangStr->getExprLoc(), diag::err_language_linkage_spec_unknown)
<< LangStr->getSourceRange();

View File

@ -31,8 +31,6 @@ static void checkModuleImportContext(Sema &S, Module *M,
ExternCLoc = LSD->getBeginLoc();
break;
case LinkageSpecDecl::lang_cxx:
case LinkageSpecDecl::lang_cxx_11:
case LinkageSpecDecl::lang_cxx_14:
break;
}
DC = LSD->getParent();

View File

@ -12,7 +12,7 @@
// PCH:
// RUN: %clang_cc1 -triple %itanium_abi_triple -x c++ -std=c++11 -debugger-tuning=lldb -emit-pch -fmodule-format=obj -I %S/Inputs -o %t.pch %S/Inputs/DebugCXX.h -mllvm -debug-only=pchcontainer &>%t-pch.ll
// RUN: cat %t-pch.ll | FileCheck --check-prefix=CHECK-CXX %s
// RUN: cat %t-pch.ll | FileCheck %s
// RUN: cat %t-pch.ll | FileCheck --check-prefix=CHECK-NEG %s
#ifdef MODULES
@ -23,7 +23,6 @@
// CHECK-MOD: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
// CHECK: distinct !DICompileUnit(language: DW_LANG_{{.*}}C_plus_plus,
// CHECK-CXX: distinct !DICompileUnit(language: DW_LANG_C_plus_plus_11,
// CHECK-SAME: isOptimized: false,
// CHECK-NOT: splitDebugFilename:
// CHECK-SAME: dwoId: