[llvm-commits] [dragonegg] r92473 - /dragonegg/trunk/llvm-debug.cpp
Duncan Sands
baldrick at free.fr
Mon Jan 4 02:43:15 PST 2010
Author: baldrick
Date: Mon Jan 4 04:43:15 2010
New Revision: 92473
URL: http://llvm.org/viewvc/llvm-project?rev=92473&view=rev
Log:
Port commit 90175 (dpatel) from llvm-gcc.
Modified:
dragonegg/trunk/llvm-debug.cpp
Modified: dragonegg/trunk/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-debug.cpp?rev=92473&r1=92472&r2=92473&view=diff
==============================================================================
--- dragonegg/trunk/llvm-debug.cpp (original)
+++ dragonegg/trunk/llvm-debug.cpp Mon Jan 4 04:43:15 2010
@@ -458,15 +458,33 @@
DW_TAG_reference_type;
expanded_location Loc = GetNodeLocation(type);
+ // Check if this pointer type has a name.
+ if (tree TyName = TYPE_NAME(type))
+ if (TREE_CODE(TyName) == TYPE_DECL && !DECL_ORIGINAL_TYPE(TyName)) {
+ expanded_location TypeNameLoc = GetNodeLocation(TyName);
+ DIType Ty = DebugFactory.CreateDerivedType(Tag, findRegion(TyName),
+ GetNodeName(TyName),
+ getOrCreateCompileUnit(TypeNameLoc.file),
+ TypeNameLoc.line,
+ 0 /*size*/,
+ 0 /*align*/,
+ 0 /*offset */,
+ 0 /*flags*/,
+ FromTy);
+ TypeCache[TyName] = WeakVH(Ty.getNode());
+ return Ty;
+ }
+
StringRef PName = FromTy.getName();
- return DebugFactory.CreateDerivedType(Tag, findRegion(type), PName,
- getOrCreateCompileUnit(NULL),
- 0 /*line no*/,
- NodeSizeInBits(type),
- NodeAlignInBits(type),
- 0 /*offset */,
- 0,
- FromTy);
+ DIType PTy = DebugFactory.CreateDerivedType(Tag, findRegion(type), PName,
+ getOrCreateCompileUnit(NULL),
+ 0 /*line no*/,
+ NodeSizeInBits(type),
+ NodeAlignInBits(type),
+ 0 /*offset */,
+ 0,
+ FromTy);
+ return PTy;
}
/// createArrayType - Create ArrayType.
More information about the llvm-commits
mailing list