[llvm-commits] [llvm-gcc-4.2] r63146 - /llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp

Bill Wendling isanbard at gmail.com
Tue Jan 27 14:42:15 PST 2009


Author: void
Date: Tue Jan 27 16:42:15 2009
New Revision: 63146

URL: http://llvm.org/viewvc/llvm-project?rev=63146&view=rev
Log:
Pull in:

r62865:

Incomplete enum does not have any location info available.

r62874:

Initialize location info.

Modified:
    llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp

Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp?rev=63146&r1=63145&r2=63146&view=diff

==============================================================================
--- llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp Tue Jan 27 16:42:15 2009
@@ -503,9 +503,14 @@
   llvm::DIArray EltArray =
     DebugFactory.GetOrCreateArray(&Elements[0], Elements.size());
   
-  expanded_location Loc = GetNodeLocation(TREE_CHAIN(type), false);
-  std::string Filename, Directory;
-  DirectoryAndFile(Loc.file, Directory, Filename);
+  expanded_location Loc = { NULL, 0 };
+  std::string Filename = "";
+  std::string Directory= "";
+  if (TYPE_SIZE(type)) {
+    // Incomplete enums do not  have any location info.
+    Loc = GetNodeLocation(TREE_CHAIN(type), false);
+    DirectoryAndFile(Loc.file, Directory, Filename);
+  }
   return DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_enumeration_type,
                                           findRegion(type), GetNodeName(type), 
                                           MainCompileUnit, Loc.line,





More information about the llvm-commits mailing list