[llvm-branch-commits] [llvm-gcc-branch] r90179 - /llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.cpp

Devang Patel dpatel at apple.com
Mon Nov 30 16:22:05 PST 2009


Author: dpatel
Date: Mon Nov 30 18:22:05 2009
New Revision: 90179

URL: http://llvm.org/viewvc/llvm-project?rev=90179&view=rev
Log:
Merge r90175 from trunk.

Modified:
    llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.cpp

Modified: llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.cpp?rev=90179&r1=90178&r2=90179&view=diff

==============================================================================
--- llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-debug.cpp Mon Nov 30 18:22:05 2009
@@ -497,17 +497,36 @@
   unsigned Flags = 0;
   if (type_is_block_byref_struct(type))
     Flags |= llvm::DIType::FlagBlockByrefStruct;
+
   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 */, 
-                                         Flags, 
-                                         FromTy);
+  DIType PTy = DebugFactory.CreateDerivedType(Tag, findRegion(type), PName,
+                                              getOrCreateCompileUnit(NULL), 
+                                              0 /*line no*/, 
+                                              NodeSizeInBits(type),
+                                              NodeAlignInBits(type),
+                                              0 /*offset */, 
+                                              Flags, 
+                                              FromTy);
+  return PTy;
 }
 
 /// createArrayType - Create ArrayType.





More information about the llvm-branch-commits mailing list