[llvm-commits] CVS: llvm/lib/Bytecode/Writer/SlotCalculator.cpp

Chris Lattner sabre at nondot.org
Fri Feb 9 20:57:52 PST 2007



Changes in directory llvm/lib/Bytecode/Writer:

SlotCalculator.cpp updated: 1.97 -> 1.98
---
Log message:

simplify and speed up recursive type processing.


---
Diffs of the changes:  (+2 -4)

 SlotCalculator.cpp |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)


Index: llvm/lib/Bytecode/Writer/SlotCalculator.cpp
diff -u llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.97 llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.98
--- llvm/lib/Bytecode/Writer/SlotCalculator.cpp:1.97	Fri Feb  9 22:54:01 2007
+++ llvm/lib/Bytecode/Writer/SlotCalculator.cpp	Fri Feb  9 22:57:36 2007
@@ -362,16 +362,14 @@
   //    global { \2 * } { { \2 }* null }
   //
   unsigned ResultSlot = doInsertType(Ty);
-  SC_DEBUG("  Inserted type: " << Ty->getDescription() << " slot=" <<
-           ResultSlot << "\n");
 
   // Loop over any contained types in the definition... in post
   // order.
   for (po_iterator<const Type*> I = po_begin(Ty), E = po_end(Ty);
        I != E; ++I) {
-    if (*I != Ty) {
+    if (*I != Ty && !TypeMap.count(*I)) {
       // If we haven't seen this sub type before, add it to our type table!
-      getOrCreateTypeSlot(*I);
+      doInsertType(*I);
     }
   }
   return ResultSlot;






More information about the llvm-commits mailing list