Skip to content

Commit 31ffc5f

Browse files
authored
Add __amdflang__ define to identify compiler as AMD Flang (llvm#174)
The current compiler version identifies itself as a Flang compiler: ``` #define __flang__ 1 #define __flang_major__ 20 #define __flang_minor__ 0 #define __flang_patchlevel__ 0 ``` This PR adds the following define to the list: ``` #define __amdflang__ 1 ```
1 parent 8dcf281 commit 31ffc5f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

flang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1465,6 +1465,7 @@ void CompilerInvocation::setDefaultPredefinitions() {
14651465
auto &fortranOptions = getFortranOpts();
14661466
const auto &frontendOptions = getFrontendOpts();
14671467
// Populate the macro list with version numbers and other predefinitions.
1468+
fortranOptions.predefinitions.emplace_back("__amdflang__", "1");
14681469
fortranOptions.predefinitions.emplace_back("__flang__", "1");
14691470
fortranOptions.predefinitions.emplace_back("__flang_major__",
14701471
FLANG_VERSION_MAJOR_STRING);

0 commit comments

Comments
 (0)