[flang-commits] [PATCH] D84334: Version information in flang/f18

Camille Coti via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Jul 22 14:39:35 PDT 2020


coti marked 2 inline comments as done and an inline comment as not done.
coti added a comment.

Answered some inline comments.



================
Comment at: flang/tools/f18/f18.cpp:410
   Fortran::parser::Options options;
-  options.predefinitions.emplace_back("__F18", "1");
-  options.predefinitions.emplace_back("__F18_MAJOR__", "1");
-  options.predefinitions.emplace_back("__F18_MINOR__", "1");
-  options.predefinitions.emplace_back("__F18_PATCHLEVEL__", "1");
+  options.predefinitions.emplace_back("__F18", "12.0.0");
+  options.predefinitions.emplace_back("__F18_MAJOR__", "12");
----------------
sscalpone wrote:
> Cmake has the capability to generate files, usually taking a "foo.in" and creating a "foo" with macro substitution.  Is that technique possible for the version numbers?  
Yes it is! Should I "update diff" to show it?


================
Comment at: flang/tools/f18/f18.cpp:414
+  options.predefinitions.emplace_back("__F18_PATCHLEVEL__", "0");
+  options.predefinitions.emplace_back("__FLANG", "12.0.0");
+  options.predefinitions.emplace_back("__FLANG_MAJOR__", "12");
----------------
klausler wrote:
> The older flang compiler reportedly defines `__FLANG`.  If so, it might be a bad idea to also define `__FLANG` in this newer flang compiler,; how would conditionally compiled code distinguish one flang compiler from the other?
So I have a question here: what is the rule regarding compatibility between old and new flang? I came across situations where I needed these because I tried to compile software that knew the old flang and used these values.


================
Comment at: flang/tools/f18/f18.cpp:390
+int printVersion(){
+  llvm::errs() << "\nf18 compiler (under development)\n";
+  return exitStatus;
----------------
AlexisPerry wrote:
> Should we use "flang" instead of "f18" to better align with the project's name?
Good question. I left the original message, I let senior developers make a decision here.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D84334/new/

https://reviews.llvm.org/D84334





More information about the flang-commits mailing list