aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAndrew Gozillon <Andrew.Gozillon@amd.com>2023-03-07 12:39:16 -0600
committerAndrew Gozillon <Andrew.Gozillon@amd.com>2023-03-07 12:57:58 -0600
commite002a38b20e3ac40aecbbfa0774f8ba7b9690b0c (patch)
tree466d7e4b31b9028710ef011b85a09a55557b61f7 /flang/lib/Frontend/CompilerInvocation.cpp
parent284fcbb95a899228b99728e9d8960fc7a6c5c6ac (diff)
downloadllvm-e002a38b20e3ac40aecbbfa0774f8ba7b9690b0c.zip
llvm-e002a38b20e3ac40aecbbfa0774f8ba7b9690b0c.tar.gz
llvm-e002a38b20e3ac40aecbbfa0774f8ba7b9690b0c.tar.bz2
[Flang][OpenMP][MLIR][Driver][bbc] Add -fopenmp-is-device flag to Flang -fc1 & the bbc tool, and omp.is_device attribute
Adds the -fopenmp-is-device flag to bbc and Flang's -fc1 (but not flang-new) and in addition adds an omp.is_device attribute onto the module when fopenmp is passed, this is a boolean attribute that is set to false or true dependent on if fopenmp-is-device is specified alongside the fopenmp flag on the commandline when invoking flang or bbc. Reviewers: awarzynski kiranchandramohan Differential Revision: https://reviews.llvm.org/D144864
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index 4fb1eb8..d043444 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -670,6 +670,10 @@ static bool parseDialectArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
if (args.hasArg(clang::driver::options::OPT_fopenmp)) {
res.getFrontendOpts().features.Enable(
Fortran::common::LanguageFeature::OpenMP);
+
+ if (args.hasArg(clang::driver::options::OPT_fopenmp_is_device)) {
+ res.getLangOpts().OpenMPIsDevice = 1;
+ }
}
// -pedantic