Support new setName interface

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@462 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2001-09-07 16:47:18 +00:00
parent e05bf2f49c
commit 7c43a0ace7
2 changed files with 6 additions and 2 deletions

View File

@ -39,8 +39,10 @@ Method::~Method() {
}
// Specialize setName to take care of symbol table majik
void Method::setName(const string &name) {
void Method::setName(const string &name, SymbolTable *ST) {
Module *P;
assert((ST == 0 || (!getParent() || ST == getParent()->getSymbolTable())) &&
"Invalid symtab argument!");
if ((P = getParent()) && hasName()) P->getSymbolTable()->remove(this);
Value::setName(name);
if (P && getName() != "") P->getSymbolTableSure()->insert(this);

View File

@ -25,8 +25,10 @@ TerminatorInst::TerminatorInst(unsigned iType)
//===----------------------------------------------------------------------===//
// Specialize setName to take care of symbol table majik
void MethodArgument::setName(const string &name) {
void MethodArgument::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);