summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 07dbce4252f..7550266e7b2 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -81,10 +81,8 @@ void CodeGenFunction::EmitDecl(const Decl &D) {
case Decl::UsingShadow:
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::StaticAssert: // static_assert(X, ""); [C++0x]
case Decl::Label: // __label__ x;
case Decl::Import:
@@ -93,6 +91,12 @@ void CodeGenFunction::EmitDecl(const Decl &D) {
// None of these decls require codegen support.
return;
+ case Decl::CXXRecord: // struct/union/class X; [C++]
+ case Decl::Record: // struct/union/class X;
+ if (CGDebugInfo *DI = getDebugInfo())
+ DI->recordDeclarationLexicalScope(D);
+ return;
+
case Decl::NamespaceAlias:
if (CGDebugInfo *DI = getDebugInfo())
DI->EmitNamespaceAlias(cast<NamespaceAliasDecl>(D));
@@ -117,6 +121,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);
}
OpenPOWER on IntegriCloud