summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/IPO')
-rw-r--r--lib/Transforms/IPO/DeadTypeElimination.cpp9
-rw-r--r--lib/Transforms/IPO/StripSymbols.cpp7
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/Transforms/IPO/DeadTypeElimination.cpp b/lib/Transforms/IPO/DeadTypeElimination.cpp
index 8199f746a2..871bcff158 100644
--- a/lib/Transforms/IPO/DeadTypeElimination.cpp
+++ b/lib/Transforms/IPO/DeadTypeElimination.cpp
@@ -16,7 +16,7 @@
#include "llvm/Transforms/IPO.h"
#include "llvm/Analysis/FindUsedTypes.h"
#include "llvm/Module.h"
-#include "llvm/SymbolTable.h"
+#include "llvm/TypeSymbolTable.h"
#include "llvm/DerivedTypes.h"
#include "llvm/ADT/Statistic.h"
using namespace llvm;
@@ -69,14 +69,15 @@ static inline bool ShouldNukeSymtabEntry(const Type *Ty){
bool DTE::runOnModule(Module &M) {
bool Changed = false;
- SymbolTable &ST = M.getSymbolTable();
+ TypeSymbolTable &ST = M.getTypeSymbolTable();
std::set<const Type *> UsedTypes = getAnalysis<FindUsedTypes>().getTypes();
// Check the symbol table for superfluous type entries...
//
// Grab the 'type' plane of the module symbol...
- SymbolTable::type_iterator TI = ST.type_begin();
- while ( TI != ST.type_end() ) {
+ TypeSymbolTable::iterator TI = ST.begin();
+ TypeSymbolTable::iterator TE = ST.end();
+ while ( TI != TE ) {
// If this entry should be unconditionally removed, or if we detect that
// the type is not used, remove it.
const Type *RHS = TI->second;
diff --git a/lib/Transforms/IPO/StripSymbols.cpp b/lib/Transforms/IPO/StripSymbols.cpp
index 75b24a7282..12cd7fe893 100644
--- a/lib/Transforms/IPO/StripSymbols.cpp
+++ b/lib/Transforms/IPO/StripSymbols.cpp
@@ -29,6 +29,7 @@
#include "llvm/Module.h"
#include "llvm/Pass.h"
#include "llvm/SymbolTable.h"
+#include "llvm/TypeSymbolTable.h"
using namespace llvm;
namespace {
@@ -83,13 +84,11 @@ bool StripSymbols::runOnModule(Module &M) {
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
if (I->hasInternalLinkage())
I->setName(""); // Internal symbols can't participate in linkage
- I->getSymbolTable().strip();
+ I->getValueSymbolTable().strip();
}
// Remove all names from types.
- SymbolTable &SymTab = M.getSymbolTable();
- while (SymTab.type_begin() != SymTab.type_end())
- SymTab.remove(SymTab.type_begin());
+ M.getTypeSymbolTable().strip();
}
// Strip debug info in the module if it exists. To do this, we remove