[llvm-commits] CVS: llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
Chris Lattner
lattner at cs.uiuc.edu
Fri Jul 16 23:43:31 PDT 2004
Changes in directory llvm/lib/Analysis:
AliasAnalysisEvaluator.cpp updated: 1.15 -> 1.16
---
Log message:
Print modref information in a useful way.
---
Diffs of the changes: (+14 -4)
Index: llvm/lib/Analysis/AliasAnalysisEvaluator.cpp
diff -u llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.15 llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.16
--- llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:1.15 Sat Jul 17 01:28:49 2004
+++ llvm/lib/Analysis/AliasAnalysisEvaluator.cpp Sat Jul 17 01:43:20 2004
@@ -81,6 +81,16 @@
}
}
+static inline void
+PrintModRefResults(const char *Msg, bool P, Instruction *I, Value *Ptr,
+ Module *M) {
+ if (P) {
+ std::cerr << " " << Msg << ": Ptr: ";
+ WriteAsOperand(std::cerr, Ptr, true, true, M);
+ std::cerr << "\t<->" << *I;
+ }
+}
+
bool AAEval::runOnFunction(Function &F) {
AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
@@ -133,16 +143,16 @@
Instruction *I = C->getInstruction();
switch (AA.getModRefInfo(*C, *V, (*V)->getType()->getPrimitiveSize())) {
case AliasAnalysis::NoModRef:
- PrintResults("NoModRef", PrintNoModRef, I, *V, F.getParent());
+ PrintModRefResults("NoModRef", PrintNoModRef, I, *V, F.getParent());
++NoModRef; break;
case AliasAnalysis::Mod:
- PrintResults("Mod", PrintMod, I, *V, F.getParent());
+ PrintModRefResults(" Mod", PrintMod, I, *V, F.getParent());
++Mod; break;
case AliasAnalysis::Ref:
- PrintResults("Ref", PrintRef, I, *V, F.getParent());
+ PrintModRefResults(" Ref", PrintRef, I, *V, F.getParent());
++Ref; break;
case AliasAnalysis::ModRef:
- PrintResults("ModRef", PrintModRef, I, *V, F.getParent());
+ PrintModRefResults(" ModRef", PrintModRef, I, *V, F.getParent());
++ModRef; break;
default:
std::cerr << "Unknown alias query result!\n";
More information about the llvm-commits
mailing list