[llvm] 194ecef - update_test_checks: add new --filter-out-after option (#129739)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 18 02:46:48 PDT 2025
Author: David Sherwood
Date: 2025-03-18T09:46:43Z
New Revision: 194eceff4327912e6f9167478262961d50516750
URL: https://github.com/llvm/llvm-project/commit/194eceff4327912e6f9167478262961d50516750
DIFF: https://github.com/llvm/llvm-project/commit/194eceff4327912e6f9167478262961d50516750.diff
LOG: update_test_checks: add new --filter-out-after option (#129739)
Whilst trying to clean up some loop vectoriser IR tests (see
test/Transforms/LoopVectorize/AArch64/partial-reduce-chained.ll
for example) a reviewer on PR #129047 suggested it would be
nice to have an option to stop generating CHECK lines after a
certain point. Typically when performing a transformation with
the loop vectoriser we don't usually care about any CHECK lines
generated for the scalar tail of the loop, since the scalar
loop is kept intact. Previously if you wanted to eliminate such
unwanted CHECK lines you had to run the update script, then
manually delete all the lines corresponding to the scalar loop.
This can be very time consuming if the tests ever need changing.
What I've tried to do here is add a new --filter-out-after
option alongside the existing --filter* options that provides
support for stopping the generation of any CHECK lines beyond
the line that matches the filter. With the existing filter
options we never generate CHECK-NEXT lines, but we still care
about ordering with --filter-out-after so I've amended the
code to ensure we treat this filter differently.
Added:
clang/test/utils/update_cc_test_checks/Inputs/filter_out_after.c
clang/test/utils/update_cc_test_checks/Inputs/filter_out_after.c.expected
clang/test/utils/update_cc_test_checks/filter_out_after.test
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after.ll
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after.ll.expected
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after.ll.expected2
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after2.ll
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after2.ll.expected
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after3.ll
llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after3.ll.expected
llvm/test/tools/UpdateTestChecks/update_test_checks/filter_out_after.test
Modified:
llvm/utils/UpdateTestChecks/common.py
Removed:
################################################################################
diff --git a/clang/test/utils/update_cc_test_checks/Inputs/filter_out_after.c b/clang/test/utils/update_cc_test_checks/Inputs/filter_out_after.c
new file mode 100644
index 0000000000000..ea060f9a9a854
--- /dev/null
+++ b/clang/test/utils/update_cc_test_checks/Inputs/filter_out_after.c
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -triple=aarch64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck -check-prefixes=CHECK %s
+
+extern void bar(void);
+
+void foo(int *p, int *q, double *t) {
+ *p = 5;
+ *q = 7;
+ bar();
+ *t = 1.3l;
+}
diff --git a/clang/test/utils/update_cc_test_checks/Inputs/filter_out_after.c.expected b/clang/test/utils/update_cc_test_checks/Inputs/filter_out_after.c.expected
new file mode 100644
index 0000000000000..e3ff01806e031
--- /dev/null
+++ b/clang/test/utils/update_cc_test_checks/Inputs/filter_out_after.c.expected
@@ -0,0 +1,26 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --filter-out-after "call.*bar" --version 5
+// RUN: %clang_cc1 -triple=aarch64-unknown-linux-gnu -emit-llvm -o - %s | FileCheck -check-prefixes=CHECK %s
+
+extern void bar(void);
+
+// CHECK-LABEL: define dso_local void @foo(
+// CHECK-SAME: ptr noundef [[P:%.*]], ptr noundef [[Q:%.*]], ptr noundef [[T:%.*]]) #[[ATTR0:[0-9]+]] {
+// CHECK-NEXT: [[ENTRY:.*:]]
+// CHECK-NEXT: [[P_ADDR:%.*]] = alloca ptr, align 8
+// CHECK-NEXT: [[Q_ADDR:%.*]] = alloca ptr, align 8
+// CHECK-NEXT: [[T_ADDR:%.*]] = alloca ptr, align 8
+// CHECK-NEXT: store ptr [[P]], ptr [[P_ADDR]], align 8
+// CHECK-NEXT: store ptr [[Q]], ptr [[Q_ADDR]], align 8
+// CHECK-NEXT: store ptr [[T]], ptr [[T_ADDR]], align 8
+// CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr [[P_ADDR]], align 8
+// CHECK-NEXT: store i32 5, ptr [[TMP0]], align 4
+// CHECK-NEXT: [[TMP1:%.*]] = load ptr, ptr [[Q_ADDR]], align 8
+// CHECK-NEXT: store i32 7, ptr [[TMP1]], align 4
+// CHECK-NEXT: call void @bar()
+//
+void foo(int *p, int *q, double *t) {
+ *p = 5;
+ *q = 7;
+ bar();
+ *t = 1.3l;
+}
diff --git a/clang/test/utils/update_cc_test_checks/filter_out_after.test b/clang/test/utils/update_cc_test_checks/filter_out_after.test
new file mode 100644
index 0000000000000..d8964eb87cad8
--- /dev/null
+++ b/clang/test/utils/update_cc_test_checks/filter_out_after.test
@@ -0,0 +1,11 @@
+## Check that --filter_out_after works properly.
+# RUN: cp -f %S/Inputs/filter_out_after.c %t.c && %update_cc_test_checks --version=5 --filter-out-after="call.*bar" %t.c
+# RUN:
diff -u %t.c %S/Inputs/filter_out_after.c.expected
+
+## Check that running the script again does not change the result:
+# RUN: %update_cc_test_checks --version=5 --filter-out-after="call.*bar" %t.c
+# RUN:
diff -u %t.c %S/Inputs/filter_out_after.c.expected
+
+## Check that running the script again, without arguments, does not change the result:
+# RUN: %update_cc_test_checks --version=5 %t.c
+# RUN:
diff -u %t.c %S/Inputs/filter_out_after.c.expected
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after.ll b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after.ll
new file mode 100644
index 0000000000000..55703883ad195
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after.ll
@@ -0,0 +1,17 @@
+; RUN: opt < %s -S | FileCheck %s
+
+define i32 @func({i32, i32} %x, i32 %y, i1 %cond) {
+entry:
+ br i1 %cond, label %b1, label %b2
+
+b1:
+ %x.idx0 = extractvalue {i32, i32} %x, 0
+ %add1 = add i32 %y, 1
+ %add2 = add i32 %x.idx0, %add1
+ %mul = mul i32 %add2, 3
+ br label %b2
+
+b2:
+ %res = phi i32 [ -1, %entry ], [ %mul, %b1 ]
+ ret i32 %res
+}
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after.ll.expected b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after.ll.expected
new file mode 100644
index 0000000000000..25b8d744e6386
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after.ll.expected
@@ -0,0 +1,30 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --filter-out-after "^b2:" --version 5
+; RUN: opt < %s -S | FileCheck %s
+
+define i32 @func({i32, i32} %x, i32 %y, i1 %cond) {
+; CHECK-LABEL: define i32 @func(
+; CHECK-SAME: { i32, i32 } [[X:%.*]], i32 [[Y:%.*]], i1 [[COND:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: br i1 [[COND]], label %[[B1:.*]], label %[[B2:.*]]
+; CHECK: [[B1]]:
+; CHECK-NEXT: [[X_IDX0:%.*]] = extractvalue { i32, i32 } [[X]], 0
+; CHECK-NEXT: [[ADD1:%.*]] = add i32 [[Y]], 1
+; CHECK-NEXT: [[ADD2:%.*]] = add i32 [[X_IDX0]], [[ADD1]]
+; CHECK-NEXT: [[MUL:%.*]] = mul i32 [[ADD2]], 3
+; CHECK-NEXT: br label %[[B2]]
+; CHECK: [[B2]]:
+;
+entry:
+ br i1 %cond, label %b1, label %b2
+
+b1:
+ %x.idx0 = extractvalue {i32, i32} %x, 0
+ %add1 = add i32 %y, 1
+ %add2 = add i32 %x.idx0, %add1
+ %mul = mul i32 %add2, 3
+ br label %b2
+
+b2:
+ %res = phi i32 [ -1, %entry ], [ %mul, %b1 ]
+ ret i32 %res
+}
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after.ll.expected2 b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after.ll.expected2
new file mode 100644
index 0000000000000..b045a119e62bf
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after.ll.expected2
@@ -0,0 +1,28 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --filter-out-after "= mul i32" --filter-out-after "^b2:" --version 5
+; RUN: opt < %s -S | FileCheck %s
+
+define i32 @func({i32, i32} %x, i32 %y, i1 %cond) {
+; CHECK-LABEL: define i32 @func(
+; CHECK-SAME: { i32, i32 } [[X:%.*]], i32 [[Y:%.*]], i1 [[COND:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: br i1 [[COND]], label %[[B1:.*]], [[B2:label %.*]]
+; CHECK: [[B1]]:
+; CHECK-NEXT: [[X_IDX0:%.*]] = extractvalue { i32, i32 } [[X]], 0
+; CHECK-NEXT: [[ADD1:%.*]] = add i32 [[Y]], 1
+; CHECK-NEXT: [[ADD2:%.*]] = add i32 [[X_IDX0]], [[ADD1]]
+; CHECK-NEXT: [[MUL:%.*]] = mul i32 [[ADD2]], 3
+;
+entry:
+ br i1 %cond, label %b1, label %b2
+
+b1:
+ %x.idx0 = extractvalue {i32, i32} %x, 0
+ %add1 = add i32 %y, 1
+ %add2 = add i32 %x.idx0, %add1
+ %mul = mul i32 %add2, 3
+ br label %b2
+
+b2:
+ %res = phi i32 [ -1, %entry ], [ %mul, %b1 ]
+ ret i32 %res
+}
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after2.ll b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after2.ll
new file mode 100644
index 0000000000000..33cea1f373ced
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after2.ll
@@ -0,0 +1,33 @@
+; RUN: opt < %s -S | FileCheck %s
+
+define i32 @func1({i32, i32} %x, i32 %y, i1 %cond) {
+entry:
+ br i1 %cond, label %b1, label %b2
+
+b1:
+ %x.idx0 = extractvalue {i32, i32} %x, 0
+ %add1 = add i32 %y, 1
+ %add2 = add i32 %x.idx0, %add1
+ %mul = mul i32 %add2, 3
+ br label %b2
+
+b2:
+ %res = phi i32 [ -1, %entry ], [ %mul, %b1 ]
+ ret i32 %res
+}
+
+define i32 @func2({i32, i32} %x, i32 %y, i1 %cond) {
+entry:
+ br i1 %cond, label %b2, label %b0
+
+b2:
+ %x.idx0 = extractvalue {i32, i32} %x, 0
+ %add1 = add i32 %y, 1
+ %add2 = add i32 %x.idx0, %add1
+ %mul = mul i32 %add2, 3
+ br label %b0
+
+b0:
+ %res = phi i32 [ -1, %entry ], [ %mul, %b2 ]
+ ret i32 %res
+}
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after2.ll.expected b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after2.ll.expected
new file mode 100644
index 0000000000000..4f42acb8e7f9b
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after2.ll.expected
@@ -0,0 +1,52 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --filter-out-after "^b2:" --version 5
+; RUN: opt < %s -S | FileCheck %s
+
+define i32 @func1({i32, i32} %x, i32 %y, i1 %cond) {
+; CHECK-LABEL: define i32 @func1(
+; CHECK-SAME: { i32, i32 } [[X:%.*]], i32 [[Y:%.*]], i1 [[COND:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: br i1 [[COND]], label %[[B1:.*]], label %[[B2:.*]]
+; CHECK: [[B1]]:
+; CHECK-NEXT: [[X_IDX0:%.*]] = extractvalue { i32, i32 } [[X]], 0
+; CHECK-NEXT: [[ADD1:%.*]] = add i32 [[Y]], 1
+; CHECK-NEXT: [[ADD2:%.*]] = add i32 [[X_IDX0]], [[ADD1]]
+; CHECK-NEXT: [[MUL:%.*]] = mul i32 [[ADD2]], 3
+; CHECK-NEXT: br label %[[B2]]
+; CHECK: [[B2]]:
+;
+entry:
+ br i1 %cond, label %b1, label %b2
+
+b1:
+ %x.idx0 = extractvalue {i32, i32} %x, 0
+ %add1 = add i32 %y, 1
+ %add2 = add i32 %x.idx0, %add1
+ %mul = mul i32 %add2, 3
+ br label %b2
+
+b2:
+ %res = phi i32 [ -1, %entry ], [ %mul, %b1 ]
+ ret i32 %res
+}
+
+define i32 @func2({i32, i32} %x, i32 %y, i1 %cond) {
+; CHECK-LABEL: define i32 @func2(
+; CHECK-SAME: { i32, i32 } [[X:%.*]], i32 [[Y:%.*]], i1 [[COND:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: br i1 [[COND]], label %[[B2:.*]], [[B0:label %.*]]
+; CHECK: [[B2]]:
+;
+entry:
+ br i1 %cond, label %b2, label %b0
+
+b2:
+ %x.idx0 = extractvalue {i32, i32} %x, 0
+ %add1 = add i32 %y, 1
+ %add2 = add i32 %x.idx0, %add1
+ %mul = mul i32 %add2, 3
+ br label %b0
+
+b0:
+ %res = phi i32 [ -1, %entry ], [ %mul, %b2 ]
+ ret i32 %res
+}
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after3.ll b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after3.ll
new file mode 100644
index 0000000000000..730a1cf103ddb
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after3.ll
@@ -0,0 +1,9 @@
+; RUN: opt -S -mtriple aarch64-linux-gnu -passes=instnamer < %s | FileCheck %s
+
+define i32 @f_0(i32) {
+ %2 = add i32 %0, 2
+ br label %3
+
+; <label>:3:
+ ret i32 %2
+}
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after3.ll.expected b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after3.ll.expected
new file mode 100644
index 0000000000000..4d7fa9306ac32
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/Inputs/filter-out-after3.ll.expected
@@ -0,0 +1,18 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --filter-out-after "br label %3" --version 5
+; RUN: opt -S -mtriple aarch64-linux-gnu -passes=instnamer < %s | FileCheck %s
+
+define i32 @f_0(i32) {
+; CHECK-LABEL: define i32 @f_0(
+; CHECK-SAME: i32 [[ARG:%.*]]) {
+; CHECK-NEXT: [[BB:.*:]]
+; CHECK-NEXT: [[I:%.*]] = add i32 [[ARG]], 2
+; CHECK-NEXT: br label %[[BB1:.*]]
+; CHECK: [[BB1]]:
+; CHECK-NEXT: ret i32 [[I]]
+;
+ %2 = add i32 %0, 2
+ br label %3
+
+; <label>:3:
+ ret i32 %2
+}
diff --git a/llvm/test/tools/UpdateTestChecks/update_test_checks/filter_out_after.test b/llvm/test/tools/UpdateTestChecks/update_test_checks/filter_out_after.test
new file mode 100644
index 0000000000000..18144da142987
--- /dev/null
+++ b/llvm/test/tools/UpdateTestChecks/update_test_checks/filter_out_after.test
@@ -0,0 +1,39 @@
+## Check that --filter-out-after works properly.
+# RUN: cp -f %S/Inputs/filter-out-after.ll %t.ll && %update_test_checks --version=5 --filter-out-after="^b2:" %t.ll
+# RUN:
diff -u %t.ll %S/Inputs/filter-out-after.ll.expected
+
+## Check that running the script again does not change the result:
+# RUN: %update_test_checks --version=5 --filter-out-after="^b2:" %t.ll
+# RUN:
diff -u %t.ll %S/Inputs/filter-out-after.ll.expected
+
+## Check that running the script again, without arguments, does not change the result:
+# RUN: %update_test_checks --version=5 %t.ll
+# RUN:
diff -u %t.ll %S/Inputs/filter-out-after.ll.expected
+
+## Check that multiple --filter-out-after options work properly.
+# RUN: cp -f %S/Inputs/filter-out-after.ll %t.ll && %update_test_checks --version=5 --filter-out-after="= mul i32" --filter-out-after="^b2:" %t.ll
+# RUN:
diff -u %t.ll %S/Inputs/filter-out-after.ll.expected2
+
+## Check that running the script again does not change the result:
+# RUN: %update_test_checks --version=5 --filter-out-after="= mul i32" --filter-out-after="^b2:" %t.ll
+# RUN:
diff -u %t.ll %S/Inputs/filter-out-after.ll.expected2
+
+## Check that running the script again, without arguments, does not change the result:
+# RUN: %update_test_checks --version=5 %t.ll
+# RUN:
diff -u %t.ll %S/Inputs/filter-out-after.ll.expected2
+
+## Check that --filter-out-after works per function only.
+# RUN: cp -f %S/Inputs/filter-out-after2.ll %t.ll && %update_test_checks --version=5 --filter-out-after="^b2:" %t.ll
+# RUN:
diff -u %t.ll %S/Inputs/filter-out-after2.ll.expected
+
+## Check that running the script again does not change the result:
+# RUN: %update_test_checks --version=5 --filter-out-after="^b2:" %t.ll
+# RUN:
diff -u %t.ll %S/Inputs/filter-out-after2.ll.expected
+
+## Check that running the script again, without arguments, does not change the result:
+# RUN: %update_test_checks --version=5 %t.ll
+# RUN:
diff -u %t.ll %S/Inputs/filter-out-after2.ll.expected
+
+## Check that --filter-out-after does not filter input IR.
+# RUN: cp -f %S/Inputs/filter-out-after3.ll %t.ll && %update_test_checks --version=5 --filter-out-after="br label %3" %t.ll
+# RUN:
diff -u %t.ll %S/Inputs/filter-out-after3.ll.expected
diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py
index 0700486b61ec5..274614c2bd272 100644
--- a/llvm/utils/UpdateTestChecks/common.py
+++ b/llvm/utils/UpdateTestChecks/common.py
@@ -74,13 +74,17 @@ class Filter(Regex):
"""
- def __init__(self, regex, is_filter_out):
+ def __init__(self, regex, is_filter_out, is_filter_out_after):
super(Filter, self).__init__(regex)
+ if is_filter_out and is_filter_out_after:
+ raise ValueError("cannot use both --filter-out and --filter-out-after")
self.is_filter_out = is_filter_out
+ self.is_filter_out_after = is_filter_out_after
def __deepcopy__(self, memo):
result = copy.deepcopy(super(Filter, self), memo)
result.is_filter_out = copy.deepcopy(self.is_filter_out, memo)
+ result.is_filter_out_after = copy.deepcopy(self.is_filter_out_after, memo)
return result
@@ -127,7 +131,11 @@ def __call__(self, parser, namespace, values, option_string=None):
is_filter_out = option_string == "--filter-out"
- value_list[-1] = Filter(value_list[-1].regex, is_filter_out)
+ is_filter_out_after = option_string == "--filter-out-after"
+
+ value_list[-1] = Filter(
+ value_list[-1].regex, is_filter_out, is_filter_out_after
+ )
setattr(namespace, self.dest, value_list)
@@ -151,6 +159,13 @@ def __call__(self, parser, namespace, values, option_string=None):
metavar="REGEX",
help="Exclude lines matching REGEX",
)
+ filter_group.add_argument(
+ "--filter-out-after",
+ action=FilterAction,
+ dest="filters",
+ metavar="REGEX",
+ help="Exclude all lines within a given function after line matching REGEX",
+ )
parser.add_argument(
"--include-generated-funcs",
@@ -671,6 +686,8 @@ def get_globals_name_prefix(raw_tool_output):
def apply_filters(line, filters):
has_filter = False
for f in filters:
+ if f.is_filter_out_after:
+ continue
if not f.is_filter_out:
has_filter = True
if f.search(line):
@@ -680,14 +697,34 @@ def apply_filters(line, filters):
return False if has_filter else True
+def has_filter_out_after(filters):
+ for f in filters:
+ if f.is_filter_out_after:
+ return True
+ return False
+
+
+def filter_out_after(body, filters):
+ lines = []
+ for line in body.splitlines():
+ lines.append(line)
+ for f in filters:
+ if f.is_filter_out_after:
+ if f.search(line):
+ return lines
+ return lines
+
+
def do_filter(body, filters):
- return (
- body
- if not filters
- else "\n".join(
- filter(lambda line: apply_filters(line, filters), body.splitlines())
- )
- )
+ if not filters:
+ return body
+ filter_out_after_flag = has_filter_out_after(filters)
+ lines = []
+ if filter_out_after_flag:
+ lines = filter_out_after(body, filters)
+ else:
+ lines = body.splitlines()
+ return "\n".join(filter(lambda line: apply_filters(line, filters), lines))
def scrub_body(body):
@@ -788,7 +825,9 @@ def __init__(self, run_list, flags, scrubber_args, path, ginfo):
list(
map(
lambda f: Filter(
- re.compile(f.pattern().strip('"'), f.flags()), f.is_filter_out
+ re.compile(f.pattern().strip('"'), f.flags()),
+ f.is_filter_out,
+ f.is_filter_out_after,
),
flags.filters,
)
@@ -831,7 +870,10 @@ def global_var_dict(self):
return self._global_var_dict
def is_filtered(self):
- return bool(self._filters)
+ for f in self._filters:
+ if not f.is_filter_out_after:
+ return True
+ return False
def process_run_line(self, function_re, scrubber, raw_tool_output, prefixes):
build_global_values_dictionary(
@@ -2526,7 +2568,12 @@ def get_autogennote_suffix(parser, args):
# Create a separate option for each filter element. The value is a list
# of Filter objects.
for elem in value:
- opt_name = "filter-out" if elem.is_filter_out else "filter"
+ if elem.is_filter_out:
+ opt_name = "filter-out"
+ elif elem.is_filter_out_after:
+ opt_name = "filter-out-after"
+ else:
+ opt_name = "filter"
opt_value = elem.pattern()
new_arg = '--%s "%s" ' % (opt_name, opt_value.strip('"'))
if new_arg not in autogenerated_note_args:
More information about the llvm-commits
mailing list