llvm.org GIT mirror llvm / ee03f83
Merged revision 1.21. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_1@9462 91177308-0d34-0410-b5e6-96231b3b80d8 John Criswell 15 years ago
1 changed file(s) with 11 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
4040 IncorporateType(*I);
4141 }
4242
43 void FindUsedTypes::IncorporateSymbolTable(const SymbolTable &ST) {
44 SymbolTable::const_iterator TI = ST.find(Type::TypeTy);
45 if (TI == ST.end()) return; // No named types
46
47 for (SymbolTable::type_const_iterator I = TI->second.begin(),
48 E = TI->second.end(); I != E; ++I)
49 IncorporateType(cast(I->second));
50 }
4351
4452 // run - This incorporates all types used by the specified module
4553 //
4654 bool FindUsedTypes::run(Module &m) {
4755 UsedTypes.clear(); // reset if run multiple times...
56
57 IncorporateSymbolTable(m.getSymbolTable());
4858
4959 // Loop over global variables, incorporating their types
5060 for (Module::const_giterator I = m.gbegin(), E = m.gend(); I != E; ++I)
5363 for (Module::iterator MI = m.begin(), ME = m.end(); MI != ME; ++MI) {
5464 IncorporateType(MI->getType());
5565 const Function &F = *MI;
66 IncorporateSymbolTable(F.getSymbolTable());
5667
5768 // Loop over all of the instructions in the function, adding their return
5869 // type as well as the types of their operands.