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

Evan Cheng evan.cheng at apple.com
Thu Jun 26 16:28:04 PDT 2008


Author: evancheng
Date: Thu Jun 26 18:28:04 2008
New Revision: 52798

URL: http://llvm.org/viewvc/llvm-project?rev=52798&view=rev
Log:
Avoid generating debug info for type variants.

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=52798&r1=52797&r2=52798&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Thu Jun 26 18:28:04 2008
@@ -439,11 +439,14 @@
 /// getOrCreateType - Get the type from the cache or create a new type if
 /// necessary.
 /// FIXME - I hate jumbo methods - split up.
-TypeDesc *DebugInfo::getOrCreateType(tree_node *type, CompileUnitDesc *Unit) {
+TypeDesc *DebugInfo::getOrCreateType(tree type, CompileUnitDesc *Unit) {
   DEBUGASSERT(type != NULL_TREE && type != error_mark_node &&
               "Not a type.");
   if (type == NULL_TREE || type == error_mark_node) return NULL;
-  
+
+  // Ignore about variants such as const, volatile, or restrict.
+  type = TYPE_MAIN_VARIANT(type);
+
   // Should only be void if a pointer/reference/return type.  Returning NULL
   // allows the caller to produce a non-derived type.
   if (TREE_CODE(type) == VOID_TYPE) return NULL;





More information about the llvm-commits mailing list