diff options
author | John McCall <rjmccall@apple.com> | 2010-07-29 08:14:41 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-07-29 08:14:41 +0000 |
commit | 62dc1f3d827df8b0e2f88ae9e649893d0dbe8830 (patch) | |
tree | 25d40f2e860bfd3ed2e1911075d5877d01c24da7 /tools/llvm-diff/DifferenceEngine.cpp | |
parent | 3dd706b5288b83967968287c0950480948e8c3f6 (diff) |
Cache the result of errs() and implement formatted logging.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109740 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-diff/DifferenceEngine.cpp')
-rw-r--r-- | tools/llvm-diff/DifferenceEngine.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/llvm-diff/DifferenceEngine.cpp b/tools/llvm-diff/DifferenceEngine.cpp index 400ab9fcb5..0f10bc79a1 100644 --- a/tools/llvm-diff/DifferenceEngine.cpp +++ b/tools/llvm-diff/DifferenceEngine.cpp @@ -162,8 +162,8 @@ class FunctionDifferenceEngine { if (Ref) { if (Ref == R) return false; - Engine.logf("successor %s cannot be equivalent to %s; " - "it's already equivalent to %s") + Engine.logf("successor %l cannot be equivalent to %r; " + "it's already equivalent to %r") << L << R << Ref; return true; } @@ -220,7 +220,7 @@ class FunctionDifferenceEngine { for (unsigned I = 0, E = L.arg_size(); I != E; ++I) if (!equivalentAsOperands(L.getArgument(I), R.getArgument(I))) { if (Complain) - Engine.logf("arguments %s and %s differ") + Engine.logf("arguments %l and %r differ") << L.getArgument(I) << R.getArgument(I); return true; } @@ -309,7 +309,7 @@ class FunctionDifferenceEngine { LCases.erase(CaseValue); } else if (!Difference) { if (Complain) - Engine.logf("right switch has extra case %s") << CaseValue; + Engine.logf("right switch has extra case %r") << CaseValue; Difference = true; } } @@ -317,7 +317,7 @@ class FunctionDifferenceEngine { for (DenseMap<ConstantInt*,BasicBlock*>::iterator I = LCases.begin(), E = LCases.end(); I != E; ++I) { if (Complain) - Engine.logf("left switch has extra case %s") << I->first; + Engine.logf("left switch has extra case %l") << I->first; Difference = true; } return Difference; @@ -333,7 +333,7 @@ class FunctionDifferenceEngine { for (unsigned I = 0, E = L->getNumOperands(); I != E; ++I) { Value *LO = L->getOperand(I), *RO = R->getOperand(I); if (!equivalentAsOperands(LO, RO)) { - if (Complain) Engine.logf("operands %s and %s differ") << LO << RO; + if (Complain) Engine.logf("operands %l and %r differ") << LO << RO; return true; } } @@ -580,13 +580,13 @@ void DifferenceEngine::diff(Module *L, Module *R) { if (Function *RFn = R->getFunction(LFn->getName())) Queue.push_back(std::make_pair(LFn, RFn)); else - logf("function %s exists only in left module") << LFn; + logf("function %l exists only in left module") << LFn; } for (Module::iterator I = R->begin(), E = R->end(); I != E; ++I) { Function *RFn = &*I; if (!LNames.count(RFn->getName())) - logf("function %s exists only in right module") << RFn; + logf("function %r exists only in right module") << RFn; } for (SmallVectorImpl<std::pair<Function*,Function*> >::iterator |