diff options
author | Chris Lattner <sabre@nondot.org> | 2007-02-10 05:18:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-02-10 05:18:35 +0000 |
commit | 0132599b8d51201360f707cea72164f81fb6a226 (patch) | |
tree | 0c8657248eff868b3f5d1d0899e237d9a12daade /llvm/lib/Bytecode/Writer | |
parent | 832676a772e3a5d85e8dc736b756231921a36e5d (diff) | |
download | bcm5719-llvm-0132599b8d51201360f707cea72164f81fb6a226.tar.gz bcm5719-llvm-0132599b8d51201360f707cea72164f81fb6a226.zip |
make getSlot/getTypeSlot inline
llvm-svn: 34130
Diffstat (limited to 'llvm/lib/Bytecode/Writer')
-rw-r--r-- | llvm/lib/Bytecode/Writer/SlotCalculator.cpp | 12 | ||||
-rw-r--r-- | llvm/lib/Bytecode/Writer/SlotCalculator.h | 13 |
2 files changed, 11 insertions, 14 deletions
diff --git a/llvm/lib/Bytecode/Writer/SlotCalculator.cpp b/llvm/lib/Bytecode/Writer/SlotCalculator.cpp index 172da73f136..dfb87b48ece 100644 --- a/llvm/lib/Bytecode/Writer/SlotCalculator.cpp +++ b/llvm/lib/Bytecode/Writer/SlotCalculator.cpp @@ -278,18 +278,6 @@ void SlotCalculator::purgeFunction() { SC_DEBUG("end purgeFunction!\n"); } -unsigned SlotCalculator::getSlot(const Value *V) const { - std::map<const Value*, unsigned>::const_iterator I = NodeMap.find(V); - assert(I != NodeMap.end() && "Value not in slotcalculator!"); - return (int)I->second; -} - -unsigned SlotCalculator::getTypeSlot(const Type*T) const { - std::map<const Type*, unsigned>::const_iterator I = TypeMap.find(T); - assert(I != TypeMap.end() && "Type not in slotcalc!"); - return I->second; -} - void SlotCalculator::CreateSlotIfNeeded(const Value *V) { // Check to see if it's already in! if (NodeMap.count(V)) return; diff --git a/llvm/lib/Bytecode/Writer/SlotCalculator.h b/llvm/lib/Bytecode/Writer/SlotCalculator.h index 7613556494d..bfc80489b2b 100644 --- a/llvm/lib/Bytecode/Writer/SlotCalculator.h +++ b/llvm/lib/Bytecode/Writer/SlotCalculator.h @@ -65,8 +65,17 @@ public: /// getSlot - Return the slot number of the specified value in it's type /// plane. This returns < 0 on error! /// - unsigned getSlot(const Value *V) const; - unsigned getTypeSlot(const Type* T) const; + unsigned getSlot(const Value *V) const { + std::map<const Value*, unsigned>::const_iterator I = NodeMap.find(V); + assert(I != NodeMap.end() && "Value not in slotcalculator!"); + return I->second; + } + + unsigned getTypeSlot(const Type* T) const { + std::map<const Type*, unsigned>::const_iterator I = TypeMap.find(T); + assert(I != TypeMap.end() && "Type not in slotcalc!"); + return I->second; + } inline unsigned getNumPlanes() const { return Table.size(); } inline unsigned getNumTypes() const { return Types.size(); } |