diff options
Diffstat (limited to 'lib/Analysis/IPA/FindUsedTypes.cpp')
-rw-r--r-- | lib/Analysis/IPA/FindUsedTypes.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Analysis/IPA/FindUsedTypes.cpp b/lib/Analysis/IPA/FindUsedTypes.cpp index e37a40ac66..83b994b53e 100644 --- a/lib/Analysis/IPA/FindUsedTypes.cpp +++ b/lib/Analysis/IPA/FindUsedTypes.cpp @@ -1,10 +1,10 @@ //===- FindUsedTypes.cpp - Find all Types used by a module ----------------===// -// +// // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. -// +// //===----------------------------------------------------------------------===// // // This pass is used to seek out all of the types in use by the program. Note @@ -32,10 +32,10 @@ void FindUsedTypes::stub() {} // collection of used types. // void FindUsedTypes::IncorporateType(const Type *Ty) { - // If ty doesn't already exist in the used types map, add it now, otherwise + // If ty doesn't already exist in the used types map, add it now, otherwise // return. if (!UsedTypes.insert(Ty).second) return; // Already contain Ty. - + // Make sure to add any types this type references now. // for (Type::subtype_iterator I = Ty->subtype_begin(), E = Ty->subtype_end(); @@ -45,7 +45,7 @@ void FindUsedTypes::IncorporateType(const Type *Ty) { void FindUsedTypes::IncorporateValue(const Value *V) { IncorporateType(V->getType()); - + // If this is a constant, it could be using other types... if (const Constant *C = dyn_cast<Constant>(V)) { if (!isa<GlobalValue>(C)) @@ -71,21 +71,21 @@ bool FindUsedTypes::runOnModule(Module &m) { for (Module::iterator MI = m.begin(), ME = m.end(); MI != ME; ++MI) { IncorporateType(MI->getType()); const Function &F = *MI; - + // 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(F), IE = inst_end(F); II != IE; ++II) { const Instruction &I = *II; - + IncorporateType(I.getType()); // Incorporate the type of the instruction for (User::const_op_iterator OI = I.op_begin(), OE = I.op_end(); OI != OE; ++OI) IncorporateValue(*OI); // Insert inst operand types as well } } - + return false; } |