aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/BasicBlock.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-09-07 16:44:17 +0000
committerChris Lattner <sabre@nondot.org>2001-09-07 16:44:17 +0000
commit6892b126e3d3b90f13744cc1a7c83fd7f8d615f2 (patch)
tree06b35d0137caff17aefdf7b73911d7a0f3704bfc /lib/VMCore/BasicBlock.cpp
parentc0f483d4ef432b42f6996dc46edddef46367ad20 (diff)
Support new setName itf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@459 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/BasicBlock.cpp')
-rw-r--r--lib/VMCore/BasicBlock.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/VMCore/BasicBlock.cpp b/lib/VMCore/BasicBlock.cpp
index cf8fc41bd7..4c480db631 100644
--- a/lib/VMCore/BasicBlock.cpp
+++ b/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);