mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-05 02:16:46 +00:00
7e70829632
For details, See: docs/2002-06-25-MegaPatchInfo.txt git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2779 91177308-0d34-0410-b5e6-96231b3b80d8
28 lines
987 B
C++
28 lines
987 B
C++
//===-- Instruction.cpp - Implement the Instruction class --------*- C++ -*--=//
|
|
//
|
|
// This file implements the Instruction class for the VMCore library.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "llvm/Function.h"
|
|
#include "llvm/SymbolTable.h"
|
|
#include "llvm/Type.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);
|
|
}
|