[llvm-commits] CVS: llvm/lib/CodeGen/DwarfWriter.cpp

Jim Laskey jlaskey at apple.com
Thu Nov 2 13:48:33 PST 2006



Changes in directory llvm/lib/CodeGen:

DwarfWriter.cpp updated: 1.93 -> 1.94
---
Log message:


1. Hash not quite right for DIEValues.

2. Not going to use Usage (no significant benefit.)


---
Diffs of the changes:  (+10 -25)

 DwarfWriter.cpp |   35 ++++++++++-------------------------
 1 files changed, 10 insertions(+), 25 deletions(-)


Index: llvm/lib/CodeGen/DwarfWriter.cpp
diff -u llvm/lib/CodeGen/DwarfWriter.cpp:1.93 llvm/lib/CodeGen/DwarfWriter.cpp:1.94
--- llvm/lib/CodeGen/DwarfWriter.cpp:1.93	Thu Nov  2 14:55:40 2006
+++ llvm/lib/CodeGen/DwarfWriter.cpp	Thu Nov  2 15:48:18 2006
@@ -354,19 +354,13 @@
   ///
   unsigned Type;
   
-  /// Usage - Number of uses of this value.
-  ///
-  unsigned Usage;
-  
   DIEValue(unsigned T)
   : Type(T)
-  , Usage(1)
   {}
   virtual ~DIEValue() {}
   
+  // Accessors
   unsigned getType()  const { return Type; }
-  unsigned getUsage() const { return Usage; }
-  void IncUsage()           { ++Usage; }
   
   // Implement isa/cast/dyncast.
   static bool classof(const DIEValue *) { return true; }
@@ -445,6 +439,7 @@
   /// Profile - Used to gather unique data for the value folding set.
   ///
   virtual void Profile(FoldingSetNodeID &ID) {
+    ID.AddInteger(isInteger);
     ID.AddInteger(Integer);
   }
   
@@ -482,6 +477,7 @@
   /// Profile - Used to gather unique data for the value folding set.
   ///
   virtual void Profile(FoldingSetNodeID &ID) {
+    ID.AddInteger(isString);
     ID.AddString(String);
   }
   
@@ -517,6 +513,7 @@
   /// Profile - Used to gather unique data for the value folding set.
   ///
   virtual void Profile(FoldingSetNodeID &ID) {
+    ID.AddInteger(isLabel);
     Label.Profile(ID);
   }
   
@@ -553,6 +550,7 @@
   /// Profile - Used to gather unique data for the value folding set.
   ///
   virtual void Profile(FoldingSetNodeID &ID) {
+    ID.AddInteger(isAsIsLabel);
     ID.AddString(Label);
   }
 
@@ -589,6 +587,7 @@
   /// Profile - Used to gather unique data for the value folding set.
   ///
   virtual void Profile(FoldingSetNodeID &ID){
+    ID.AddInteger(isDelta);
     LabelHi.Profile(ID);
     LabelLo.Profile(ID);
   }
@@ -630,6 +629,8 @@
   /// Profile - Used to gather unique data for the value folding set.
   ///
   virtual void Profile(FoldingSetNodeID &ID) {
+    ID.AddInteger(isEntry);
+    
     if (Entry) {
       ID.AddPointer(Entry);
     } else {
@@ -688,6 +689,7 @@
   /// Profile - Used to gather unique data for the value folding set.
   ///
   virtual void DIEBlock::Profile(FoldingSetNodeID &ID) {
+    ID.AddInteger(isBlock);
     DIE::Profile(ID);
   }
   
@@ -1147,10 +1149,7 @@
       void *Where;
       Value = static_cast<DIEntry *>(ValuesSet.FindNodeOrInsertPos(ID, Where));
       
-      if (Value) {
-        Value->IncUsage();
-        return Value;
-      }
+      if (Value) return Value;
       
       Value = new DIEntry(Entry);
       ValuesSet.InsertNode(Value, Where);
@@ -1184,8 +1183,6 @@
       Value = new DIEInteger(Integer);
       ValuesSet.InsertNode(Value, Where);
       Values.push_back(Value);
-    } else {
-      Value->IncUsage();
     }
   
     Die->AddValue(Attribute, Form, Value);
@@ -1204,8 +1201,6 @@
       Value = new DIEInteger(Integer);
       ValuesSet.InsertNode(Value, Where);
       Values.push_back(Value);
-    } else {
-      Value->IncUsage();
     }
   
     Die->AddValue(Attribute, Form, Value);
@@ -1223,8 +1218,6 @@
       Value = new DIEString(String);
       ValuesSet.InsertNode(Value, Where);
       Values.push_back(Value);
-    } else {
-      Value->IncUsage();
     }
   
     Die->AddValue(Attribute, Form, Value);
@@ -1242,8 +1235,6 @@
       Value = new DIEDwarfLabel(Label);
       ValuesSet.InsertNode(Value, Where);
       Values.push_back(Value);
-    } else {
-      Value->IncUsage();
     }
   
     Die->AddValue(Attribute, Form, Value);
@@ -1261,8 +1252,6 @@
       Value = new DIEObjectLabel(Label);
       ValuesSet.InsertNode(Value, Where);
       Values.push_back(Value);
-    } else {
-      Value->IncUsage();
     }
   
     Die->AddValue(Attribute, Form, Value);
@@ -1281,8 +1270,6 @@
       Value = new DIEDelta(Hi, Lo);
       ValuesSet.InsertNode(Value, Where);
       Values.push_back(Value);
-    } else {
-      Value->IncUsage();
     }
   
     Die->AddValue(Attribute, Form, Value);
@@ -1307,7 +1294,6 @@
       ValuesSet.InsertNode(Value, Where);
       Values.push_back(Value);
     } else {
-      Value->IncUsage();
       delete Block;
     }
   
@@ -1402,7 +1388,6 @@
       
       // If it exists then use the existing value.
       if (Slot) {
-        Slot->IncUsage();
         Entity->AddValue(DW_AT_type, DW_FORM_ref4, Slot);
         return;
       }






More information about the llvm-commits mailing list