summaryrefslogtreecommitdiff
path: root/lib/Analysis/IPA/FindUsedTypes.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-06-25 16:13:24 +0000
committerChris Lattner <sabre@nondot.org>2002-06-25 16:13:24 +0000
commit7e70829632f82de15db187845666aaca6e04b792 (patch)
tree48dd2d804e7ebec9a3cbd8bf229cb2a2aa20dce5 /lib/Analysis/IPA/FindUsedTypes.cpp
parent0b12b5f50ec77a8bd01b92d287c52d748619bb4b (diff)
downloadllvm-7e70829632f82de15db187845666aaca6e04b792.tar.gz
llvm-7e70829632f82de15db187845666aaca6e04b792.tar.bz2
llvm-7e70829632f82de15db187845666aaca6e04b792.tar.xz
MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/IPA/FindUsedTypes.cpp')
-rw-r--r--lib/Analysis/IPA/FindUsedTypes.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/lib/Analysis/IPA/FindUsedTypes.cpp b/lib/Analysis/IPA/FindUsedTypes.cpp
index b4897a265a..8cfe1085a3 100644
--- a/lib/Analysis/IPA/FindUsedTypes.cpp
+++ b/lib/Analysis/IPA/FindUsedTypes.cpp
@@ -7,10 +7,8 @@
#include "llvm/Analysis/FindUsedTypes.h"
#include "llvm/Assembly/CachedWriter.h"
#include "llvm/SymbolTable.h"
-#include "llvm/GlobalVariable.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
-#include "llvm/Instruction.h"
#include "llvm/Support/InstIterator.h"
AnalysisID FindUsedTypes::ID(AnalysisID::create<FindUsedTypes>());
@@ -42,25 +40,25 @@ void FindUsedTypes::IncorporateSymbolTable(const SymbolTable *ST) {
// run - This incorporates all types used by the specified module
//
-bool FindUsedTypes::run(Module *m) {
+bool FindUsedTypes::run(Module &m) {
UsedTypes.clear(); // reset if run multiple times...
- if (IncludeSymbolTables && m->hasSymbolTable())
- IncorporateSymbolTable(m->getSymbolTable()); // Add symtab first...
+ if (IncludeSymbolTables && m.hasSymbolTable())
+ IncorporateSymbolTable(m.getSymbolTable()); // Add symtab first...
// Loop over global variables, incorporating their types
- for (Module::const_giterator I = m->gbegin(), E = m->gend(); I != E; ++I)
- IncorporateType((*I)->getType());
+ for (Module::const_giterator I = m.gbegin(), E = m.gend(); I != E; ++I)
+ IncorporateType(I->getType());
- for (Module::iterator MI = m->begin(), ME = m->end(); MI != ME; ++MI) {
- const Function *M = *MI;
- if (IncludeSymbolTables && M->hasSymbolTable())
- IncorporateSymbolTable(M->getSymbolTable()); // Add symtab first...
+ for (Module::iterator MI = m.begin(), ME = m.end(); MI != ME; ++MI) {
+ const Function &F = *MI;
+ if (IncludeSymbolTables && F.hasSymbolTable())
+ IncorporateSymbolTable(F.getSymbolTable()); // Add symtab first...
// Loop over all of the instructions in the function, adding their return
// type as well as the types of their operands.
//
- for (const_inst_iterator II = inst_begin(M), IE = inst_end(M);
+ for (const_inst_iterator II = inst_begin(F), IE = inst_end(F);
II != IE; ++II) {
const Instruction *I = *II;
const Type *Ty = I->getType();