[clang-tooling] Prevent llvm::fatal_error on invalid CLI option
authorserge-sans-paille <sguelton@redhat.com>
Mon, 11 Jan 2021 15:19:35 +0000 (16:19 +0100)
committerserge-sans-paille <sguelton@redhat.com>
Fri, 29 Jan 2021 09:15:06 +0000 (10:15 +0100)
commitd47ee525f9e9289815db0864b03e866fc8e5ba01
tree634e74557ef6c2fe521173deff50d5f6242ca267
parentcba2552bfec1c9d837f7285a743e9e12fa6b043e
[clang-tooling] Prevent llvm::fatal_error on invalid CLI option

Fail gracefully instead. Prevent further misuse by enforcing the factory builder
instead of the constructor.

Differential Revision: https://reviews.llvm.org/D94420
14 files changed:
clang-tools-extra/clang-change-namespace/tool/ClangChangeNamespace.cpp
clang-tools-extra/clang-include-fixer/find-all-symbols/tool/FindAllSymbolsMain.cpp
clang-tools-extra/clang-include-fixer/tool/ClangIncludeFixer.cpp
clang-tools-extra/clang-move/tool/ClangMove.cpp
clang-tools-extra/clang-reorder-fields/tool/ClangReorderFields.cpp
clang-tools-extra/test/clang-query/invalid-command-line.cpp
clang-tools-extra/test/clang-tidy/infrastructure/invalid-command-line.cpp
clang/docs/LibASTMatchersTutorial.rst
clang/include/clang/Tooling/CommonOptionsParser.h
clang/lib/Tooling/CommonOptionsParser.cpp
clang/tools/clang-check/ClangCheck.cpp
clang/tools/clang-extdef-mapping/ClangExtDefMapGen.cpp
clang/tools/clang-refactor/ClangRefactor.cpp
clang/tools/clang-rename/ClangRename.cpp