diff options
author | Chris Lattner <sabre@nondot.org> | 2001-09-07 16:44:17 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2001-09-07 16:44:17 +0000 |
commit | 2d189a5981914c9232a02de4ae62940e020804ff (patch) | |
tree | 68219aa9f2beb3f54f28fa0275957310c3771d02 /llvm/lib/VMCore/BasicBlock.cpp | |
parent | da010ca1b977d7508736d37f0eba9a16dc43b679 (diff) | |
download | bcm5719-llvm-2d189a5981914c9232a02de4ae62940e020804ff.tar.gz bcm5719-llvm-2d189a5981914c9232a02de4ae62940e020804ff.zip |
Support new setName itf
llvm-svn: 459
Diffstat (limited to 'llvm/lib/VMCore/BasicBlock.cpp')
-rw-r--r-- | llvm/lib/VMCore/BasicBlock.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/VMCore/BasicBlock.cpp b/llvm/lib/VMCore/BasicBlock.cpp index cf8fc41bd74..4c480db631c 100644 --- a/llvm/lib/VMCore/BasicBlock.cpp +++ b/llvm/lib/VMCore/BasicBlock.cpp @@ -7,7 +7,6 @@ #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" @@ -21,10 +20,8 @@ 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); } @@ -36,8 +33,10 @@ BasicBlock::~BasicBlock() { } // 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); |