summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-02-01 22:40:08 +0000
committerDevang Patel <dpatel@apple.com>2010-02-01 22:40:08 +0000
commite8fb4b7fd62d0d624aecd231c074affff466189d (patch)
tree559b7978b11ce1dab658aaed2fe93a5126d371e7 /clang/lib/CodeGen/CGDebugInfo.cpp
parent4eb3d2867c71a252dc2fe12d1dbc55291723467e (diff)
downloadbcm5719-llvm-e8fb4b7fd62d0d624aecd231c074affff466189d.tar.gz
bcm5719-llvm-e8fb4b7fd62d0d624aecd231c074affff466189d.zip
Use appropriate context descriptor in RecordDecl's debug info.
llvm-svn: 95016
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 167995863a7..fffba853480 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -59,7 +59,7 @@ llvm::DIDescriptor CGDebugInfo::getContextDescriptor(const Decl *Context,
I = RegionMap.find(Context);
if (I != RegionMap.end())
return llvm::DIDescriptor(dyn_cast_or_null<llvm::MDNode>(I->second));
-
+
// Check namespace.
if (const NamespaceDecl *NSDecl = dyn_cast<NamespaceDecl>(Context))
return llvm::DIDescriptor(getOrCreateNameSpace(NSDecl, CompileUnit));
@@ -789,8 +789,11 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty,
// FIXME : Use RecordDecl's DeclContext's descriptor. As a temp. step
// use type's name in FwdDecl.
std::string STy = QualType(Ty, 0).getAsString();
+ llvm::DIDescriptor FDContext =
+ getContextDescriptor(dyn_cast<Decl>(RD->getDeclContext()), Unit);
llvm::DICompositeType FwdDecl =
- DebugFactory.CreateCompositeType(Tag, Unit, STy.c_str(),
+ DebugFactory.CreateCompositeType(Tag, FDContext,
+ STy.c_str(),
DefUnit, Line, 0, 0, 0, 0,
llvm::DIType(), llvm::DIArray());
@@ -832,8 +835,11 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty,
uint64_t Size = CGM.getContext().getTypeSize(Ty);
uint64_t Align = CGM.getContext().getTypeAlign(Ty);
+ llvm::DIDescriptor RDContext =
+ getContextDescriptor(dyn_cast<Decl>(RD->getDeclContext()), Unit);
llvm::DICompositeType RealDecl =
- DebugFactory.CreateCompositeType(Tag, Unit, RD->getName(),
+ DebugFactory.CreateCompositeType(Tag, RDContext,
+ RD->getName(),
DefUnit, Line, Size, Align, 0, 0,
llvm::DIType(), Elements,
0, ContainingType);
OpenPOWER on IntegriCloud