[llvm-commits] [llvm] r109787 - /llvm/trunk/tools/llvm-diff/llvm-diff.cpp
John McCall
rjmccall at apple.com
Thu Jul 29 11:20:14 PDT 2010
Author: rjmccall
Date: Thu Jul 29 13:20:13 2010
New Revision: 109787
URL: http://llvm.org/viewvc/llvm-project?rev=109787&view=rev
Log:
Transcribe IRC to svn. Also don't print basic block names twice if they match.
Modified:
llvm/trunk/tools/llvm-diff/llvm-diff.cpp
Modified: llvm/trunk/tools/llvm-diff/llvm-diff.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-diff/llvm-diff.cpp?rev=109787&r1=109786&r2=109787&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-diff/llvm-diff.cpp (original)
+++ llvm/trunk/tools/llvm-diff/llvm-diff.cpp Thu Jul 29 13:20:13 2010
@@ -163,17 +163,22 @@
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 @@
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);
More information about the llvm-commits
mailing list