[llvm-commits] [dragonegg] r92699 - /dragonegg/trunk/llvm-debug.cpp
Duncan Sands
baldrick at free.fr
Mon Jan 4 23:03:40 PST 2010
Author: baldrick
Date: Tue Jan 5 01:03:39 2010
New Revision: 92699
URL: http://llvm.org/viewvc/llvm-project?rev=92699&view=rev
Log:
Port commit 91353 (dpatel) from llvm-gcc:
Check for existing type descriptor in type cache.
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=92699&r1=92698&r2=92699&view=diff
==============================================================================
--- dragonegg/trunk/llvm-debug.cpp (original)
+++ dragonegg/trunk/llvm-debug.cpp Tue Jan 5 01:03:39 2010
@@ -650,9 +650,18 @@
if (!TypeName.empty())
FwdName = FwdName + TypeName.data();
unsigned SFlags = 0;
+ DIDescriptor TyContext = findRegion(TYPE_CONTEXT(type));
+
+ // Check if this type is created while creating context information
+ // descriptor.
+ std::map<tree_node *, WeakVH >::iterator I = TypeCache.find(type);
+ if (I != TypeCache.end())
+ if (MDNode *TN = dyn_cast_or_null<MDNode>(I->second))
+ return DIType(TN);
+
llvm::DICompositeType FwdDecl =
DebugFactory.CreateCompositeType(Tag,
- findRegion(TYPE_CONTEXT(type)),
+ TyContext,
FwdName.c_str(),
getOrCreateCompileUnit(Loc.file),
Loc.line,
More information about the llvm-commits
mailing list