Support new setName interface
authorChris Lattner <sabre@nondot.org>
Fri, 7 Sep 2001 16:47:18 +0000 (16:47 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 7 Sep 2001 16:47:18 +0000 (16:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@462 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Function.cpp
lib/VMCore/InstrTypes.cpp

index 3d4a3547b0d7448bf4c53ac7457373982bcad8fc..bd342a2473c46eb0e59869b9ceffb728957ead7b 100644 (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);
index d0c410051a5bdf03c42328281f626c45a4f3f5cc..dbace177a98d2f1fac3e0b7c51cfefcc0e8a5a70 100644 (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);