diff options
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
| -rw-r--r-- | flang/lib/Frontend/CompilerInvocation.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 4719a242035e..6295a58b1bda 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -22,6 +22,7 @@ #include "flang/Tools/TargetSetup.h" #include "flang/Version.inc" #include "clang/Basic/DiagnosticDriver.h" +#include "clang/Basic/DiagnosticFrontend.h" #include "clang/Basic/DiagnosticOptions.h" #include "clang/Driver/CommonArgs.h" #include "clang/Driver/Driver.h" @@ -1258,7 +1259,7 @@ static bool parseOpenMPArgs(CompilerInvocation &res, llvm::opt::ArgList &args, clang::driver::options::OPT_fopenmp_host_ir_file_path)) { res.getLangOpts().OMPHostIRFile = arg->getValue(); if (!llvm::sys::fs::exists(res.getLangOpts().OMPHostIRFile)) - diags.Report(clang::diag::err_drv_omp_host_ir_file_not_found) + diags.Report(clang::diag::err_omp_host_ir_file_not_found) << res.getLangOpts().OMPHostIRFile; } @@ -1754,6 +1755,11 @@ void CompilerInvocation::setDefaultPredefinitions() { fortranOptions.predefinitions); } + if (frontendOptions.features.IsEnabled( + Fortran::common::LanguageFeature::CUDA)) { + fortranOptions.predefinitions.emplace_back("_CUDA", "1"); + } + llvm::Triple targetTriple{llvm::Triple(this->targetOpts.triple)}; if (targetTriple.isOSLinux()) { fortranOptions.predefinitions.emplace_back("__linux__", "1"); |
