mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01:00
bc15ae64dd
class. The Method class is obsolete (renamed) and all references to it are being converted over to Function. llvm-svn: 2144
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);
|
|
}
|