diff options
author | Chris Lattner <sabre@nondot.org> | 2007-01-12 23:23:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-01-12 23:23:08 +0000 |
commit | 65258e9ef3adab06555c6363637e9dc0458f6e03 (patch) | |
tree | d84ae93418c0cdd41f9edbb0af706f3de277ac48 /llvm/lib/Bytecode | |
parent | 015b432b540d9bd9b32c3cf8e02ecec2ae8eb767 (diff) | |
download | bcm5719-llvm-65258e9ef3adab06555c6363637e9dc0458f6e03.tar.gz bcm5719-llvm-65258e9ef3adab06555c6363637e9dc0458f6e03.zip |
Eliminate a log(n) lookup
llvm-svn: 33155
Diffstat (limited to 'llvm/lib/Bytecode')
-rw-r--r-- | llvm/lib/Bytecode/Writer/SlotCalculator.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Bytecode/Writer/SlotCalculator.cpp b/llvm/lib/Bytecode/Writer/SlotCalculator.cpp index 2d4cd0c4cb4..65215fecb17 100644 --- a/llvm/lib/Bytecode/Writer/SlotCalculator.cpp +++ b/llvm/lib/Bytecode/Writer/SlotCalculator.cpp @@ -279,7 +279,7 @@ void SlotCalculator::processSymbolTableConstants(const SymbolTable *ST) { void SlotCalculator::incorporateFunction(const Function *F) { - assert((ModuleLevel.size() == 0 || + assert((ModuleLevel.empty() || ModuleTypeLevel == 0) && "Module already incorporated!"); SC_DEBUG("begin processFunction!\n"); @@ -442,7 +442,7 @@ unsigned SlotCalculator::getOrCreateCompactionTableSlot(const Type *T) { unsigned SlotNo = CompactionTypes.size(); SC_DEBUG("Inserting Compaction Type #" << SlotNo << ": " << *T << "\n"); CompactionTypes.push_back(T); - CompactionTypeMap[T] = SlotNo; + CompactionTypeMap.insert(I, std::make_pair(T, SlotNo)); return SlotNo; } @@ -639,7 +639,7 @@ void SlotCalculator::pruneCompactionTable() { /// to determine if its actually empty. bool SlotCalculator::CompactionTableIsEmpty() const { // Check a degenerate case, just in case. - if (CompactionTable.size() == 0) + if (CompactionTable.empty()) return true; // Check each plane |