From cef5f026ec047281631086340112c88e9f1c7422 Mon Sep 17 00:00:00 2001 From: Michael Klemm Date: Wed, 2 Oct 2024 14:21:38 +0200 Subject: [PATCH] Add __amdflang__ define to identify compiler as AMD Flang --- flang/lib/Frontend/CompilerInvocation.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 1aa7ce0589b754..ebcd074f9fffee 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -1456,6 +1456,7 @@ void CompilerInvocation::setDefaultPredefinitions() { auto &fortranOptions = getFortranOpts(); const auto &frontendOptions = getFrontendOpts(); // Populate the macro list with version numbers and other predefinitions. + fortranOptions.predefinitions.emplace_back("__amdflang__", "1"); fortranOptions.predefinitions.emplace_back("__flang__", "1"); fortranOptions.predefinitions.emplace_back("__flang_major__", FLANG_VERSION_MAJOR_STRING);