diff options
author | Devang Patel <dpatel@apple.com> | 2010-03-09 21:32:27 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-03-09 21:32:27 +0000 |
commit | 4f26205ba8a596e06b5111ca8eb796bfe7c55737 (patch) | |
tree | 445ef73270efaeb5f22f5ada4d076f46ef5bc8be /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | 3dde457b949bdd11cbb891c1047d2b6c243c0ab6 (diff) | |
download | bcm5719-llvm-4f26205ba8a596e06b5111ca8eb796bfe7c55737.tar.gz bcm5719-llvm-4f26205ba8a596e06b5111ca8eb796bfe7c55737.zip |
More then one anonymous aggregates on one line creates chaos when MDNode uniquness is combined with RAUW operation. Right solution is to avoid using RAUW.
This fixes PR 6554.
llvm-svn: 98083
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 892669299c6..02e5d07d6af 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -37,7 +37,7 @@ using namespace clang::CodeGen; CGDebugInfo::CGDebugInfo(CodeGenModule &CGM) : CGM(CGM), DebugFactory(CGM.getModule()), - BlockLiteralGenericSet(false) { + FwdDeclCount(0), BlockLiteralGenericSet(false) { CreateCompileUnit(); } @@ -774,12 +774,12 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty, // A RD->getName() is not unique. However, the debug info descriptors // are uniqued so use type name to ensure uniquness. - std::string STy = QualType(Ty, 0).getAsString(); + char *FwdDeclName = (char *)alloca(65); + sprintf(FwdDeclName, "fwd.type.%d", FwdDeclCount++); llvm::DIDescriptor FDContext = getContextDescriptor(dyn_cast<Decl>(RD->getDeclContext()), Unit); llvm::DICompositeType FwdDecl = - DebugFactory.CreateCompositeType(Tag, FDContext, - STy.c_str(), + DebugFactory.CreateCompositeType(Tag, FDContext, FwdDeclName, DefUnit, Line, 0, 0, 0, 0, llvm::DIType(), llvm::DIArray()); |