From 78d033e086e19e016273de014f9214aa6f3f844b Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sat, 6 Jan 2007 07:24:44 +0000 Subject: For PR411: Take an incremental step towards type plane elimination. This change separates types from values in the symbol tables by finally making use of the TypeSymbolTable class. This yields more natural interfaces for dealing with types and unclutters the SymbolTable class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32956 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/DeadTypeElimination.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/Transforms/IPO/DeadTypeElimination.cpp') 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 UsedTypes = getAnalysis().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; -- cgit v1.2.3