#include "llvm/ValueHolderImpl.h"
#include "llvm/BasicBlock.h"
#include "llvm/iTerminators.h"
-#include "llvm/Module.h"
#include "llvm/Method.h"
#include "llvm/SymbolTable.h"
#include "llvm/Type.h"
template class ValueHolder<Instruction, BasicBlock, Method>;
BasicBlock::BasicBlock(const string &name, Method *Parent)
- : Value(Type::LabelTy, Value::BasicBlockVal, name),
- InstList(this, 0),
- machineInstrVec(new MachineCodeForBasicBlock)
-{
+ : Value(Type::LabelTy, Value::BasicBlockVal, name), InstList(this, 0),
+ machineInstrVec(new MachineCodeForBasicBlock) {
if (Parent)
Parent->getBasicBlocks().push_back(this);
}
}
// Specialize setName to take care of symbol table majik
-void BasicBlock::setName(const string &name) {
+void BasicBlock::setName(const string &name, SymbolTable *ST) {
Method *P;
+ assert((ST == 0 || (!getParent() || ST == getParent()->getSymbolTable())) &&
+ "Invalid symtab argument!");
if ((P = getParent()) && hasName()) P->getSymbolTable()->remove(this);
Value::setName(name);
if (P && hasName()) P->getSymbolTable()->insert(this);