[llvm-commits] CVS: llvm/lib/CWriter/Writer.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Nov 20 12:33:07 PST 2002
Changes in directory llvm/lib/CWriter:
Writer.cpp updated: 1.75 -> 1.76
---
Log message:
- Eliminated the deferred symbol table stuff in Module & Function, it really
wasn't an optimization and it was causing lots of bugs.
---
Diffs of the changes:
Index: llvm/lib/CWriter/Writer.cpp
diff -u llvm/lib/CWriter/Writer.cpp:1.75 llvm/lib/CWriter/Writer.cpp:1.76
--- llvm/lib/CWriter/Writer.cpp:1.75 Mon Nov 18 16:21:52 2002
+++ llvm/lib/CWriter/Writer.cpp Wed Nov 20 12:32:03 2002
@@ -485,10 +485,10 @@
// Loop over the module symbol table, removing types from UT that are already
// named.
//
- SymbolTable *MST = M.getSymbolTableSure();
- if (MST->find(Type::TypeTy) != MST->end())
- for (SymbolTable::type_iterator I = MST->type_begin(Type::TypeTy),
- E = MST->type_end(Type::TypeTy); I != E; ++I)
+ SymbolTable &MST = M.getSymbolTable();
+ if (MST.find(Type::TypeTy) != MST.end())
+ for (SymbolTable::type_iterator I = MST.type_begin(Type::TypeTy),
+ E = MST.type_end(Type::TypeTy); I != E; ++I)
UT.erase(cast<Type>(I->second));
// UT now contains types that are not named. Loop over it, naming structure
@@ -498,7 +498,7 @@
for (std::set<const Type *>::const_iterator I = UT.begin(), E = UT.end();
I != E; ++I)
if (const StructType *ST = dyn_cast<StructType>(*I)) {
- ((Value*)ST)->setName("unnamed", MST);
+ ((Value*)ST)->setName("unnamed", &MST);
Changed = true;
}
return Changed;
@@ -547,8 +547,7 @@
//
// Loop over the symbol table, emitting all named constants...
- if (M->hasSymbolTable())
- printSymbolTable(*M->getSymbolTable());
+ printSymbolTable(M->getSymbolTable());
// Global variable declarations...
if (!M->gempty()) {
More information about the llvm-commits
mailing list