[llvm-commits] [llvm-gcc4]Types were not being qualified properly (const and volatile)

Jim Laskey jlaskey at apple.com
Thu Dec 21 15:20:26 PST 2006


Index: gcc/llvm-debug.cpp
===================================================================
--- gcc/llvm-debug.cpp	(revision 121615)
+++ gcc/llvm-debug.cpp	(working copy)
@@ -451,11 +451,13 @@
/// 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) {
-  DEBUGASSERT(type != NULL_TREE && type != error_mark_node && "Not a  
type.");
-  if (type == NULL_TREE || type == error_mark_node) return NULL;
+TypeDesc *DebugInfo::getOrCreateType(tree_node *origtype,  
CompileUnitDesc *Unit)
+{
+  DEBUGASSERT(origtype != NULL_TREE && origtype != error_mark_node &&
+              "Not a type.");
+  if (origtype == NULL_TREE || origtype == error_mark_node) return  
NULL;

-  type = TYPE_MAIN_VARIANT(type);
+  tree type = TYPE_MAIN_VARIANT(origtype);

    // Should only be void if a pointer/reference/return type.   
Returning NULL
    // allows the caller to produce a non-derived type.
@@ -513,7 +515,7 @@
        Ty = DerivedTy;
        // Set the slot early to prevent recursion difficulties.
        // Any other use of the type should include the qualifiers.
-      Slot = AddTypeQualifiers(type, Unit, DerivedTy);
+      Slot = AddTypeQualifiers(origtype, Unit, DerivedTy);
        // Handle the derived type.
        TypeDesc *FromTy = getOrCreateType(TREE_TYPE(type), Unit);
        DerivedTy->setFromType(FromTy);
@@ -535,7 +537,7 @@
        Ty = SubrTy;
        // Set the slot early to prevent recursion difficulties.
        // Any other use of the type should include the qualifiers.
-      Slot = AddTypeQualifiers(type, Unit, SubrTy);
+      Slot = AddTypeQualifiers(origtype, Unit, SubrTy);

        // Prepare to add the arguments for the subroutine.
        std::vector<DebugInfoDesc *> &Elements = SubrTy->getElements();
@@ -570,14 +572,14 @@
          Ty = ArrayTy = new CompositeTypeDesc(DW_TAG_vector_type);
          // Set the slot early to prevent recursion difficulties.
          // Any other use of the type should include the qualifiers.
-        Slot = AddTypeQualifiers(type, Unit, ArrayTy);
+        Slot = AddTypeQualifiers(origtype, Unit, ArrayTy);
          // Use the element type of the from this point.
          type = TREE_TYPE(TYPE_FIELDS(TYPE_DEBUG_REPRESENTATION_TYPE 
(type)));
        } else {
          Ty = ArrayTy = new CompositeTypeDesc(DW_TAG_array_type);
          // Set the slot early to prevent recursion difficulties.
          // Any other use of the type should include the qualifiers.
-        Slot = AddTypeQualifiers(type, Unit, ArrayTy);
+        Slot = AddTypeQualifiers(origtype, Unit, ArrayTy);
        }
        // Prepare to add the dimensions of the array.
@@ -614,7 +616,7 @@
        CompositeTypeDesc *Enum = new CompositeTypeDesc 
(DW_TAG_enumeration_type);
        Ty = Enum;
        // Any other use of the type should include the qualifiers.
-      Slot = AddTypeQualifiers(type, Unit, Enum);
+      Slot = AddTypeQualifiers(origtype, Unit, Enum);
        // Prepare to add the enumeration values.
        std::vector<DebugInfoDesc *> &Elements = Enum->getElements();
@@ -645,7 +647,7 @@
        Ty = StructTy;
        // Set the slot early to prevent recursion difficulties.
        // Any other use of the type should include the qualifiers.
-      Slot = AddTypeQualifiers(type, Unit, StructTy);
+      Slot = AddTypeQualifiers(origtype, Unit, StructTy);
        // Prepare to add the fields.
        std::vector<DebugInfoDesc *> &Elements = StructTy->getElements 
();

@@ -770,7 +772,7 @@
        BasicTypeDesc *BTy = new BasicTypeDesc();
        Ty = BTy;
        // Any other use of the type should include the qualifiers.
-      Slot = AddTypeQualifiers(type, Unit, BTy);
+      Slot = AddTypeQualifiers(origtype, Unit, BTy);
        // The encoding specific to the type.
        unsigned Encoding = 0;
Index: gcc/llvm-debug.h
===================================================================
--- gcc/llvm-debug.h	(revision 121615)
+++ gcc/llvm-debug.h	(working copy)
@@ -121,7 +121,7 @@
    /// getOrCreateType - Get the type from the cache or create a new  
type if
    /// necessary.
-  TypeDesc *getOrCreateType(tree_node *type, CompileUnitDesc *Unit);
+  TypeDesc *getOrCreateType(tree_node *origtype, CompileUnitDesc  
*Unit);
    /// getOrCreateCompileUnit - Get the compile unit from the cache  
or create a
    /// new one if necessary.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2417 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20061221/9aa3f4b1/attachment.bin>


More information about the llvm-commits mailing list