[clang] [libc] [flang] [lldb] [libcxx] [llvm] [lld] [clang-tools-extra] [OpenACC] Initial commits to support OpenACC (PR #70234)
Bruno Cardoso Lopes via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 1 16:48:00 PDT 2023
================
@@ -605,6 +605,17 @@ static void InitializeStandardPredefinedMacros(const TargetInfo &TI,
Builder.defineMacro("HIP_API_PER_THREAD_DEFAULT_STREAM");
}
}
+
+ if (LangOpts.OpenACC) {
+ // FIXME: When we have full support for OpenACC, we should set this to the
+ // version we support. Until then, set as '1' by default, but provide a
+ // temporary mechanism for users to override this so real-world examples can
+ // be tested against.
+ if (!LangOpts.OpenACCMacroOverride.empty())
+ Builder.defineMacro("_OPENACC", LangOpts.OpenACCMacroOverride);
+ else
+ Builder.defineMacro("_OPENACC", "1");
----------------
bcardosolopes wrote:
This probably deserves a test akin to `-E -dM` and FileCheck for the macro.
https://github.com/llvm/llvm-project/pull/70234
More information about the cfe-commits
mailing list