Skip to content

Commit 6e6a3d8

Browse files
[llvm-remarkutil] Introduce filter command (#159784)
Add a filter command to llvm-remarkutil. This can be used to extract remarks for a certain function, pass, type, etc. from a large remarks file to a new remarks file. This uses the same filter arguments as the count command. Depends on #156715. Thanks to this change, we don't need to buffer all remarks before reserializing them, so we should be able to process arbitrarily large files. Pull Request: #159784
1 parent 32c6e16 commit 6e6a3d8

File tree

12 files changed

+307
-95
lines changed

12 files changed

+307
-95
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
--- !Passed
2+
Pass: pass1
3+
Name: Remark1
4+
DebugLoc: { File: 'path/to/func1.c', Line: 1, Column: 2 }
5+
Function: func1
6+
Args:
7+
- String: ' text'
8+
- arg1: argval1
9+
...
10+
--- !Missed
11+
Pass: pass2
12+
Name: Remark2
13+
DebugLoc: { File: 'path/to/func2.c', Line: 1, Column: 2 }
14+
Function: func2
15+
Args:
16+
- String: ' text'
17+
- arg2: argval2
18+
...
19+
--- !Analysis
20+
Pass: pass3
21+
Name: Remark3
22+
DebugLoc: { File: 'path/to/func3.c', Line: 1, Column: 2 }
23+
Function: func3
24+
Args:
25+
- String: ' text'
26+
- arg3: argval3
27+
DebugLoc: { File: 'path/to/func3.c', Line: 2, Column: 2 }
28+
...

llvm/test/tools/llvm-remarkutil/broken-bitstream-remark-magic.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ RUN: not llvm-remarkutil instruction-count %p/Inputs/broken-remark-magic.bitstre
22
RUN: not llvm-remarkutil instruction-mix %p/Inputs/broken-remark-magic.bitstream -o - 2>&1 | FileCheck %s
33
RUN: not llvm-remarkutil annotation-count --annotation-type=remark %p/Inputs/broken-remark-magic.bitstream -o - 2>&1 | FileCheck %s
44
RUN: not llvm-remarkutil count %p/Inputs/broken-remark-magic.bitstream -o - 2>&1 | FileCheck %s
5+
RUN: not llvm-remarkutil filter %p/Inputs/broken-remark-magic.bitstream -o - 2>&1 | FileCheck %s
56

67
CHECK: error: Automatic detection of remark format failed. Unknown magic number: '1234'

llvm/test/tools/llvm-remarkutil/broken-bitstream-remark.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ RUN: not llvm-remarkutil bitstream2yaml %p/Inputs/broken-remark -o - 2>&1 | File
22
RUN: not llvm-remarkutil instruction-count --parser=bitstream %p/Inputs/broken-remark -o - 2>&1 | FileCheck %s
33
RUN: not llvm-remarkutil annotation-count --parser=bitstream --annotation-type=remark %p/Inputs/broken-remark -o - 2>&1 | FileCheck %s
44
RUN: not llvm-remarkutil count --parser=bitstream %p/Inputs/broken-remark -o - 2>&1 | FileCheck %s
5+
RUN: not llvm-remarkutil filter --parser=bitstream %p/Inputs/broken-remark -o - 2>&1 | FileCheck %s
56

67
CHECK: error: Unknown magic number: expecting RMRK, got --- .

llvm/test/tools/llvm-remarkutil/broken-yaml-remark.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ RUN: not llvm-remarkutil instruction-count --parser=yaml %p/Inputs/broken-remark
33
RUN: not llvm-remarkutil instruction-mix --parser=yaml %p/Inputs/broken-remark -o - 2>&1 | FileCheck %s
44
RUN: not llvm-remarkutil annotation-count --parser=yaml --annotation-type=remark %p/Inputs/broken-remark -o - 2>&1 | FileCheck %s
55
RUN: not llvm-remarkutil count --parser=yaml %p/Inputs/broken-remark -o - 2>&1 | FileCheck %s
6+
RUN: not llvm-remarkutil filter --parser=yaml %p/Inputs/broken-remark -o - 2>&1 | FileCheck %s
67

78
CHECK: error: Type, Pass, Name or Function missing

llvm/test/tools/llvm-remarkutil/empty-file.test

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,19 @@ RUN: not llvm-remarkutil instruction-count --parser=yaml %p/Inputs/empty-file -o
33
RUN: not llvm-remarkutil instruction-mix --parser=yaml %p/Inputs/empty-file -o - 2>&1 | FileCheck %s --check-prefix=YAMLPARSER
44
RUN: not llvm-remarkutil annotation-count --parser=yaml --annotation-type=remark %p/Inputs/empty-file -o - 2>&1 | FileCheck %s --check-prefix=YAMLPARSER
55
RUN: not llvm-remarkutil count --parser=yaml %p/Inputs/empty-file -o - 2>&1 | FileCheck %s --check-prefix=YAMLPARSER
6+
RUN: not llvm-remarkutil filter --parser=yaml %p/Inputs/empty-file -o - 2>&1 | FileCheck %s --check-prefix=YAMLPARSER
67
RUN: llvm-remarkutil bitstream2yaml %p/Inputs/empty-file -o - 2>&1 | FileCheck %s --allow-empty --check-prefix=BITSTREAM2YAML
78
RUN: llvm-remarkutil instruction-count --parser=bitstream %p/Inputs/empty-file -o - 2>&1 | FileCheck %s --allow-empty --check-prefix=SIZEBITSTREAM
89
RUN: llvm-remarkutil instruction-mix --parser=bitstream %p/Inputs/empty-file --report_style=csv -o - 2>&1 | FileCheck %s --allow-empty --check-prefix=MIXBITSTREAM
910
RUN: llvm-remarkutil annotation-count --parser=bitstream --annotation-type=remark %p/Inputs/empty-file -o - 2>&1 | FileCheck %s --allow-empty --check-prefix=ANNOTATIONBITSTREAM
1011
RUN: llvm-remarkutil count --parser=bitstream %p/Inputs/empty-file -o - 2>&1 | FileCheck %s --allow-empty --check-prefix=COUNTBITSTREAM
12+
RUN: llvm-remarkutil filter --parser=bitstream %p/Inputs/empty-file -o - 2>&1 | FileCheck %s --allow-empty --check-prefix=FILTERBITSTREAM
1113
; Parser format auto-detection should treat empty files as bitstream files
1214
RUN: llvm-remarkutil instruction-count %p/Inputs/empty-file -o - 2>&1 | FileCheck %s --allow-empty --check-prefix=SIZEBITSTREAM
1315
RUN: llvm-remarkutil instruction-mix %p/Inputs/empty-file --report_style=csv -o - 2>&1 | FileCheck %s --allow-empty --check-prefix=MIXBITSTREAM
1416
RUN: llvm-remarkutil annotation-count --annotation-type=remark %p/Inputs/empty-file -o - 2>&1 | FileCheck %s --allow-empty --check-prefix=ANNOTATIONBITSTREAM
1517
RUN: llvm-remarkutil count %p/Inputs/empty-file -o - 2>&1 | FileCheck %s --allow-empty --check-prefix=COUNTBITSTREAM
18+
RUN: llvm-remarkutil filter %p/Inputs/empty-file -o - 2>&1 | FileCheck %s --allow-empty --check-prefix=FILTERBITSTREAM
1619

1720
; YAMLPARSER: error: document root is not of mapping type.
1821

@@ -30,3 +33,5 @@ RUN: llvm-remarkutil count %p/Inputs/empty-file -o - 2>&1 | FileCheck %s --allow
3033

3134
; MIXBITSTREAM-LABEL: Instruction,Count
3235
; MIXBITSTREAM-EMPTY:
36+
37+
; FILTERBITSTREAM-NOT: {{.}}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
RUN: llvm-remarkutil filter %p/Inputs/filter.yaml | diff %p/Inputs/filter.yaml -
2+
RUN: llvm-remarkutil filter --rfunction=func %p/Inputs/filter.yaml | diff %p/Inputs/filter.yaml -
3+
RUN: llvm-remarkutil filter --rremark-name=Remark %p/Inputs/filter.yaml | diff %p/Inputs/filter.yaml -
4+
RUN: llvm-remarkutil filter --rpass-name=pass %p/Inputs/filter.yaml | diff %p/Inputs/filter.yaml -
5+
RUN: llvm-remarkutil filter --rfilter-arg-by=argval %p/Inputs/filter.yaml | diff %p/Inputs/filter.yaml -
6+
7+
RUN: llvm-remarkutil filter --rfunction=unc1 %p/Inputs/filter.yaml | FileCheck %s --strict-whitespace --check-prefix=REMARK1
8+
RUN: llvm-remarkutil filter --rremark-name=ark3 %p/Inputs/filter.yaml | FileCheck %s --strict-whitespace --check-prefix=REMARK3
9+
RUN: llvm-remarkutil filter --rpass-name=s1 %p/Inputs/filter.yaml | FileCheck %s --strict-whitespace --check-prefix=REMARK1
10+
RUN: llvm-remarkutil filter --filter-arg-by=argval2 %p/Inputs/filter.yaml | FileCheck %s --strict-whitespace --check-prefix=REMARK2
11+
RUN: llvm-remarkutil filter --function=func1 %p/Inputs/filter.yaml | FileCheck %s --strict-whitespace --check-prefix=REMARK1
12+
RUN: llvm-remarkutil filter --pass-name=pass2 %p/Inputs/filter.yaml | FileCheck %s --strict-whitespace --check-prefix=REMARK2
13+
RUN: llvm-remarkutil filter --remark-name=Remark3 %p/Inputs/filter.yaml | FileCheck %s --strict-whitespace --check-prefix=REMARK3
14+
RUN: llvm-remarkutil filter --function=func1 --pass-name=pass1 --remark-name=Remark1 %p/Inputs/filter.yaml | FileCheck %s --strict-whitespace --check-prefix=REMARK1
15+
RUN: llvm-remarkutil filter --remark-type=passed %p/Inputs/filter.yaml | FileCheck %s --strict-whitespace --check-prefix=REMARK1
16+
RUN: llvm-remarkutil filter --remark-type=missed %p/Inputs/filter.yaml | FileCheck %s --strict-whitespace --check-prefix=REMARK2
17+
RUN: llvm-remarkutil filter --remark-type=analysis %p/Inputs/filter.yaml | FileCheck %s --strict-whitespace --check-prefix=REMARK3
18+
19+
RUN: llvm-remarkutil yaml2bitstream -o %t.opt.bitstream %p/Inputs/filter.yaml
20+
RUN: llvm-remarkutil filter --function=func1 %t.opt.bitstream | FileCheck %s --strict-whitespace --check-prefix=REMARK1
21+
22+
RUN: llvm-remarkutil filter --function=func1 %t.opt.bitstream -o %t.r1.opt.bitstream
23+
RUN: llvm-remarkutil bitstream2yaml %t.r1.opt.bitstream | FileCheck %s --strict-whitespace --check-prefix=REMARK1
24+
25+
RUN: llvm-remarkutil filter --function=func %p/Inputs/filter.yaml | FileCheck %s --allow-empty --strict-whitespace --check-prefix=EMPTY
26+
27+
; REMARK1: --- !Passed
28+
; REMARK1-NEXT: Pass: pass1
29+
; REMARK1-NEXT: Name: Remark1
30+
; REMARK1-NEXT: DebugLoc: { File: 'path/to/func1.c', Line: 1, Column: 2 }
31+
; REMARK1-NEXT: Function: func1
32+
; REMARK1-NEXT: Args:
33+
; REMARK1-NEXT: - String: ' text'
34+
; REMARK1-NEXT: - arg1: argval1
35+
; REMARK1-NEXT: ...
36+
; REMARK1-NOT: {{.}}
37+
; REMARK2: --- !Missed
38+
; REMARK2-NEXT: Pass: pass2
39+
; REMARK2-NEXT: Name: Remark2
40+
; REMARK2-NEXT: DebugLoc: { File: 'path/to/func2.c', Line: 1, Column: 2 }
41+
; REMARK2-NEXT: Function: func2
42+
; REMARK2-NEXT: Args:
43+
; REMARK2-NEXT: - String: ' text'
44+
; REMARK2-NEXT: - arg2: argval2
45+
; REMARK2-NEXT: ...
46+
; REMARK2-NOT: {{.}}
47+
; REMARK3: --- !Analysis
48+
; REMARK3-NEXT: Pass: pass3
49+
; REMARK3-NEXT: Name: Remark3
50+
; REMARK3-NEXT: DebugLoc: { File: 'path/to/func3.c', Line: 1, Column: 2 }
51+
; REMARK3-NEXT: Function: func3
52+
; REMARK3-NEXT: Args:
53+
; REMARK3-NEXT: - String: ' text'
54+
; REMARK3-NEXT: - arg3: argval3
55+
; REMARK3-NEXT: DebugLoc: { File: 'path/to/func3.c', Line: 2, Column: 2 }
56+
; REMARK3-NEXT: ...
57+
; REMARK3-NOT: {{.}}
58+
59+
; EMPTY-NOT: {{.}}

llvm/tools/llvm-remarkutil/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ add_llvm_tool(llvm-remarkutil
88
RemarkConvert.cpp
99
RemarkCount.cpp
1010
RemarkCounter.cpp
11+
RemarkFilter.cpp
1112
RemarkInstructionMix.cpp
1213
RemarkSizeDiff.cpp
1314
RemarkUtil.cpp

llvm/tools/llvm-remarkutil/RemarkCounter.cpp

Lines changed: 4 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ static cl::SubCommand CountSub("count",
2525

2626
INPUT_FORMAT_COMMAND_LINE_OPTIONS(CountSub)
2727
INPUT_OUTPUT_COMMAND_LINE_OPTIONS(CountSub)
28+
REMARK_FILTER_COMMAND_LINE_OPTIONS(CountSub)
29+
30+
REMARK_FILTER_SETUP_FUNC()
2831

2932
static cl::list<std::string>
3033
Keys("args", cl::desc("Specify remark argument/s to count by."),
@@ -34,45 +37,7 @@ static cl::list<std::string> RKeys(
3437
cl::desc(
3538
"Specify remark argument/s to count (accepts regular expressions)."),
3639
cl::value_desc("arguments"), cl::sub(CountSub), cl::ValueOptional);
37-
static cl::opt<std::string>
38-
RemarkNameOpt("remark-name",
39-
cl::desc("Optional remark name to filter collection by."),
40-
cl::ValueOptional, cl::sub(CountSub));
41-
static cl::opt<std::string>
42-
PassNameOpt("pass-name", cl::ValueOptional,
43-
cl::desc("Optional remark pass name to filter collection by."),
44-
cl::sub(CountSub));
4540

46-
static cl::opt<std::string> RemarkFilterArgByOpt(
47-
"filter-arg-by", cl::desc("Optional remark arg to filter collection by."),
48-
cl::ValueOptional, cl::sub(CountSub));
49-
static cl::opt<std::string>
50-
RemarkNameOptRE("rremark-name",
51-
cl::desc("Optional remark name to filter collection by "
52-
"(accepts regular expressions)."),
53-
cl::ValueOptional, cl::sub(CountSub));
54-
static cl::opt<std::string>
55-
RemarkArgFilterOptRE("rfilter-arg-by",
56-
cl::desc("Optional remark arg to filter collection by "
57-
"(accepts regular expressions)."),
58-
cl::sub(CountSub), cl::ValueOptional);
59-
static cl::opt<std::string>
60-
PassNameOptRE("rpass-name", cl::ValueOptional,
61-
cl::desc("Optional remark pass name to filter collection "
62-
"by (accepts regular expressions)."),
63-
cl::sub(CountSub));
64-
static cl::opt<Type> RemarkTypeOpt(
65-
"remark-type", cl::desc("Optional remark type to filter collection by."),
66-
cl::values(clEnumValN(Type::Unknown, "unknown", "UNKOWN"),
67-
clEnumValN(Type::Passed, "passed", "PASSED"),
68-
clEnumValN(Type::Missed, "missed", "MISSED"),
69-
clEnumValN(Type::Analysis, "analysis", "ANALYSIS"),
70-
clEnumValN(Type::AnalysisFPCommute, "analysis-fp-commute",
71-
"ANALYSIS_FP_COMMUTE"),
72-
clEnumValN(Type::AnalysisAliasing, "analysis-aliasing",
73-
"ANALYSIS_ALIASING"),
74-
clEnumValN(Type::Failure, "failure", "FAILURE")),
75-
cl::init(Type::Failure), cl::sub(CountSub));
7641
static cl::opt<CountBy> CountByOpt(
7742
"count-by", cl::desc("Specify the property to collect remarks by."),
7843
cl::values(
@@ -112,21 +77,6 @@ static unsigned getValForKey(StringRef Key, const Remark &Remark) {
11277
return *RemarkArg->getValAsInt();
11378
}
11479

115-
bool Filters::filterRemark(const Remark &Remark) {
116-
if (RemarkNameFilter && !RemarkNameFilter->match(Remark.RemarkName))
117-
return false;
118-
if (PassNameFilter && !PassNameFilter->match(Remark.PassName))
119-
return false;
120-
if (RemarkTypeFilter)
121-
return *RemarkTypeFilter == Remark.RemarkType;
122-
if (ArgFilter) {
123-
if (!any_of(Remark.Args,
124-
[this](Argument Arg) { return ArgFilter->match(Arg.Val); }))
125-
return false;
126-
}
127-
return true;
128-
}
129-
13080
Error ArgumentCounter::getAllMatchingArgumentsInRemark(
13181
StringRef Buffer, ArrayRef<FilterMatcher> Arguments, Filters &Filter) {
13282
auto MaybeParser = createRemarkParser(InputFormat, Buffer);
@@ -223,33 +173,6 @@ Error RemarkCounter::print(StringRef OutputFileName) {
223173
return Error::success();
224174
}
225175

226-
Expected<Filters> getRemarkFilter() {
227-
// Create Filter properties.
228-
auto MaybeRemarkNameFilter =
229-
FilterMatcher::createExactOrRE(RemarkNameOpt, RemarkNameOptRE);
230-
if (!MaybeRemarkNameFilter)
231-
return MaybeRemarkNameFilter.takeError();
232-
233-
auto MaybePassNameFilter =
234-
FilterMatcher::createExactOrRE(PassNameOpt, PassNameOptRE);
235-
if (!MaybePassNameFilter)
236-
return MaybePassNameFilter.takeError();
237-
238-
auto MaybeRemarkArgFilter = FilterMatcher::createExactOrRE(
239-
RemarkFilterArgByOpt, RemarkArgFilterOptRE);
240-
if (!MaybeRemarkArgFilter)
241-
return MaybeRemarkArgFilter.takeError();
242-
243-
std::optional<Type> RemarkType;
244-
if (RemarkTypeOpt != Type::Failure)
245-
RemarkType = RemarkTypeOpt;
246-
247-
// Create RemarkFilter.
248-
return Filters{std::move(*MaybeRemarkNameFilter),
249-
std::move(*MaybePassNameFilter),
250-
std::move(*MaybeRemarkArgFilter), RemarkType};
251-
}
252-
253176
Error useCollectRemark(StringRef Buffer, Counter &Counter, Filters &Filter) {
254177
// Create Parser.
255178
auto MaybeParser = createRemarkParser(InputFormat, Buffer);
@@ -278,7 +201,7 @@ static Error collectRemarks() {
278201
if (!MaybeBuf)
279202
return MaybeBuf.takeError();
280203
StringRef Buffer = (*MaybeBuf)->getBuffer();
281-
auto MaybeFilter = getRemarkFilter();
204+
auto MaybeFilter = getRemarkFilters();
282205
if (!MaybeFilter)
283206
return MaybeFilter.takeError();
284207
auto &Filter = *MaybeFilter;

llvm/tools/llvm-remarkutil/RemarkCounter.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "RemarkUtilHelpers.h"
1515
#include "llvm/ADT/MapVector.h"
1616
#include "llvm/Support/Regex.h"
17+
#include <map>
1718

1819
namespace llvm {
1920
namespace remarks {
@@ -45,18 +46,6 @@ inline std::string groupByToStr(GroupBy GroupBy) {
4546
}
4647
}
4748

48-
/// Filter out remarks based on remark properties based on name, pass name,
49-
/// argument and type.
50-
struct Filters {
51-
std::optional<FilterMatcher> RemarkNameFilter;
52-
std::optional<FilterMatcher> PassNameFilter;
53-
std::optional<FilterMatcher> ArgFilter;
54-
std::optional<Type> RemarkTypeFilter;
55-
56-
/// Returns true if \p Remark satisfies all the provided filters.
57-
bool filterRemark(const Remark &Remark);
58-
};
59-
6049
/// Abstract counter class used to define the general required methods for
6150
/// counting a remark.
6251
struct Counter {
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
//===- RemarkFilter.cpp ---------------------------------------------------===//
2+
//
3+
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
//===----------------------------------------------------------------------===//
8+
//
9+
// Generic tool to filter remarks
10+
//
11+
//===----------------------------------------------------------------------===//
12+
13+
#include "RemarkUtilHelpers.h"
14+
#include "RemarkUtilRegistry.h"
15+
16+
#include "llvm/Support/Error.h"
17+
#include "llvm/Support/Regex.h"
18+
19+
using namespace llvm;
20+
using namespace remarks;
21+
using namespace llvm::remarkutil;
22+
23+
namespace filter {
24+
25+
static cl::SubCommand FilterSub("filter",
26+
"Filter remarks based on specified criteria.");
27+
28+
INPUT_FORMAT_COMMAND_LINE_OPTIONS(FilterSub)
29+
OUTPUT_FORMAT_COMMAND_LINE_OPTIONS(FilterSub)
30+
INPUT_OUTPUT_COMMAND_LINE_OPTIONS(FilterSub)
31+
REMARK_FILTER_COMMAND_LINE_OPTIONS(FilterSub)
32+
33+
REMARK_FILTER_SETUP_FUNC()
34+
35+
static Error tryFilter() {
36+
auto MaybeFilter = getRemarkFilters();
37+
if (!MaybeFilter)
38+
return MaybeFilter.takeError();
39+
Filters &Filter = *MaybeFilter;
40+
41+
auto MaybeBuf = getInputMemoryBuffer(InputFileName);
42+
if (!MaybeBuf)
43+
return MaybeBuf.takeError();
44+
auto MaybeParser = createRemarkParser(InputFormat, (*MaybeBuf)->getBuffer());
45+
if (!MaybeParser)
46+
return MaybeParser.takeError();
47+
auto &Parser = **MaybeParser;
48+
49+
Format SerializerFormat = OutputFormat;
50+
if (SerializerFormat == Format::Auto) {
51+
SerializerFormat = Parser.ParserFormat;
52+
if (OutputFileName.empty() || OutputFileName == "-")
53+
SerializerFormat = Format::YAML;
54+
}
55+
56+
auto MaybeOF = getOutputFileForRemarks(OutputFileName, SerializerFormat);
57+
if (!MaybeOF)
58+
return MaybeOF.takeError();
59+
auto OF = std::move(*MaybeOF);
60+
61+
auto MaybeSerializer = createRemarkSerializer(SerializerFormat, OF->os());
62+
if (!MaybeSerializer)
63+
return MaybeSerializer.takeError();
64+
auto &Serializer = **MaybeSerializer;
65+
66+
auto MaybeRemark = Parser.next();
67+
for (; MaybeRemark; MaybeRemark = Parser.next()) {
68+
Remark &Remark = **MaybeRemark;
69+
if (!Filter.filterRemark(Remark))
70+
continue;
71+
Serializer.emit(Remark);
72+
}
73+
74+
auto E = MaybeRemark.takeError();
75+
if (!E.isA<EndOfFileError>())
76+
return E;
77+
consumeError(std::move(E));
78+
OF->keep();
79+
return Error::success();
80+
}
81+
82+
static CommandRegistration FilterReg(&FilterSub, tryFilter);
83+
84+
} // namespace filter

0 commit comments

Comments
 (0)