aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorAmy Huang <akhuang@google.com>2019-04-24 00:28:23 +0000
committerAmy Huang <akhuang@google.com>2019-04-24 00:28:23 +0000
commit6516015ff03e3bdd59be4ab37aa5399d4f10e2a5 (patch)
tree09a4aed69f7238b0739ed2641eebbe1cbe218790 /utils
parent01f976def19d3a1f90fa7dc40d11f15b9f610d2c (diff)
Fixes in creduce-clang-crash.py for clang crash message parsing and reading the command from the repro script.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359054 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/creduce-clang-crash.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/utils/creduce-clang-crash.py b/utils/creduce-clang-crash.py
index 790a47ec38..40d3c77b46 100644
--- a/utils/creduce-clang-crash.py
+++ b/utils/creduce-clang-crash.py
@@ -93,9 +93,14 @@ class Reduce(object):
def read_clang_args(self, crash_script, filename):
print("\nReading arguments from crash script...")
with open(crash_script) as f:
- # Assume clang call is on the last line of the script
- line = f.readlines()[-1]
- cmd = shlex.split(line)
+ # Assume clang call is the first non comment line.
+ cmd = []
+ for line in f:
+ if not line.lstrip().startswith('#'):
+ cmd = shlex.split(line)
+ break
+ if not cmd:
+ sys.exit("Could not find command in the crash script.");
# Remove clang and filename from the command
# Assume the last occurrence of the filename is the clang input file
@@ -122,7 +127,7 @@ class Reduce(object):
# Look for specific error messages
regexes = [r"Assertion `(.+)' failed", # Linux assert()
r"Assertion failed: (.+),", # FreeBSD/Mac assert()
- r"fatal error: backend error: (.+)",
+ r"fatal error: error in backend: (.+)",
r"LLVM ERROR: (.+)",
r"UNREACHABLE executed (at .+)?!",
r"LLVM IR generation of ceclaration '(.+)'",