27 "Find Used Types",
false,
true)
35 if (!UsedTypes.insert(Ty))
return;
44 void FindUsedTypes::IncorporateValue(
const Value *V) {
48 if (
const Constant *
C = dyn_cast<Constant>(V)) {
49 if (!isa<GlobalValue>(
C))
52 IncorporateValue(*OI);
65 IncorporateType(
I->getType());
66 if (
I->hasInitializer())
67 IncorporateValue(
I->getInitializer());
71 IncorporateType(
MI->getType());
84 IncorporateValue(*OI);
96 OS <<
"Types in use by this module:\n";
98 E = UsedTypes.end();
I != E; ++
I) {
99 OS <<
" " << **
I <<
'\n';
The main container class for the LLVM Intermediate Representation.
vector_type::const_iterator const_iterator
inst_iterator inst_begin(Function *F)
global_iterator global_begin()
void print(raw_ostream &o, const Module *M) const
LLVM Constant Representation.
global_iterator global_end()
Type *const * subtype_iterator
bool runOnModule(Module &M)
run - This incorporates all types used by the specified module
LLVM Value Representation.
inst_iterator inst_end(Function *F)
INITIALIZE_PASS(FindUsedTypes,"print-used-types","Find Used Types", false, true) void FindUsedTypes