[PATCH] D107985: [llvm-diff] add "reset" method to DiffConsumer
Bill Wendling via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 12 11:25:47 PDT 2021
void created this revision.
void added a reviewer: rjmccall.
void requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
A DiffConsumer object may be reused, but we'd like to reset it before
the next use.
No functionality change intended.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D107985
Files:
llvm/tools/llvm-diff/lib/DiffConsumer.cpp
llvm/tools/llvm-diff/lib/DiffConsumer.h
Index: llvm/tools/llvm-diff/lib/DiffConsumer.h
===================================================================
--- llvm/tools/llvm-diff/lib/DiffConsumer.h
+++ llvm/tools/llvm-diff/lib/DiffConsumer.h
@@ -78,6 +78,7 @@
DiffConsumer()
: out(errs()), Differences(false), Indent(0) {}
+ void reset();
bool hadDifferences() const;
void enterContext(const Value *L, const Value *R) override;
void exitContext() override;
Index: llvm/tools/llvm-diff/lib/DiffConsumer.cpp
===================================================================
--- llvm/tools/llvm-diff/lib/DiffConsumer.cpp
+++ llvm/tools/llvm-diff/lib/DiffConsumer.cpp
@@ -134,6 +134,12 @@
while (N--) out << ' ';
}
+void DiffConsumer::reset() {
+ context.clear();
+ Differences = false;
+ Indent = 0;
+}
+
bool DiffConsumer::hadDifferences() const {
return Differences;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107985.366053.patch
Type: text/x-patch
Size: 877 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210812/f1bfd541/attachment.bin>
More information about the llvm-commits
mailing list