[llvm-commits] [llvm-gcc-4.2] r62865 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Devang Patel
dpatel at apple.com
Fri Jan 23 11:31:32 PST 2009
Author: dpatel
Date: Fri Jan 23 13:31:32 2009
New Revision: 62865
URL: http://llvm.org/viewvc/llvm-project?rev=62865&view=rev
Log:
Incomplete enum does not have any location info available.
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=62865&r1=62864&r2=62865&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Fri Jan 23 13:31:32 2009
@@ -496,9 +496,13 @@
llvm::DIArray EltArray =
DebugFactory.GetOrCreateArray(&Elements[0], Elements.size());
- expanded_location Loc = GetNodeLocation(TREE_CHAIN(type), false);
+ expanded_location Loc;
std::string Filename, Directory;
- DirectoryAndFile(Loc.file, Directory, Filename);
+ 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,
MainCompileUnit, GetNodeName(type),
MainCompileUnit, Loc.line,
More information about the llvm-commits
mailing list