diff options
| author | Gabor Greif <ggreif@gmail.com> | 2008-02-28 08:38:45 +0000 |
|---|---|---|
| committer | Gabor Greif <ggreif@gmail.com> | 2008-02-28 08:38:45 +0000 |
| commit | cc322ca267c893e73d0c77b0d3e0590845f3731b (patch) | |
| tree | 17cfed580a76008a65101d8cf9832974ab186ea0 /lib/Analysis | |
| parent | 9d8941467c39a4bf7f3f0640521f726130206d69 (diff) | |
| download | external_llvm-cc322ca267c893e73d0c77b0d3e0590845f3731b.zip external_llvm-cc322ca267c893e73d0c77b0d3e0590845f3731b.tar.gz external_llvm-cc322ca267c893e73d0c77b0d3e0590845f3731b.tar.bz2 | |
Fix http://llvm.org/bugs/show_bug.cgi?id=2104 by ordering lexicographically what gets printed. Be const-correct in PrintResults and uninline it too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47712 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
| -rw-r--r-- | lib/Analysis/AliasAnalysisEvaluator.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/Analysis/AliasAnalysisEvaluator.cpp b/lib/Analysis/AliasAnalysisEvaluator.cpp index d8182d0..1ed0680 100644 --- a/lib/Analysis/AliasAnalysisEvaluator.cpp +++ b/lib/Analysis/AliasAnalysisEvaluator.cpp @@ -31,6 +31,7 @@ #include "llvm/Support/Compiler.h" #include "llvm/Support/Streams.h" #include <set> +#include <sstream> using namespace llvm; namespace { @@ -80,12 +81,18 @@ namespace { FunctionPass *llvm::createAAEvalPass() { return new AAEval(); } -static inline void PrintResults(const char *Msg, bool P, Value *V1, Value *V2, - Module *M) { +static void PrintResults(const char *Msg, bool P, const Value *V1, const Value *V2, + const Module *M) { if (P) { - cerr << " " << Msg << ":\t"; - WriteAsOperand(*cerr.stream(), V1, true, M) << ", "; - WriteAsOperand(*cerr.stream(), V2, true, M) << "\n"; + std::stringstream s1, s2; + WriteAsOperand(s1, V1, true, M); + WriteAsOperand(s2, V2, true, M); + std::string o1(s1.str()), o2(s2.str()); + if (o2 < o1) + std::swap(o1, o2); + cerr << " " << Msg << ":\t" + << o1 << ", " + << o2 << "\n"; } } |
