summaryrefslogtreecommitdiffstats
path: root/clang/tools/clang-diff/ClangDiff.cpp
diff options
context:
space:
mode:
authorJohannes Altmanninger <aclopte@gmail.com>2017-08-19 12:04:04 +0000
committerJohannes Altmanninger <aclopte@gmail.com>2017-08-19 12:04:04 +0000
commit683876ca6d75d95ebf83fd569f1ef0b8e07fc068 (patch)
tree880904f3fb72adff5b75bd3faa704ac281a50845 /clang/tools/clang-diff/ClangDiff.cpp
parentba0954c4e2853eb479e7b81c81dc25011b2ce0a8 (diff)
downloadbcm5719-llvm-683876ca6d75d95ebf83fd569f1ef0b8e07fc068.tar.gz
bcm5719-llvm-683876ca6d75d95ebf83fd569f1ef0b8e07fc068.zip
[clang-diff] Make printing of matches optional
Reviewers: arphaman Subscribers: klimek Differential Revision: https://reviews.llvm.org/D36181 llvm-svn: 311237
Diffstat (limited to 'clang/tools/clang-diff/ClangDiff.cpp')
-rw-r--r--clang/tools/clang-diff/ClangDiff.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/tools/clang-diff/ClangDiff.cpp b/clang/tools/clang-diff/ClangDiff.cpp
index 2eca374b863..87f40907735 100644
--- a/clang/tools/clang-diff/ClangDiff.cpp
+++ b/clang/tools/clang-diff/ClangDiff.cpp
@@ -33,6 +33,10 @@ static cl::opt<bool> ASTDumpJson(
cl::desc("Print the internal representation of the AST as JSON."),
cl::init(false), cl::cat(ClangDiffCategory));
+static cl::opt<bool>
+ PrintMatches("dump-matches", cl::desc("Print the matched nodes."),
+ cl::init(false), cl::cat(ClangDiffCategory));
+
static cl::opt<std::string> SourcePath(cl::Positional, cl::desc("<source>"),
cl::Required,
cl::cat(ClangDiffCategory));
@@ -267,7 +271,7 @@ int main(int argc, const char **argv) {
for (diff::NodeId Dst : DstTree) {
diff::NodeId Src = Diff.getMapped(DstTree, Dst);
- if (Src.isValid()) {
+ if (PrintMatches && Src.isValid()) {
llvm::outs() << "Match ";
printNode(llvm::outs(), SrcTree, Src);
llvm::outs() << " to ";
OpenPOWER on IntegriCloud