[llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysisCounter.cpp
Chris Lattner
lattner at cs.uiuc.edu
Tue Jun 17 10:08:01 PDT 2003
Changes in directory llvm/lib/Analysis:
AliasAnalysisCounter.cpp updated: 1.3 -> 1.4
---
Log message:
Avoid divide by zero errors
---
Diffs of the changes:
Index: llvm/lib/Analysis/AliasAnalysisCounter.cpp
diff -u llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.3 llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.4
--- llvm/lib/Analysis/AliasAnalysisCounter.cpp:1.3 Wed Feb 26 13:27:05 2003
+++ llvm/lib/Analysis/AliasAnalysisCounter.cpp Tue Jun 17 10:07:20 2003
@@ -32,23 +32,27 @@
<< "\n===== Alias Analysis Counter Report =====\n"
<< " Analysis counted: " << Name << "\n"
<< " " << AASum << " Total Alias Queries Performed\n";
- printLine("no alias", No, AASum);
- printLine("may alias", May, AASum);
- printLine("must alias", Must, AASum);
- std::cerr
- << " Alias Analysis Counter Summary: " << No*100/AASum << "%/"
- << May*100/AASum << "%/" << Must*100/AASum<<"%\n\n";
+ if (AASum) {
+ printLine("no alias", No, AASum);
+ printLine("may alias", May, AASum);
+ printLine("must alias", Must, AASum);
+ std::cerr
+ << " Alias Analysis Counter Summary: " << No*100/AASum << "%/"
+ << May*100/AASum << "%/" << Must*100/AASum<<"%\n\n";
+ }
std::cerr
<< " " << MRSum << " Total Mod/Ref Queries Performed\n";
- printLine("no mod/ref", NoMR, MRSum);
- printLine("ref", JustRef, MRSum);
- printLine("mod", JustMod, MRSum);
- printLine("mod/ref", MR, MRSum);
- std::cerr
- << " Mod/Ref Analysis Counter Summary: " << NoMR*100/MRSum<< "%/"
- << JustRef*100/MRSum << "%/" << JustMod*100/MRSum << "%/"
- << MR*100/MRSum <<"%\n\n";
+ if (MRSum) {
+ printLine("no mod/ref", NoMR, MRSum);
+ printLine("ref", JustRef, MRSum);
+ printLine("mod", JustMod, MRSum);
+ printLine("mod/ref", MR, MRSum);
+ std::cerr
+ << " Mod/Ref Analysis Counter Summary: " << NoMR*100/MRSum<< "%/"
+ << JustRef*100/MRSum << "%/" << JustMod*100/MRSum << "%/"
+ << MR*100/MRSum <<"%\n\n";
+ }
}
}
More information about the llvm-commits
mailing list