Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b416e7f

Browse files
committed
[CI] adjust the undef warning regex so it doesn't catch %undef in .ll files
1 parent b0cb672 commit b416e7f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

+2-4
Original file line numberDiff line numberDiff line change
@@ -387,13 +387,11 @@ def format_run(self, changed_files: List[str], args: FormatArgs) -> Optional[str
387387
for file in re.split("^diff --git ", stdout, 0, re.MULTILINE):
388388
filename = re.match("a/([^ ]+)", file.splitlines()[0])[1]
389389
if filename.endswith(".ll"):
390-
undef_regex = r"\bundef\b"
390+
undef_regex = r"(?<!%)\bundef\b"
391391
else:
392392
undef_regex = r"UndefValue::get"
393393
# search for additions of undef
394-
if re.search(
395-
r"^[+](?!\s*#\s*).*(" + undef_regex + r")", file, re.MULTILINE
396-
):
394+
if re.search(r"^[+].*" + undef_regex, file, re.MULTILINE):
397395
files.append(filename)
398396

399397
if not files:

0 commit comments

Comments
 (0)