aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2021-07-14 06:34:01 +0000
committerterminaldweller <thabogre@gmail.com>2021-07-14 06:34:01 +0000
commite447e32aa105dac13375818c245404120d5f28af (patch)
tree6d68ea789c338a14350ec349f296d426015a4af6
parentfix for llvm 13 (diff)
downloadcgrep-e447e32aa105dac13375818c245404120d5f28af.tar.gz
cgrep-e447e32aa105dac13375818c245404120d5f28af.zip
fix for llvm 13v1.1.1
-rw-r--r--cgrep.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/cgrep.cpp b/cgrep.cpp
index 41ef737..3cdff06 100644
--- a/cgrep.cpp
+++ b/cgrep.cpp
@@ -1106,11 +1106,16 @@ private:
/*Main*/
int main(int argc, const char **argv) {
#if __clang_major__ >= 13
- auto op = CommonOptionsParser::create(argc, argv, CGrepCat);
+ auto op =
+ CommonOptionsParser::create(argc, argv, CGrepCat);
+ if (auto error = op.takeError()) {
+ errs() << toString(std::move(error)) << "\n";
+ return 1;
+ }
+ ClangTool Tool(op->getCompilations(), op->getSourcePathList());
#else
CommonOptionsParser op(argc, argv, CGrepCat);
#endif
- ClangTool Tool(op.getCompilations(), op.getSourcePathList());
int ret = 0;
if ("" != CO_TRACE) {