Skip to content

Commit

Permalink
Add __amdflang__ define to identify compiler as AMD Flang (llvm#174)
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
mjklemm authored Oct 2, 2024
1 parent 8dcf281 commit 31ffc5f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions flang/lib/Frontend/CompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1465,6 +1465,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);
Expand Down

0 comments on commit 31ffc5f

Please sign in to comment.