aboutsummaryrefslogtreecommitdiff
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.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index 1729c7ed..0ad5050 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/lib/CodeGen/CGDecl.cpp
@@ -100,11 +100,19 @@ void CodeGenFunction::EmitDecl(const Decl &D) {
case Decl::ObjCTypeParam:
case Decl::Binding:
llvm_unreachable("Declaration should not be in declstmts!");
- case Decl::Function: // void X();
case Decl::Record: // struct/union/class X;
+ case Decl::CXXRecord: // struct/union/class X; [C++]
+ if (CGDebugInfo *DI = getDebugInfo())
+ if (cast<RecordDecl>(D).getDefinition())
+ DI->EmitAndRetainType(getContext().getRecordType(cast<RecordDecl>(&D)));
+ return;
case Decl::Enum: // enum X;
+ if (CGDebugInfo *DI = getDebugInfo())
+ if (cast<EnumDecl>(D).getDefinition())
+ DI->EmitAndRetainType(getContext().getEnumType(cast<EnumDecl>(&D)));
+ return;
+ case Decl::Function: // void 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:
@@ -157,12 +165,11 @@ void CodeGenFunction::EmitDecl(const Decl &D) {
case Decl::Typedef: // typedef int X;
case Decl::TypeAlias: { // using X = int; [C++0x]
- const TypedefNameDecl &TD = cast<TypedefNameDecl>(D);
- QualType Ty = TD.getUnderlyingType();
-
+ QualType Ty = cast<TypedefNameDecl>(D).getUnderlyingType();
+ if (CGDebugInfo *DI = getDebugInfo())
+ DI->EmitAndRetainType(Ty);
if (Ty->isVariablyModifiedType())
EmitVariablyModifiedType(Ty);
-
return;
}
}