This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG1744f4c67641: [clang][cli] NFC: Promote ParseLangArgs and ParseCodeGenArgs to members (authored by jansvoboda11).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D94681/new/ https://reviews.llvm.org/D94681 Files: clang/include/clang/Frontend/CompilerInvocation.h clang/lib/Frontend/CompilerInvocation.cpp Index: clang/lib/Frontend/CompilerInvocation.cpp =================================================================== --- clang/lib/Frontend/CompilerInvocation.cpp +++ clang/lib/Frontend/CompilerInvocation.cpp @@ -907,9 +907,11 @@ Opts.setProfileUse(CodeGenOptions::ProfileClangInstr); } -static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, - DiagnosticsEngine &Diags, const llvm::Triple &T, - const std::string &OutputFile) { +bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, + InputKind IK, + DiagnosticsEngine &Diags, + const llvm::Triple &T, + const std::string &OutputFile) { bool Success = true; unsigned OptimizationLevel = getOptimizationLevel(Args, IK, Diags); @@ -2151,10 +2153,10 @@ Args.push_back(SA(GetOptName(OPT_fdeclare_opencl_builtins))); } -static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, - const llvm::Triple &T, - std::vector<std::string> &Includes, - DiagnosticsEngine &Diags) { +void CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, + InputKind IK, const llvm::Triple &T, + std::vector<std::string> &Includes, + DiagnosticsEngine &Diags) { // FIXME: Cleanup per-file based stuff. LangStandard::Kind LangStd = LangStandard::lang_unspecified; if (const Arg *A = Args.getLastArg(OPT_std_EQ)) { Index: clang/include/clang/Frontend/CompilerInvocation.h =================================================================== --- clang/include/clang/Frontend/CompilerInvocation.h +++ clang/include/clang/Frontend/CompilerInvocation.h @@ -247,6 +247,18 @@ /// \returns - True if parsing was successful, false otherwise bool parseSimpleArgs(const llvm::opt::ArgList &Args, DiagnosticsEngine &Diags); + + /// Parse command line options that map to LangOptions. + static void ParseLangArgs(LangOptions &Opts, llvm::opt::ArgList &Args, + InputKind IK, const llvm::Triple &T, + std::vector<std::string> &Includes, + DiagnosticsEngine &Diags); + + /// Parse command line options that map to CodeGenOptions. + static bool ParseCodeGenArgs(CodeGenOptions &Opts, llvm::opt::ArgList &Args, + InputKind IK, DiagnosticsEngine &Diags, + const llvm::Triple &T, + const std::string &OutputFile); }; IntrusiveRefCntPtr<llvm::vfs::FileSystem>
Index: clang/lib/Frontend/CompilerInvocation.cpp =================================================================== --- clang/lib/Frontend/CompilerInvocation.cpp +++ clang/lib/Frontend/CompilerInvocation.cpp @@ -907,9 +907,11 @@ Opts.setProfileUse(CodeGenOptions::ProfileClangInstr); } -static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, - DiagnosticsEngine &Diags, const llvm::Triple &T, - const std::string &OutputFile) { +bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, + InputKind IK, + DiagnosticsEngine &Diags, + const llvm::Triple &T, + const std::string &OutputFile) { bool Success = true; unsigned OptimizationLevel = getOptimizationLevel(Args, IK, Diags); @@ -2151,10 +2153,10 @@ Args.push_back(SA(GetOptName(OPT_fdeclare_opencl_builtins))); } -static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, - const llvm::Triple &T, - std::vector<std::string> &Includes, - DiagnosticsEngine &Diags) { +void CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, + InputKind IK, const llvm::Triple &T, + std::vector<std::string> &Includes, + DiagnosticsEngine &Diags) { // FIXME: Cleanup per-file based stuff. LangStandard::Kind LangStd = LangStandard::lang_unspecified; if (const Arg *A = Args.getLastArg(OPT_std_EQ)) { Index: clang/include/clang/Frontend/CompilerInvocation.h =================================================================== --- clang/include/clang/Frontend/CompilerInvocation.h +++ clang/include/clang/Frontend/CompilerInvocation.h @@ -247,6 +247,18 @@ /// \returns - True if parsing was successful, false otherwise bool parseSimpleArgs(const llvm::opt::ArgList &Args, DiagnosticsEngine &Diags); + + /// Parse command line options that map to LangOptions. + static void ParseLangArgs(LangOptions &Opts, llvm::opt::ArgList &Args, + InputKind IK, const llvm::Triple &T, + std::vector<std::string> &Includes, + DiagnosticsEngine &Diags); + + /// Parse command line options that map to CodeGenOptions. + static bool ParseCodeGenArgs(CodeGenOptions &Opts, llvm::opt::ArgList &Args, + InputKind IK, DiagnosticsEngine &Diags, + const llvm::Triple &T, + const std::string &OutputFile); }; IntrusiveRefCntPtr<llvm::vfs::FileSystem>
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits