diff options
| author | Eric Christopher <echristo@apple.com> | 2012-02-13 15:08:45 +0000 |
|---|---|---|
| committer | Eric Christopher <echristo@apple.com> | 2012-02-13 15:08:45 +0000 |
| commit | fe52523b4c3584c570073b0298c3b0c6018b3885 (patch) | |
| tree | 7ba6bf3a6b6b4bc0179273246ce9fdf021ce63a4 /clang/lib/CodeGen | |
| parent | d752e3d28035e4276b6f3fb33284252a3d7ff328 (diff) | |
| download | bcm5719-llvm-fe52523b4c3584c570073b0298c3b0c6018b3885.tar.gz bcm5719-llvm-fe52523b4c3584c570073b0298c3b0c6018b3885.zip | |
Add back in the code to create forward decls using temporary mdnodes.
llvm-svn: 150390
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index f6166ca8ae9..34da5f4d998 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -483,26 +483,27 @@ llvm::DIType CGDebugInfo::CreateType(const PointerType *Ty, // Creates a forward declaration for a RecordDecl in the given context. 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(); + + // Get the tag. const CXXRecordDecl *CXXDecl = dyn_cast<CXXRecordDecl>(RD); - - if (CXXDecl) - return DBuilder.createClassType(Ctx, getClassName(RD), DefUnit, - Line, 0, 0, 0, - llvm::DIType::FlagFwdDecl, - llvm::DIType(), llvm::DIArray()); + unsigned Tag = 0; + if (CXXDecl) { + RDName = getClassName(RD); + Tag = llvm::dwarf::DW_TAG_class_type; + } else if (RD->isStruct()) - return DBuilder.createStructType(Ctx, RD->getName(), DefUnit, - Line, 0, 0, llvm::DIType::FlagFwdDecl, - llvm::DIArray()); + Tag = llvm::dwarf::DW_TAG_structure_type; else if (RD->isUnion()) - return DBuilder.createUnionType(Ctx, RD->getName(), DefUnit, - Line, 0, 0, llvm::DIType::FlagFwdDecl, - llvm::DIArray()); + Tag = llvm::dwarf::DW_TAG_union_type; else llvm_unreachable("Unknown RecordDecl type!"); + + // Create the type. + return DBuilder.createForwardDecl(Tag, RDName, DefUnit, + Line); } // Walk up the context chain and create forward decls for record decls, |

