[PATCH] D94516: [flang][driver] Add standard predefinitions
Andrzej Warzynski via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 15 09:12:28 PST 2021
awarzynski added a comment.
Thank you for working on this @FarisRehman !
@FarisRehman Re `__X86_64__`, in my opinion it is too early for any target-specific predefinitions and I suggest that we remove it for now. Lets revisit in the future when code-generation is supported.
@sameeranjoshi How does it sound? I totally agree with you that once we start adding such predefinitions, we should provide a solution that will support multiple architectures.
================
Comment at: flang/lib/Frontend/CompilerInvocation.cpp:263
+
+ // Populate macro list with version numbers and other predefinitions.
+ fortranOptions.predefinitions.emplace_back("__flang__", "1");
----------------
[nit] IMO this is fine for now, but long term the list of standard predefinitions is likely to grow significantly. Could add a TODO here? e.g.
```
// TODO: When expanding this list of standard predefinitions, consider creating a dedicated API for this. Also, at some point we will need to differentiate between different targets.
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94516/new/
https://reviews.llvm.org/D94516
More information about the llvm-commits
mailing list