[PATCH] D113295: [flang] Transform `fir.end` to an empty statement

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 8 02:19:21 PST 2021


awarzynski marked 3 inline comments as done.
awarzynski added inline comments.


================
Comment at: flang/include/flang/Optimizer/Dialect/FIROps.td:812
+
+  let parser = "return mlir::success();";
 }
----------------
mehdi_amini wrote:
> mehdi_amini wrote:
> > You need this to be able to parse the "pretty" form. But do you need one?
> If you ever need a trivial custom form in the future, the preferred way would be to write it as `let assemblyFormat = "attr-dict-with-keyword";`
> 
> The assemblyFormat makes sure that you don't forget elements, like the optional dictionary of attributes here :)
> 
> 
> You need this to be able to parse the "pretty" form. But do you need one?

I don't think I do - thanks for pointing this out! :) 


================
Comment at: flang/test/Fir/convert-to-llvm.fir:331
+
+fir.end
+
----------------
mehdi_amini wrote:
> You could test it with just `"fir.end"() : () -> ()` and not define a custom parser.
> 
Ah, thanks! Yes, I will use that instead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113295



More information about the llvm-commits mailing list