summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Writer/SlotCalculator.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-10 04:57:36 +0000
committerChris Lattner <sabre@nondot.org>2007-02-10 04:57:36 +0000
commitd090c6beedd8c36d3b9d31523beb2a6001c57e74 (patch)
tree93960e2dd92f5def5ad001699b0eb6e3e7fd5e53 /llvm/lib/Bytecode/Writer/SlotCalculator.cpp
parente2154a1fa17bb40de5a72ad100bca5bb76f3c5c1 (diff)
downloadbcm5719-llvm-d090c6beedd8c36d3b9d31523beb2a6001c57e74.tar.gz
bcm5719-llvm-d090c6beedd8c36d3b9d31523beb2a6001c57e74.zip
simplify and speed up recursive type processing.
llvm-svn: 34126
Diffstat (limited to 'llvm/lib/Bytecode/Writer/SlotCalculator.cpp')
-rw-r--r--llvm/lib/Bytecode/Writer/SlotCalculator.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Bytecode/Writer/SlotCalculator.cpp b/llvm/lib/Bytecode/Writer/SlotCalculator.cpp
index 3122f13cb7e..00f7cbc5aea 100644
--- a/llvm/lib/Bytecode/Writer/SlotCalculator.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud