[llvm-commits] CVS: llvm/lib/VMCore/Instruction.cpp Globals.cpp BasicBlock.cpp Function.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat Mar 5 11:02:05 PST 2005
Changes in directory llvm/lib/VMCore:
Instruction.cpp updated: 1.42 -> 1.43
Globals.cpp updated: 1.8 -> 1.9
BasicBlock.cpp updated: 1.57 -> 1.58
Function.cpp updated: 1.88 -> 1.89
---
Log message:
Remove the 2nd argument to Value::setName
---
Diffs of the changes: (+6 -17)
BasicBlock.cpp | 4 +---
Function.cpp | 10 +++-------
Globals.cpp | 4 +---
Instruction.cpp | 5 +----
4 files changed, 6 insertions(+), 17 deletions(-)
Index: llvm/lib/VMCore/Instruction.cpp
diff -u llvm/lib/VMCore/Instruction.cpp:1.42 llvm/lib/VMCore/Instruction.cpp:1.43
--- llvm/lib/VMCore/Instruction.cpp:1.42 Fri Jan 28 18:35:33 2005
+++ llvm/lib/VMCore/Instruction.cpp Sat Mar 5 13:01:49 2005
@@ -58,11 +58,8 @@
}
// 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);
Index: llvm/lib/VMCore/Globals.cpp
diff -u llvm/lib/VMCore/Globals.cpp:1.8 llvm/lib/VMCore/Globals.cpp:1.9
--- llvm/lib/VMCore/Globals.cpp:1.8 Fri Jan 28 18:35:33 2005
+++ llvm/lib/VMCore/Globals.cpp Sat Mar 5 13:01:49 2005
@@ -100,10 +100,8 @@
}
// 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: llvm/lib/VMCore/BasicBlock.cpp
diff -u llvm/lib/VMCore/BasicBlock.cpp:1.57 llvm/lib/VMCore/BasicBlock.cpp:1.58
--- llvm/lib/VMCore/BasicBlock.cpp:1.57 Wed Feb 23 20:37:26 2005
+++ llvm/lib/VMCore/BasicBlock.cpp Sat Mar 5 13:01:49 2005
@@ -96,10 +96,8 @@
}
// 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: llvm/lib/VMCore/Function.cpp
diff -u llvm/lib/VMCore/Function.cpp:1.88 llvm/lib/VMCore/Function.cpp:1.89
--- llvm/lib/VMCore/Function.cpp:1.88 Mon Feb 28 13:28:00 2005
+++ llvm/lib/VMCore/Function.cpp Sat Mar 5 13:01:49 2005
@@ -64,10 +64,8 @@
// 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 @@
}
// 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 @@
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()) {
More information about the llvm-commits
mailing list