aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-02-10 05:18:35 +0000
committerChris Lattner <sabre@nondot.org>2007-02-10 05:18:35 +0000
commit2b8269f92bde5e09e92b54f5ff9cda93e9831b71 (patch)
tree8f1441be77d84d50870a4a070e7f9616bc0efbca /lib/Bytecode
parent972b4dccaf554b2e9940293f2df55a16ef34fb66 (diff)
make getSlot/getTypeSlot inline
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34130 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode')
-rw-r--r--lib/Bytecode/Writer/SlotCalculator.cpp12
-rw-r--r--lib/Bytecode/Writer/SlotCalculator.h13
2 files changed, 11 insertions, 14 deletions
diff --git a/lib/Bytecode/Writer/SlotCalculator.cpp b/lib/Bytecode/Writer/SlotCalculator.cpp
index 172da73f13..dfb87b48ec 100644
--- a/lib/Bytecode/Writer/SlotCalculator.cpp
+++ b/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/lib/Bytecode/Writer/SlotCalculator.h b/lib/Bytecode/Writer/SlotCalculator.h
index 7613556494..bfc80489b2 100644
--- a/lib/Bytecode/Writer/SlotCalculator.h
+++ b/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(); }