[llvm] Better error message from build script.
@@ -242,10 +242,17 @@ def main(argv):
else:
# Get the names of all files which contain a pass definition.
matching_paths = []
+ try:
grep = subprocess.check_output(
["grep", "-l", "-E", rf"^\s*{INITIALIZE_PASS_RE}", "-R", "lib/"],
universal_newlines=True,
)
+ except subprocess.CalledProcessError:
+ print(
+ f"fatal: Failed to find any LLVM pass declarations in {root}",
+ file=sys.stderr,
+ )
+ sys.exit(1)
matching_paths += grep.strip().split("\n")
logger.debug("Processing %s files ...", len(matching_paths))
paths = [Path(path) for path in matching_paths]
