diff --git a/llvm/utils/git/code-format-helper.py b/llvm/utils/git/code-format-helper.py index 36fc5ee4c3d5273..48a338aca9c8e61 100755 --- a/llvm/utils/git/code-format-helper.py +++ b/llvm/utils/git/code-format-helper.py @@ -379,6 +379,10 @@ def format_run(self, changed_files: List[str], args: FormatArgs) -> Optional[str # Each file is prefixed like: # diff --git a/file b/file for file in re.split("^diff --git ", stdout, 0, re.MULTILINE): + # We skip checking in MIR files as undef is a valid token and not + # going away. + if file.endswith(".mir"): + continue # search for additions of undef if re.search(r"^[+](?!\s*#\s*).*(\bundef\b|UndefValue::get)", file, re.MULTILINE): files.append(re.match("a/([^ ]+)", file.splitlines()[0])[1])