summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-11-02 20:49:01 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-11-02 20:49:01 +0000
commitd37bbc3e0051db10aab98e50da2a64707a612c14 (patch)
treeec480cd9f6c3d9bd9c208b813bd896a4abd37ee2 /clang/lib/CodeGen/CGDebugInfo.cpp
parent7df3501b492244b1377d9f287538a54cb5816b13 (diff)
downloadbcm5719-llvm-d37bbc3e0051db10aab98e50da2a64707a612c14.tar.gz
bcm5719-llvm-d37bbc3e0051db10aab98e50da2a64707a612c14.zip
Fix debug tag type of forward declarations of struct/class in C++.
llvm-svn: 167308
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 57c4e9e4175..e873806b914 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -518,21 +518,17 @@ llvm::DIType CGDebugInfo::createRecordFwdDecl(const RecordDecl *RD,
llvm::DIDescriptor Ctx) {
llvm::DIFile DefUnit = getOrCreateFile(RD->getLocation());
unsigned Line = getLineNumber(RD->getLocation());
- StringRef RDName = RD->getName();
+ StringRef RDName = getClassName(RD);
- // Get the tag.
- const CXXRecordDecl *CXXDecl = dyn_cast<CXXRecordDecl>(RD);
unsigned Tag = 0;
- if (CXXDecl) {
- RDName = getClassName(RD);
- Tag = llvm::dwarf::DW_TAG_class_type;
- }
- else if (RD->isStruct() || RD->isInterface())
+ if (RD->isStruct() || RD->isInterface())
Tag = llvm::dwarf::DW_TAG_structure_type;
else if (RD->isUnion())
Tag = llvm::dwarf::DW_TAG_union_type;
- else
- llvm_unreachable("Unknown RecordDecl type!");
+ else {
+ assert(RD->isClass());
+ Tag = llvm::dwarf::DW_TAG_class_type;
+ }
// Create the type.
return DBuilder.createForwardDecl(Tag, RDName, Ctx, DefUnit, Line);
OpenPOWER on IntegriCloud