diff options
author | Amjad Aboud <amjad.aboud@intel.com> | 2016-04-29 16:08:08 +0000 |
---|---|---|
committer | Amjad Aboud <amjad.aboud@intel.com> | 2016-04-29 16:08:08 +0000 |
commit | 0ccbfa3b4477d0b48fa17128c0528f263908151e (patch) | |
tree | 1128b34026aae3d6f75790897060b3a3287dc3f5 /clang/lib/CodeGen/CGDecl.cpp | |
parent | 293ee8bba18fcd166f19a0338133d63487da4f33 (diff) | |
download | bcm5719-llvm-0ccbfa3b4477d0b48fa17128c0528f263908151e.tar.gz bcm5719-llvm-0ccbfa3b4477d0b48fa17128c0528f263908151e.zip |
Recommitted r264281 "Supporting all entities declared in lexical scope in LLVM debug info."
After fixing PR26942 in r267004.
llvm-svn: 268055
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index c39b980ef2c..fd4a1dcabc8 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -87,11 +87,7 @@ void CodeGenFunction::EmitDecl(const Decl &D) { case Decl::UsingShadow: case Decl::ObjCTypeParam: llvm_unreachable("Declaration should not be in declstmts!"); - case Decl::Function: // void X(); - case Decl::Record: // struct/union/class X; - case Decl::Enum: // enum X; - case Decl::EnumConstant: // enum ? { X = ? } - case Decl::CXXRecord: // struct/union/class X; [C++] + case Decl::Function: // void X(); case Decl::StaticAssert: // static_assert(X, ""); [C++0x] case Decl::Label: // __label__ x; case Decl::Import: @@ -101,13 +97,21 @@ void CodeGenFunction::EmitDecl(const Decl &D) { // None of these decls require codegen support. return; + case Decl::Record: // struct/union/class X; + case Decl::Enum: // enum X; + case Decl::EnumConstant: // enum ? { X = ? } + case Decl::CXXRecord: // struct/union/class X; [C++] + if (CGDebugInfo *DI = getDebugInfo()) + DI->recordDeclarationLexicalScope(D); + return; + case Decl::NamespaceAlias: if (CGDebugInfo *DI = getDebugInfo()) - DI->EmitNamespaceAlias(cast<NamespaceAliasDecl>(D)); + DI->EmitNamespaceAlias(cast<NamespaceAliasDecl>(D)); return; case Decl::Using: // using X; [C++] if (CGDebugInfo *DI = getDebugInfo()) - DI->EmitUsingDecl(cast<UsingDecl>(D)); + DI->EmitUsingDecl(cast<UsingDecl>(D)); return; case Decl::UsingDirective: // using namespace X; [C++] if (CGDebugInfo *DI = getDebugInfo()) @@ -128,6 +132,9 @@ void CodeGenFunction::EmitDecl(const Decl &D) { const TypedefNameDecl &TD = cast<TypedefNameDecl>(D); QualType Ty = TD.getUnderlyingType(); + if (CGDebugInfo *DI = getDebugInfo()) + DI->recordDeclarationLexicalScope(D); + if (Ty->isVariablyModifiedType()) EmitVariablyModifiedType(Ty); } |