@@ -55,16 +55,6 @@ static llvm::cl::OptionCategory gInsightEduCategory(
5555 " This transformations are only for education purposes. The resulting code most likely does not compile." sv);
5656// -----------------------------------------------------------------------------
5757
58- static llvm::cl::opt<bool > gStdinMode (" stdin" ,
59- llvm::cl::desc (" Read the input from <stdin>." sv),
60- llvm::cl::init(false ),
61- llvm::cl::cat(gInsightCategory ));
62- // -----------------------------------------------------------------------------
63-
64- static llvm::cl::opt<bool >
65- gUseLibCpp (" use-libc++" , llvm::cl::desc(" Use libc++." sv), llvm::cl::init(false ), llvm::cl::cat(gInsightCategory ));
66- // -----------------------------------------------------------------------------
67-
6858#define INSIGHTS_OPT (option, name, deflt, description, category ) \
6959 static llvm::cl::opt<bool , true > g##name(option, \
7060 llvm::cl::desc (std::string_view{description}), \
@@ -397,7 +387,17 @@ extern struct __mptr* __vtbl_array[];
397387 auto opExpected = CommonOptionsParser::create (argc, argv, gInsightCategory );
398388
399389 if (auto err = opExpected.takeError ()) {
400- llvm::errs () << toString (std::move (err)) << " \n " ;
390+ if (gAutoComplete ) {
391+ #define INSIGHTS_OPT (option, name, deflt, description, category ) llvm::outs() << " --" << option << " " ;
392+
393+ #include " InsightsOptions.def"
394+
395+ return 0 ;
396+ } else {
397+
398+ llvm::errs () << toString (std::move (err)) << " \n " ;
399+ }
400+
401401 return 1 ;
402402 }
403403
0 commit comments