diff options
author | John McCall <rjmccall@apple.com> | 2010-07-29 18:20:13 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-07-29 18:20:13 +0000 |
commit | 9ad943ef286ed4e636efe1c0e1e4813603a1e547 (patch) | |
tree | 74fb7d9783139a5bf69aedff3577903e5184da57 /llvm/tools/llvm-diff/llvm-diff.cpp | |
parent | 50a357e962b5156b27062119b4a26fa5e6a2c815 (diff) | |
download | bcm5719-llvm-9ad943ef286ed4e636efe1c0e1e4813603a1e547.tar.gz bcm5719-llvm-9ad943ef286ed4e636efe1c0e1e4813603a1e547.zip |
Transcribe IRC to svn. Also don't print basic block names twice if they match.
llvm-svn: 109787
Diffstat (limited to 'llvm/tools/llvm-diff/llvm-diff.cpp')
-rw-r--r-- | llvm/tools/llvm-diff/llvm-diff.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/llvm/tools/llvm-diff/llvm-diff.cpp b/llvm/tools/llvm-diff/llvm-diff.cpp index 9d8a7d3ec7a..cc5d233db3b 100644 --- a/llvm/tools/llvm-diff/llvm-diff.cpp +++ b/llvm/tools/llvm-diff/llvm-diff.cpp @@ -163,17 +163,22 @@ private: Function *L = cast<Function>(I->L); Function *R = cast<Function>(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<BasicBlock>(I->L)) { BasicBlock *L = cast<BasicBlock>(I->L); BasicBlock *R = cast<BasicBlock>(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<Instruction>(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<std::string> LeftFilename(cl::Positional, cl::desc("<first file>"), cl::Required); -cl::opt<std::string> RightFilename(cl::Positional, cl::desc("<second file>"), cl::Required); -cl::list<std::string> GlobalsToCompare(cl::Positional, cl::desc("<globals to compare>")); +cl::opt<std::string> LeftFilename(cl::Positional, + cl::desc("<first file>"), + cl::Required); +cl::opt<std::string> RightFilename(cl::Positional, + cl::desc("<second file>"), + cl::Required); +cl::list<std::string> GlobalsToCompare(cl::Positional, + cl::desc("<globals to compare>")); int main(int argc, char **argv) { cl::ParseCommandLineOptions(argc, argv); |