[llvm-commits] [bug_122] CVS: llvm/lib/Transforms/Scalar/SymbolStripping.cpp
LLVM
llvm at cs.uiuc.edu
Wed May 12 11:33:41 PDT 2004
Changes in directory llvm/lib/Transforms/Scalar:
SymbolStripping.cpp updated: 1.25 -> 1.25.6.1
---
Log message:
Change SymbolTable to not subclass from std::map but to embed one instead
and cleanup use of SymbolTable in rest of LLVM. Also, add some new methods
to SymbolTable for small/utility cases and substitute calls to them in
LLVM.
---
Diffs of the changes: (+1 -26)
Index: llvm/lib/Transforms/Scalar/SymbolStripping.cpp
diff -u llvm/lib/Transforms/Scalar/SymbolStripping.cpp:1.25 llvm/lib/Transforms/Scalar/SymbolStripping.cpp:1.25.6.1
--- llvm/lib/Transforms/Scalar/SymbolStripping.cpp:1.25 Sat Jan 10 15:36:49 2004
+++ llvm/lib/Transforms/Scalar/SymbolStripping.cpp Wed May 12 11:33:43 2004
@@ -28,32 +28,7 @@
using namespace llvm;
static bool StripSymbolTable(SymbolTable &SymTab) {
- bool RemovedSymbol = false;
-
- for (SymbolTable::iterator I = SymTab.begin(); I != SymTab.end();) {
- // Removing items from the plane can cause the plane itself to get deleted.
- // If this happens, make sure we incremented our plane iterator already!
- std::map<const std::string, Value *> &Plane = (I++)->second;
-
- SymbolTable::type_iterator B = Plane.begin(), Bend = Plane.end();
- while (B != Bend) { // Found nonempty type plane!
- Value *V = B->second;
-
- if (isa<Constant>(V) || isa<Type>(V)) {
- SymTab.type_remove(B++);
- RemovedSymbol = true;
- } else {
- ++B;
- if (!isa<GlobalValue>(V) || cast<GlobalValue>(V)->hasInternalLinkage()){
- // Set name to "", removing from symbol table!
- V->setName("", &SymTab);
- RemovedSymbol = true;
- }
- }
- }
- }
-
- return RemovedSymbol;
+ return SymTab.strip();
}
namespace {
More information about the llvm-commits
mailing list