From 44a98602471cba35d09f1089e00c2db4a653cce9 Mon Sep 17 00:00:00 2001 From: John McCall Date: Thu, 29 Jul 2010 18:20:13 +0000 Subject: Transcribe IRC to svn. Also don't print basic block names twice if they match. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109787 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-diff/llvm-diff.cpp | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) (limited to 'tools/llvm-diff') diff --git a/tools/llvm-diff/llvm-diff.cpp b/tools/llvm-diff/llvm-diff.cpp index 9d8a7d3ec7..cc5d233db3 100644 --- a/tools/llvm-diff/llvm-diff.cpp +++ b/tools/llvm-diff/llvm-diff.cpp @@ -163,17 +163,22 @@ private: Function *L = cast(I->L); Function *R = cast(I->R); if (L->getName() != R->getName()) - out << "in function " << L->getName() << " / " << R->getName() << ":\n"; + out << "in function " << L->getName() + << " / " << R->getName() << ":\n"; else out << "in function " << L->getName() << ":\n"; } else if (isa(I->L)) { BasicBlock *L = cast(I->L); BasicBlock *R = cast(I->R); - out << " in block "; - printValue(L, true); - out << " / "; - printValue(R, false); - out << ":\n"; + if (L->hasName() && R->hasName() && L->getName() == R->getName()) + out << " in block %" << L->getName() << ":\n"; + else { + out << " in block "; + printValue(L, true); + out << " / "; + printValue(R, false); + out << ":\n"; + } } else if (isa(I->L)) { out << " in instruction "; printValue(I->L, true); @@ -289,9 +294,14 @@ static void diffGlobal(DifferenceEngine &Engine, Module *L, Module *R, errs() << "No function named @" << Name << " in right module\n"; } -cl::opt LeftFilename(cl::Positional, cl::desc(""), cl::Required); -cl::opt RightFilename(cl::Positional, cl::desc(""), cl::Required); -cl::list GlobalsToCompare(cl::Positional, cl::desc("")); +cl::opt LeftFilename(cl::Positional, + cl::desc(""), + cl::Required); +cl::opt RightFilename(cl::Positional, + cl::desc(""), + cl::Required); +cl::list GlobalsToCompare(cl::Positional, + cl::desc("")); int main(int argc, char **argv) { cl::ParseCommandLineOptions(argc, argv); -- cgit v1.2.3