[llvm-commits] [llvm-gcc-4.2] r103414 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp

Devang Patel dpatel at apple.com
Mon May 10 10:49:04 PDT 2010


Author: dpatel
Date: Mon May 10 12:49:04 2010
New Revision: 103414

URL: http://llvm.org/viewvc/llvm-project?rev=103414&view=rev
Log:
Do not emit variable debug info if debug info for corresponding type is not available.
This fixes PR 7104 crash.

Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=103414&r1=103413&r2=103414&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Mon May 10 12:49:04 2010
@@ -459,6 +459,9 @@
   DIType Ty = getOrCreateType(type);
   if (DECL_ARTIFICIAL (decl))
       Ty = DebugFactory.CreateArtificialType(Ty);
+  // If type info is not available then do not emit debug info for this var.
+  if (!Ty)
+    return;
   llvm::DIVariable D =
     DebugFactory.CreateVariable(Tag, VarScope,
                                 Name, getOrCreateFile(Loc.file),
@@ -1169,6 +1172,7 @@
       // gen_type_die(TYPE_OFFSET_BASETYPE(type), context_die);
       // gen_type_die(TREE_TYPE(type), context_die);
       // gen_ptr_to_mbr_type_die(type, context_die);
+      // PR 7104
       break;
     }
 





More information about the llvm-commits mailing list