[flang-commits] [PATCH] D89017: [flang] Allow "name: value" in compiler directives

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Oct 8 10:02:22 PDT 2020


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3e86eda18c37: [flang] Allow "name: value" in compiler directives (authored by klausler).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89017

Files:
  flang/lib/Parser/Fortran-parsers.cpp
  flang/test/Parser/compiler-directives.f90


Index: flang/test/Parser/compiler-directives.f90
===================================================================
--- flang/test/Parser/compiler-directives.f90
+++ flang/test/Parser/compiler-directives.f90
@@ -9,4 +9,8 @@
   !dir$ integer
   implicit integer(a-z)
   !dir$ integer
+  !dir$ integer=64
+  !dir$ integer = 64
+  !dir$ optimize:1
+  !dir$ optimize : 1
 end
Index: flang/lib/Parser/Fortran-parsers.cpp
===================================================================
--- flang/lib/Parser/Fortran-parsers.cpp
+++ flang/lib/Parser/Fortran-parsers.cpp
@@ -1172,11 +1172,11 @@
 constexpr auto ignore_tkr{
     "DIR$ IGNORE_TKR" >> optionalList(construct<CompilerDirective::IgnoreTKR>(
                              defaulted(parenthesized(some("tkr"_ch))), name))};
-TYPE_PARSER(
-    beginDirective >> sourced(construct<CompilerDirective>(ignore_tkr) ||
-                          construct<CompilerDirective>("DIR$" >>
-                              many(construct<CompilerDirective::NameValue>(
-                                  name, maybe("=" >> digitString64))))) /
+TYPE_PARSER(beginDirective >>
+    sourced(construct<CompilerDirective>(ignore_tkr) ||
+        construct<CompilerDirective>(
+            "DIR$" >> many(construct<CompilerDirective::NameValue>(name,
+                          maybe(("="_tok || ":"_tok) >> digitString64))))) /
         endDirective)
 
 TYPE_PARSER(extension<LanguageFeature::CrayPointer>(construct<BasedPointerStmt>(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89017.297007.patch
Type: text/x-patch
Size: 1473 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20201008/9ab5a081/attachment.bin>


More information about the flang-commits mailing list