Remove the 2nd argument to Value::setName
authorChris Lattner <sabre@nondot.org>
Sat, 5 Mar 2005 19:01:49 +0000 (19:01 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 5 Mar 2005 19:01:49 +0000 (19:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20458 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/BasicBlock.cpp
lib/VMCore/Function.cpp
lib/VMCore/Globals.cpp
lib/VMCore/Instruction.cpp

index 92bdc50e7812486c3c39c733b2aa11373ea775e2..232a4e3391b5301cfe0b2179908ac7c46fe77d35 100644 (file)
@@ -96,10 +96,8 @@ void BasicBlock::setParent(Function *parent) {
 }
 
 // Specialize setName to take care of symbol table majik
-void BasicBlock::setName(const std::string &name, SymbolTable *ST) {
+void BasicBlock::setName(const std::string &name) {
   Function *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);
index ae4a549509ed577f3a249b2f4fe279a6db958851..7cced301e63f566f54d95a90413322baec8220ae 100644 (file)
@@ -64,10 +64,8 @@ Argument::Argument(const Type *Ty, const std::string &Name, Function *Par)
 
 
 // Specialize setName to take care of symbol table majik
-void Argument::setName(const std::string &name, SymbolTable *ST) {
+void Argument::setName(const std::string &name) {
   Function *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);
@@ -121,10 +119,8 @@ Function::~Function() {
 }
 
 // Specialize setName to take care of symbol table majik
-void Function::setName(const std::string &name, SymbolTable *ST) {
+void Function::setName(const std::string &name) {
   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 && hasName()) P->getSymbolTable().insert(this);
@@ -170,7 +166,7 @@ void Function::renameLocalSymbols() {
   for (SymbolTable::plane_iterator LPI = LST.plane_begin(), E = LST.plane_end();
        LPI != E; ++LPI)
     // All global symbols are of pointer type, ignore any non-pointer planes.
-    if (isa<PointerType>(LPI->first)) {
+    if (const PointerType *CurTy = dyn_cast<PointerType>(LPI->first)) {
       // Only check if the global plane has any symbols of this type.
       SymbolTable::plane_iterator GPI = GST.find(LPI->first);
       if (GPI != GST.plane_end()) {
index 8bcb53132430e05065b04e0d02c66dd0d19c2ccd..efa588bd561c3a539de2a120b3dcb5813a163487 100644 (file)
@@ -100,10 +100,8 @@ void GlobalVariable::setParent(Module *parent) {
 }
 
 // Specialize setName to take care of symbol table majik
-void GlobalVariable::setName(const std::string &name, SymbolTable *ST) {
+void GlobalVariable::setName(const std::string &name) {
   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 && hasName()) P->getSymbolTable().insert(this);
index b449c9962fa2c85750fc10c00d7480336188cabc..eeba47b52e9ef6398796684df7ba6611af320fc8 100644 (file)
@@ -58,11 +58,8 @@ void Instruction::setParent(BasicBlock *P) {
 }
 
 // Specialize setName to take care of symbol table majik
-void Instruction::setName(const std::string &name, SymbolTable *ST) {
+void Instruction::setName(const std::string &name) {
   BasicBlock *P = 0; Function *PP = 0;
-  assert((ST == 0 || !getParent() || !getParent()->getParent() || 
-         ST == &getParent()->getParent()->getSymbolTable()) &&
-        "Invalid symtab argument!");
   if ((P = getParent()) && (PP = P->getParent()) && hasName())
     PP->getSymbolTable().remove(this);
   Value::setName(name);