Don't use the result of WriteAsOperand or WriteTypeSymbolic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54977 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2008-08-19 04:42:37 +00:00
parent 6ab910b946
commit 2c69184fd6
2 changed files with 10 additions and 5 deletions

View File

@ -140,9 +140,11 @@ AliasAnalysisCounter::alias(const Value *V1, unsigned V1Size,
if (PrintAll || (PrintAllFailures && R == MayAlias)) { if (PrintAll || (PrintAllFailures && R == MayAlias)) {
cerr << AliasString << ":\t"; cerr << AliasString << ":\t";
cerr << "[" << V1Size << "B] "; cerr << "[" << V1Size << "B] ";
WriteAsOperand(*cerr.stream(), V1, true, M) << ", "; WriteAsOperand(*cerr.stream(), V1, true, M);
cerr << ", ";
cerr << "[" << V2Size << "B] "; cerr << "[" << V2Size << "B] ";
WriteAsOperand(*cerr.stream(), V2, true, M) << "\n"; WriteAsOperand(*cerr.stream(), V2, true, M);
cerr << "\n";
} }
return R; return R;

View File

@ -59,7 +59,8 @@ bool FindUsedTypes::runOnModule(Module &m) {
UsedTypes.clear(); // reset if run multiple times... UsedTypes.clear(); // reset if run multiple times...
// Loop over global variables, incorporating their types // Loop over global variables, incorporating their types
for (Module::const_global_iterator I = m.global_begin(), E = m.global_end(); I != E; ++I) { for (Module::const_global_iterator I = m.global_begin(), E = m.global_end();
I != E; ++I) {
IncorporateType(I->getType()); IncorporateType(I->getType());
if (I->hasInitializer()) if (I->hasInitializer())
IncorporateValue(I->getInitializer()); IncorporateValue(I->getInitializer());
@ -93,6 +94,8 @@ bool FindUsedTypes::runOnModule(Module &m) {
void FindUsedTypes::print(std::ostream &o, const Module *M) const { void FindUsedTypes::print(std::ostream &o, const Module *M) const {
o << "Types in use by this module:\n"; o << "Types in use by this module:\n";
for (std::set<const Type *>::const_iterator I = UsedTypes.begin(), for (std::set<const Type *>::const_iterator I = UsedTypes.begin(),
E = UsedTypes.end(); I != E; ++I) E = UsedTypes.end(); I != E; ++I) {
WriteTypeSymbolic(o << " ", *I, M) << "\n"; WriteTypeSymbolic(o << " ", *I, M);
o << "\n";
}
} }