Simple little utility which takes a opt logfile generated with -print-before-all -print-module-scope, and splits into a series of individual "chunk-X.ll" files. The intended purpose is to help automate one step in failure reduction.
The imagined workflow is:
- New crasher bug reported against clang or other frontend
- Frontend run with -emit-llvm equivalent and manually confirmed that opt -O2 <emit.ll> crashes
- Run this splitter script
- Manually map pass name to invocation command (next on the to automate list)
- Run bugpoint on last chunk file + manual command
I chose to dump every chunk rather than only the last since miscompile debugging frequently requires either manual step by step reduction, or cross feeding IR into different compiler versions. Not an immediate target, but there may be applications.
is_dump to have uniform variable naming.