diff options
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | flang/lib/Frontend/CompilerInvocation.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 7507b00..32888bd 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -9,6 +9,7 @@ #include "flang/Frontend/CompilerInvocation.h" #include "flang/Common/Fortran-features.h" #include "flang/Frontend/PreprocessorOptions.h" +#include "flang/Frontend/TargetOptions.h" #include "flang/Semantics/semantics.h" #include "flang/Version.inc" #include "clang/Basic/AllDiagnostics.h" @@ -88,6 +89,15 @@ bool Fortran::frontend::ParseDiagnosticArgs(clang::DiagnosticOptions &opts, return true; } +/// Parses all target input arguments and populates the target +/// options accordingly. +/// +/// \param [in] opts The target options instance to update +/// \param [in] args The list of input arguments (from the compiler invocation) +static void ParseTargetArgs(TargetOptions &opts, llvm::opt::ArgList &args) { + opts.triple = args.getLastArgValue(clang::driver::options::OPT_triple); +} + // Tweak the frontend configuration based on the frontend action static void setUpFrontendBasedOnAction(FrontendOptions &opts) { assert(opts.programAction != Fortran::frontend::InvalidAction && @@ -563,6 +573,7 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &res, } success &= ParseFrontendArgs(res.frontendOpts(), args, diags); + ParseTargetArgs(res.targetOpts(), args); parsePreprocessorArgs(res.preprocessorOpts(), args); success &= parseSemaArgs(res, args, diags); success &= parseDialectArgs(res, args, diags); |