Author: Jan Svoboda Date: 2020-11-18T12:18:27+01:00 New Revision: 1e6fc2fa532c280abec04f83410dfdb3760dfc0f
URL: https://github.com/llvm/llvm-project/commit/1e6fc2fa532c280abec04f83410dfdb3760dfc0f DIFF: https://github.com/llvm/llvm-project/commit/1e6fc2fa532c280abec04f83410dfdb3760dfc0f.diff LOG: [clang][cli] Port Migrator option flags to new option parsing system Depends on D83406 Reviewed By: Bigcheese Original patch by Daniel Grumberg. Differential Revision: https://reviews.llvm.org/D83690 Added: Modified: clang/include/clang/Driver/Options.td clang/lib/Frontend/CompilerInvocation.cpp Removed: ################################################################################ diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 01d90a47101b..7a75eb683249 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -3791,10 +3791,12 @@ def analyzer_werror : Flag<["-"], "analyzer-werror">, // Migrator Options //===----------------------------------------------------------------------===// def migrator_no_nsalloc_error : Flag<["-"], "no-ns-alloc-error">, - HelpText<"Do not error on use of NSAllocateCollectable/NSReallocateCollectable">; + HelpText<"Do not error on use of NSAllocateCollectable/NSReallocateCollectable">, + MarshallingInfoFlag<"MigratorOpts.NoNSAllocReallocError">; def migrator_no_finalize_removal : Flag<["-"], "no-finalize-removal">, - HelpText<"Do not remove finalize method in gc mode">; + HelpText<"Do not remove finalize method in gc mode">, + MarshallingInfoFlag<"MigratorOpts.NoFinalizeRemoval">; //===----------------------------------------------------------------------===// // CodeGen Options diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 2c54611e4912..a0ed8178b9df 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -683,12 +683,6 @@ static void parseAnalyzerConfigs(AnalyzerOptions &AnOpts, << "a filename"; } -static bool ParseMigratorArgs(MigratorOptions &Opts, ArgList &Args) { - Opts.NoNSAllocReallocError = Args.hasArg(OPT_migrator_no_nsalloc_error); - Opts.NoFinalizeRemoval = Args.hasArg(OPT_migrator_no_finalize_removal); - return true; -} - static void ParseCommentArgs(CommentOptions &Opts, ArgList &Args) { Opts.BlockCommandNames = Args.getAllArgValues(OPT_fcomment_block_commands); Opts.ParseAllComments = Args.hasArg(OPT_fparse_all_comments); @@ -3838,7 +3832,6 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res, FixupInvocation(Res); Success &= ParseAnalyzerArgs(*Res.getAnalyzerOpts(), Args, Diags); - Success &= ParseMigratorArgs(Res.getMigratorOpts(), Args); ParseDependencyOutputArgs(Res.getDependencyOutputOpts(), Args); if (!Res.getDependencyOutputOpts().OutputFile.empty() && Res.getDependencyOutputOpts().Targets.empty()) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits