[NewPM] teach -passes= to emit meaningful error messages
authorFedor Sergeev <fedor.sergeev@azul.com>
Wed, 17 Oct 2018 10:36:23 +0000 (10:36 +0000)
committerFedor Sergeev <fedor.sergeev@azul.com>
Wed, 17 Oct 2018 10:36:23 +0000 (10:36 +0000)
commitbd6b2138b94a47a9226ec1e69bf3be55a47fd1ef
treede58f3925965bf772e2becdad7ff066b456d90ed
parent8a08412533536cf433097817e9f155a4ce68252b
[NewPM] teach -passes= to emit meaningful error messages

All the PassBuilder::parse interfaces now return descriptive StringError
instead of a plain bool. It allows to make -passes/aa-pipeline parsing
errors context-specific and thus less confusing.

TODO: ideally we should also make suggestions for misspelled pass names,
but that requires some extensions to PassBuilder.

Reviewed By: philip.pfaffe, chandlerc
Differential Revision: https://reviews.llvm.org/D53246

llvm-svn: 344685
13 files changed:
lld/test/ELF/lto/ltopasses-custom.ll
llvm/include/llvm/Passes/PassBuilder.h
llvm/lib/LTO/LTOBackend.cpp
llvm/lib/Passes/PassBuilder.cpp
llvm/test/Other/pass-pipeline-parsing.ll
llvm/test/tools/llvm-lto2/X86/pipeline.ll
llvm/test/tools/llvm-opt-fuzzer/command-line.ll
llvm/tools/llvm-opt-fuzzer/llvm-opt-fuzzer.cpp
llvm/tools/opt/NewPMDriver.cpp
llvm/unittests/IR/CMakeLists.txt
llvm/unittests/IR/PassBuilderCallbacksTest.cpp
llvm/unittests/Passes/CMakeLists.txt
llvm/unittests/Passes/PluginsTest.cpp