llvm-6502/lib/VMCore/Instruction.cpp
Chris Lattner 71947fdbc6 Switch from MachineCodeForVMInstr model that is built into the VMCore library to an annotation based MAchineCodeForInstruction model
Instruction.cpp now has 0 lines of code generation related code in it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1658 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-03 07:52:58 +00:00

28 lines
990 B
C++

//===-- Instruction.cpp - Implement the Instruction class --------*- C++ -*--=//
//
// This file implements the Instruction class for the VMCore library.
//
//===----------------------------------------------------------------------===//
#include "llvm/Instruction.h"
#include "llvm/Method.h"
#include "llvm/SymbolTable.h"
Instruction::Instruction(const Type *ty, unsigned it, const std::string &Name)
: User(ty, Value::InstructionVal, Name) {
Parent = 0;
iType = it;
}
// Specialize setName to take care of symbol table majik
void Instruction::setName(const std::string &name, SymbolTable *ST) {
BasicBlock *P = 0; Method *PP = 0;
assert((ST == 0 || !getParent() || !getParent()->getParent() ||
ST == getParent()->getParent()->getSymbolTable()) &&
"Invalid symtab argument!");
if ((P = getParent()) && (PP = P->getParent()) && hasName())
PP->getSymbolTable()->remove(this);
Value::setName(name);
if (PP && hasName()) PP->getSymbolTableSure()->insert(this);
}