[clang] 174e954 - [flang][nfc] Rename `AddOtherOptions` as `ForwardOptions`
Andrzej Warzynski via cfe-commits
cfe-commits at lists.llvm.org
Fri Oct 14 09:20:35 PDT 2022
Author: Andrzej Warzynski
Date: 2022-10-14T16:20:04Z
New Revision: 174e954e370e4f2ae82fea3f959e843bc05e3046
URL: https://github.com/llvm/llvm-project/commit/174e954e370e4f2ae82fea3f959e843bc05e3046
DIFF: https://github.com/llvm/llvm-project/commit/174e954e370e4f2ae82fea3f959e843bc05e3046.diff
LOG: [flang][nfc] Rename `AddOtherOptions` as `ForwardOptions`
The updated name better reflects what this hook is intended for.
Reviewed By: tarunprabhu
Differential Revision: https://reviews.llvm.org/D130078
Added:
Modified:
clang/lib/Driver/ToolChains/Flang.cpp
clang/lib/Driver/ToolChains/Flang.h
Removed:
################################################################################
diff --git a/clang/lib/Driver/ToolChains/Flang.cpp b/clang/lib/Driver/ToolChains/Flang.cpp
index d7ac459db5f5..964f0e261704 100644
--- a/clang/lib/Driver/ToolChains/Flang.cpp
+++ b/clang/lib/Driver/ToolChains/Flang.cpp
@@ -27,7 +27,7 @@ static void addDashXForInput(const ArgList &Args, const InputInfo &Input,
CmdArgs.push_back(types::getTypeName(Input.getType()));
}
-void Flang::AddFortranDialectOptions(const ArgList &Args,
+void Flang::addFortranDialectOptions(const ArgList &Args,
ArgStringList &CmdArgs) const {
Args.AddAllArgs(
CmdArgs, {options::OPT_ffixed_form, options::OPT_ffree_form,
@@ -44,14 +44,14 @@ void Flang::AddFortranDialectOptions(const ArgList &Args,
options::OPT_fno_automatic});
}
-void Flang::AddPreprocessingOptions(const ArgList &Args,
+void Flang::addPreprocessingOptions(const ArgList &Args,
ArgStringList &CmdArgs) const {
Args.AddAllArgs(CmdArgs,
{options::OPT_P, options::OPT_D, options::OPT_U,
options::OPT_I, options::OPT_cpp, options::OPT_nocpp});
}
-void Flang::AddOtherOptions(const ArgList &Args, ArgStringList &CmdArgs) const {
+void Flang::forwardOptions(const ArgList &Args, ArgStringList &CmdArgs) const {
Args.AddAllArgs(CmdArgs,
{options::OPT_module_dir, options::OPT_fdebug_module_writer,
options::OPT_fintrinsic_modules_path, options::OPT_pedantic,
@@ -127,9 +127,9 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA,
// Add preprocessing options like -I, -D, etc. if we are using the
// preprocessor (i.e. skip when dealing with e.g. binary files).
if (types::getPreprocessedType(InputType) != types::TY_INVALID)
- AddPreprocessingOptions(Args, CmdArgs);
+ addPreprocessingOptions(Args, CmdArgs);
- AddFortranDialectOptions(Args, CmdArgs);
+ addFortranDialectOptions(Args, CmdArgs);
// Color diagnostics are parsed by the driver directly from argv and later
// re-parsed to construct this job; claim any possible color diagnostic here
@@ -142,8 +142,8 @@ void Flang::ConstructJob(Compilation &C, const JobAction &JA,
// -fPIC and related options.
AddPicOptions(Args, CmdArgs);
- // Add other compile options
- AddOtherOptions(Args, CmdArgs);
+ // Handle options which are simply forwarded to -fc1.
+ forwardOptions(Args, CmdArgs);
// Forward -Xflang arguments to -fc1
Args.AddAllArgValues(CmdArgs, options::OPT_Xflang);
diff --git a/clang/lib/Driver/ToolChains/Flang.h b/clang/lib/Driver/ToolChains/Flang.h
index c5ac147da768..4d8e2e8ee5aa 100644
--- a/clang/lib/Driver/ToolChains/Flang.h
+++ b/clang/lib/Driver/ToolChains/Flang.h
@@ -29,7 +29,7 @@ class LLVM_LIBRARY_VISIBILITY Flang : public Tool {
///
/// \param [in] Args The list of input driver arguments
/// \param [out] CmdArgs The list of output command arguments
- void AddFortranDialectOptions(const llvm::opt::ArgList &Args,
+ void addFortranDialectOptions(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const;
/// Extract preprocessing options from the driver arguments and add them to
@@ -37,7 +37,7 @@ class LLVM_LIBRARY_VISIBILITY Flang : public Tool {
///
/// \param [in] Args The list of input driver arguments
/// \param [out] CmdArgs The list of output command arguments
- void AddPreprocessingOptions(const llvm::opt::ArgList &Args,
+ void addPreprocessingOptions(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const;
/// Extract PIC options from the driver arguments and add them to
@@ -48,13 +48,12 @@ class LLVM_LIBRARY_VISIBILITY Flang : public Tool {
void AddPicOptions(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const;
- /// Extract other compilation options from the driver arguments and add them
- /// to the command arguments.
+ /// This method will effectively copy options from \a Args into \a CmdArgs.
///
/// \param [in] Args The list of input driver arguments
/// \param [out] CmdArgs The list of output command arguments
- void AddOtherOptions(const llvm::opt::ArgList &Args,
- llvm::opt::ArgStringList &CmdArgs) const;
+ void forwardOptions(const llvm::opt::ArgList &Args,
+ llvm::opt::ArgStringList &CmdArgs) const;
public:
Flang(const ToolChain &TC);
More information about the cfe-commits
mailing list