[llvm-commits] [llvm-gcc-4.2] r91353 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp

Devang Patel dpatel at apple.com
Mon Dec 14 14:47:09 PST 2009


Author: dpatel
Date: Mon Dec 14 16:47:09 2009
New Revision: 91353

URL: http://llvm.org/viewvc/llvm-project?rev=91353&view=rev
Log:
Check for existing type descriptor in type cache.

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=91353&r1=91352&r2=91353&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Mon Dec 14 16:47:09 2009
@@ -694,9 +694,18 @@
     SFlags |= llvm::DIType::FlagAppleBlock;
   if (type_is_block_byref_struct(type))
     SFlags |= llvm::DIType::FlagBlockByrefStruct;
+  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