aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-12-10 15:33:59 +0000
committerChris Lattner <sabre@nondot.org>2003-12-10 15:33:59 +0000
commit9a4f8ef78757882ceb2edbf90f37439deb112c88 (patch)
treeb873550e52a801d018eb97b8ae7b7a00794741ca
parenta84962c4d7d3b1956084b54a5572b873fe53748e (diff)
downloadexternal_llvm-9a4f8ef78757882ceb2edbf90f37439deb112c88.zip
external_llvm-9a4f8ef78757882ceb2edbf90f37439deb112c88.tar.gz
external_llvm-9a4f8ef78757882ceb2edbf90f37439deb112c88.tar.bz2
Finegrainify namespacification
Provide a context module to WriteAsOperand git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10366 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Analysis/AliasAnalysisEvaluator.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/Analysis/AliasAnalysisEvaluator.cpp b/lib/Analysis/AliasAnalysisEvaluator.cpp
index 2c967c5..073300c 100644
--- a/lib/Analysis/AliasAnalysisEvaluator.cpp
+++ b/lib/Analysis/AliasAnalysisEvaluator.cpp
@@ -25,8 +25,7 @@
#include "llvm/Assembly/Writer.h"
#include "Support/CommandLine.h"
#include <set>
-
-namespace llvm {
+using namespace llvm;
namespace {
cl::opt<bool> PrintNo ("print-no-aliases", cl::ReallyHidden);
@@ -51,11 +50,12 @@ namespace {
X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator");
}
-static inline void PrintResults(const char *Msg, bool P, Value *V1, Value *V2) {
+static inline void PrintResults(const char *Msg, bool P, Value *V1, Value *V2,
+ Module *M) {
if (P) {
std::cerr << " " << Msg << ":\t";
- WriteAsOperand(std::cerr, V1) << ", ";
- WriteAsOperand(std::cerr, V2) << "\n";
+ WriteAsOperand(std::cerr, V1, true, true, M) << ", ";
+ WriteAsOperand(std::cerr, V2, true, true, M) << "\n";
}
}
@@ -85,13 +85,13 @@ bool AAEval::runOnFunction(Function &F) {
for (std::set<Value *>::iterator I2 = Pointers.begin(); I2 != I1; ++I2)
switch (AA.alias(*I1, 0, *I2, 0)) {
case AliasAnalysis::NoAlias:
- PrintResults("No", PrintNo, *I1, *I2);
+ PrintResults("No", PrintNo, *I1, *I2, F.getParent());
++No; break;
case AliasAnalysis::MayAlias:
- PrintResults("May", PrintMay, *I1, *I2);
+ PrintResults("May", PrintMay, *I1, *I2, F.getParent());
++May; break;
case AliasAnalysis::MustAlias:
- PrintResults("Must", PrintMust, *I1, *I2);
+ PrintResults("Must", PrintMust, *I1, *I2, F.getParent());
++Must; break;
default:
std::cerr << "Unknown alias query result!\n";
@@ -116,5 +116,3 @@ bool AAEval::doFinalization(Module &M) {
<< May*100/Sum << "%/" << Must*100/Sum<<"%\n";
return false;
}
-
-} // End llvm namespace