[llvm] r194848 - Reimplement r194843 in a slightly less broken way.

Adrian Prantl aprantl at apple.com
Fri Nov 15 13:05:09 PST 2013


Author: adrian
Date: Fri Nov 15 15:05:09 2013
New Revision: 194848

URL: http://llvm.org/viewvc/llvm-project?rev=194848&view=rev
Log:
Reimplement r194843 in a slightly less broken way.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp?rev=194848&r1=194847&r2=194848&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp Fri Nov 15 15:05:09 2013
@@ -871,9 +871,7 @@ DIE *CompileUnit::getOrCreateContextDIE(
     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(con
   // 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)





More information about the llvm-commits mailing list