diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 80b54c58d92..263385c6119 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -75,9 +75,9 @@ public: /// @{ public: /// Return the slot number of the specified value in it's type - /// plane. If something is not in the SlotMachine, return -1. - int getLocalSlot(const Value *V); - int getGlobalSlot(const GlobalValue *V); + /// plane. Its an error to ask for something not in the SlotMachine. + /// Its an error to ask for a Type* + int getSlot(const Value *V); /// @} /// @name Mutators @@ -597,20 +597,13 @@ static void WriteAsOperandInternal(std::ostream &Out, const Value *V, } else { int Slot; if (Machine) { - if (const GlobalValue *GV = dyn_cast(V)) - Slot = Machine->getGlobalSlot(GV); - else - Slot = Machine->getLocalSlot(V); + Slot = Machine->getSlot(V); } else { Machine = createSlotMachine(V); - if (Machine) { - if (const GlobalValue *GV = dyn_cast(V)) - Slot = Machine->getGlobalSlot(GV); - else - Slot = Machine->getLocalSlot(V); - } else { + if (Machine) + Slot = Machine->getSlot(V); + else Slot = -1; - } delete Machine; } if (Slot != -1) @@ -1049,7 +1042,7 @@ void AssemblyWriter::printBasicBlock(const BasicBlock *BB) { Out << "\n" << getLLVMName(BB->getName(), false) << ':'; } else if (!BB->use_empty()) { // Don't print block # of no uses... Out << "\n;