diff options
author | Chris Lattner <sabre@nondot.org> | 2007-02-10 04:57:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-02-10 04:57:36 +0000 |
commit | 25c0293f20be1a6da4ff9bdf42cd86757789839a (patch) | |
tree | 3bdf02e22cefc807e6db84c7d91b0f4a39aa3df8 /lib/Bytecode | |
parent | 94bec4fbf8538af2e229ac64cc307507f95ee792 (diff) |
simplify and speed up recursive type processing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34126 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode')
-rw-r--r-- | lib/Bytecode/Writer/SlotCalculator.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/Bytecode/Writer/SlotCalculator.cpp b/lib/Bytecode/Writer/SlotCalculator.cpp index 3122f13cb7..00f7cbc5ae 100644 --- a/lib/Bytecode/Writer/SlotCalculator.cpp +++ b/lib/Bytecode/Writer/SlotCalculator.cpp @@ -362,16 +362,14 @@ unsigned SlotCalculator::getOrCreateTypeSlot(const Type *Ty) { // 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; |