diff options
| author | Devang Patel <dpatel@apple.com> | 2011-02-28 22:32:45 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2011-02-28 22:32:45 +0000 |
| commit | bbe4ff99e0ac30ae20d5ace0c07e57baeda5751b (patch) | |
| tree | c2ae71badff2f6fbde99161e435f160a28378945 /clang/lib/CodeGen | |
| parent | 29b8656935758f390826f454e13214861c78df00 (diff) | |
| download | bcm5719-llvm-bbe4ff99e0ac30ae20d5ace0c07e57baeda5751b.tar.gz bcm5719-llvm-bbe4ff99e0ac30ae20d5ace0c07e57baeda5751b.zip | |
Use single code path to handle c++ structs and classes while generating debug info.
llvm-svn: 126691
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index dfd9f56b12e..978542a213a 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1012,14 +1012,10 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty) { DBuilder.getOrCreateArray(EltTys.data(), EltTys.size()); llvm::MDNode *RealDecl = NULL; - if (RD->isStruct()) - RealDecl = DBuilder.createStructType(RDContext, RDName, DefUnit, Line, - Size, Align, 0, Elements); - else if (RD->isUnion()) + if (RD->isUnion()) RealDecl = DBuilder.createUnionType(RDContext, RDName, DefUnit, Line, - Size, Align, 0, Elements); - else { - assert(RD->isClass() && "Unknown RecordType!"); + Size, Align, 0, Elements); + else if (CXXDecl) { RDName = getClassName(RD); // A class's primary base or the class itself contains the vtable. llvm::MDNode *ContainingType = NULL; @@ -1045,7 +1041,9 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty) { Size, Align, 0, 0, llvm::DIType(), Elements, ContainingType, TParamsArray); - } + } else + RealDecl = DBuilder.createStructType(RDContext, RDName, DefUnit, Line, + Size, Align, 0, Elements); // Now that we have a real decl for the struct, replace anything using the // old decl with the new one. This will recursively update the debug info. |

