llvm.org GIT mirror llvm / c0734e3
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 Gabor Greif 12 years ago
2 changed file(s) with 13 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
3030 #include "llvm/Support/Compiler.h"
3131 #include "llvm/Support/Streams.h"
3232 #include
33 #include
3334 using namespace llvm;
3435
3536 namespace {
7980
8081 FunctionPass *llvm::createAAEvalPass() { return new AAEval(); }
8182
82 static inline void PrintResults(const char *Msg, bool P, Value *V1, Value *V2,
83 Module *M) {
83 static void PrintResults(const char *Msg, bool P, const Value *V1, const Value *V2,
84 const Module *M) {
8485 if (P) {
85 cerr << " " << Msg << ":\t";
86 WriteAsOperand(*cerr.stream(), V1, true, M) << ", ";
87 WriteAsOperand(*cerr.stream(), V2, true, M) << "\n";
86 std::stringstream s1, s2;
87 WriteAsOperand(s1, V1, true, M);
88 WriteAsOperand(s2, V2, true, M);
89 std::string o1(s1.str()), o2(s2.str());
90 if (o2 < o1)
91 std::swap(o1, o2);
92 cerr << " " << Msg << ":\t"
93 << o1 << ", "
94 << o2 << "\n";
8895 }
8996 }
9097
0 ; RUN: llvm-as %s -o - | opt -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {9 no alias}
11 ; RUN: llvm-as %s -o - | opt -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {6 may alias}
2 ; RUN: llvm-as %s -o - | opt -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {MayAlias:.*i32\\* %Jpointer, i32\\* %Ipointer}
2 ; RUN: llvm-as %s -o - | opt -basicaa -aa-eval -print-all-alias-modref-info -disable-output |& grep {MayAlias:.*i32\\* %Ipointer, i32\\* %Jpointer}
33
44 define void @foo(i32* noalias %p, i32* noalias %q, i32 %i, i32 %j) {
55 %Ipointer = getelementptr i32* %p, i32 %i