Pull in:
r62865:
Incomplete enum does not have any location info available.
r62874:
Initialize location info.
llvm-svn: 63146
diff --git a/llvm-gcc-4.2/gcc/llvm-debug.cpp b/llvm-gcc-4.2/gcc/llvm-debug.cpp
index 1c7d64e..81457f8 100644
--- a/llvm-gcc-4.2/gcc/llvm-debug.cpp
+++ b/llvm-gcc-4.2/gcc/llvm-debug.cpp
@@ -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,