Commit 194ce2d
committed
[Clang] Always verify LLVM IR inputs
We get a lot of issues that basically boil down to "I passed
malformed LLVM IR to clang and it crashed". Clang does not perform
IR verification by default in (non-assertion-enabled) release
builds, and that's sensible for IR that Clang itself produces,
which is expected to always be valid. However, if people pass in
their own handwritten IR, we should report if it is malformed,
instead of crashing. We should also report it in a way that does
not produce a crash trace and ask for a bug report, as currently
happens in assertions-enabled builds.
I've only added the verification for textual IR inputs. I don't
want to force verification for bitcode inputs, as these would
affect typical LTO scenarios, and are usually coming from Clang
itself.1 parent 7d4ea77 commit 194ce2d
File tree
3 files changed
+26
-1
lines changed- clang
- include/clang/Basic
- lib/CodeGen
- test/CodeGen
3 files changed
+26
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
379 | 379 | | |
380 | 380 | | |
381 | 381 | | |
| 382 | + | |
| 383 | + | |
382 | 384 | | |
383 | 385 | | |
384 | 386 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
1048 | 1049 | | |
1049 | 1050 | | |
1050 | 1051 | | |
1051 | | - | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
1052 | 1064 | | |
| 1065 | + | |
1053 | 1066 | | |
1054 | 1067 | | |
1055 | 1068 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments