Skip to content

Commit 0c62920

Browse files
committed
undef reviewer: tweak the regex so it doesn't warn about #undef
1 parent 6ab8401 commit 0c62920

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/utils/git/code-format-helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def format_run(self, changed_files: List[str], args: FormatArgs) -> Optional[str
380380
# diff --git a/file b/file
381381
for file in re.split("^diff --git ", stdout, 0, re.MULTILINE):
382382
# search for additions of undef
383-
if re.search("^[+].*" + regex, file, re.MULTILINE):
383+
if re.search(r"^[+](?!\s*#\s*).*(\bundef\b|UndefValue::get)", file, re.MULTILINE):
384384
files.append(re.match("a/([^ ]+)", file.splitlines()[0])[1])
385385

386386
if not files:

0 commit comments

Comments
 (0)