[flang-commits] [flang] [lld] [libcxx] [clang] [libc] [lldb] [llvm] [clang-tools-extra] [OpenACC] Initial commits to support OpenACC (PR #70234)

Alexey Bataev via flang-commits flang-commits at lists.llvm.org
Mon Nov 13 08:49:23 PST 2023


================
@@ -3633,6 +3633,22 @@ static void RenderHLSLOptions(const ArgList &Args, ArgStringList &CmdArgs,
     CmdArgs.push_back("-finclude-default-header");
 }
 
+static void RenderOpenACCOptions(const Driver &D, const ArgList &Args,
+                                 ArgStringList &CmdArgs, types::ID InputType) {
+  if (!Args.hasArg(options::OPT_fopenacc))
+    return;
+
+  CmdArgs.push_back("-fopenacc");
+
+  if (Arg *A = Args.getLastArg(options::OPT_openacc_macro_override)) {
+    StringRef Value = A->getValue();
+    if (llvm::find_if_not(Value, isdigit) == Value.end())
+      A->renderAsInput(Args, CmdArgs);
+    else
+      D.Diag(diag::err_drv_clang_unsupported) << Value;
----------------
alexey-bataev wrote:

```suggestion
    if (Value.getAsInteger(10, Version))
      A->renderAsInput(Args, CmdArgs);
    else
      D.Diag(diag::err_drv_clang_unsupported) << Value;
```

https://github.com/llvm/llvm-project/pull/70234


More information about the flang-commits mailing list