aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2021-01-15 15:44:09 +0100
committerJan Svoboda <jan_svoboda@apple.com>2021-01-15 16:41:34 +0100
commit1744f4c676411ebd2e38afd5a6b56e5dd533c6ac (patch)
tree43464eea08bd5e648b49058d85d479f63447f430 /clang/lib/Frontend/CompilerInvocation.cpp
parenta7dcd3aeb0fb58ad774bc89428ed6c925f31f8aa (diff)
downloadllvm-1744f4c676411ebd2e38afd5a6b56e5dd533c6ac.zip
llvm-1744f4c676411ebd2e38afd5a6b56e5dd533c6ac.tar.gz
llvm-1744f4c676411ebd2e38afd5a6b56e5dd533c6ac.tar.bz2
[clang][cli] NFC: Promote ParseLangArgs and ParseCodeGenArgs to members
This patch promotes `ParseLangArgs` and `ParseCodeGenArgs` to members of `CompilerInvocation`. That will be useful in the following patch D94682, where we need to access protected members of `LangOptions` and `CodeGenOptions`. Both of those classes already have `friend CompilerInvocation`. This is cleaner than keeping those functions freestanding and having to specify the exact signature of both in extra `friend` declarations. Reviewed By: Bigcheese Differential Revision: https://reviews.llvm.org/D94681
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index c672834..25b3610 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -907,9 +907,11 @@ static void setPGOUseInstrumentor(CodeGenOptions &Opts,
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 @@ static void GenerateLangArgs(const LangOptions &Opts,
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)) {