mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-31 09:11:13 +00:00
2fbfdcffd3
class. The Method class is obsolete (renamed) and all references to it are being converted over to Function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2144 91177308-0d34-0410-b5e6-96231b3b80d8
29 lines
1023 B
C++
29 lines
1023 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/BasicBlock.h"
|
|
#include "llvm/Function.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; Function *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);
|
|
}
|