diff options
author | Adrian Prantl <aprantl@apple.com> | 2013-11-15 21:05:09 +0000 |
---|---|---|
committer | Adrian Prantl <aprantl@apple.com> | 2013-11-15 21:05:09 +0000 |
commit | 0cbdb81de76274c3f1731d92dc09864d2277d690 (patch) | |
tree | 423e1a0ef5774c9f2f058ce9f0e83bd571252b6d /lib/CodeGen/AsmPrinter | |
parent | c160efc28b815dbea73f0243f0729c1f0e1fabdb (diff) | |
download | external_llvm-0cbdb81de76274c3f1731d92dc09864d2277d690.zip external_llvm-0cbdb81de76274c3f1731d92dc09864d2277d690.tar.gz external_llvm-0cbdb81de76274c3f1731d92dc09864d2277d690.tar.bz2 |
Reimplement r194843 in a slightly less broken way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194848 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index e399508..1120279 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -871,9 +871,7 @@ DIE *CompileUnit::getOrCreateContextDIE(DIScope Context) { return getOrCreateNameSpace(DINameSpace(Context)); if (Context.isSubprogram()) return getOrCreateSubprogramDIE(DISubprogram(Context)); - if (DIE *ContextDIE = getDIE(Context)) - return ContextDIE; - return getCUDie(); + return getDIE(Context); } /// getOrCreateTypeDIE - Find existing DIE or create new DIE for the @@ -888,6 +886,10 @@ DIE *CompileUnit::getOrCreateTypeDIE(const MDNode *TyNode) { // Construct the context before querying for the existence of the DIE in case // such construction creates the DIE. DIE *ContextDIE = getOrCreateContextDIE(resolve(Ty.getContext())); + // TODO: Investigate if this beavior is intentional and possibly + // replace it with an assert. + if (!ContextDIE) + ContextDIE = getCUDie(); DIE *TyDIE = getDIE(Ty); if (TyDIE) |