[PATCH] D110929: [fir][NFC] Move fir.global printer to cpp file

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 4 01:26:01 PDT 2021


clementval added a comment.

In D110929#3037320 <https://reviews.llvm.org/D110929#3037320>, @mehdi_amini wrote:

> Can this be converted to declarative assembly instead?

This one is not trivial to convert to assembly format at least not in the current form.



================
Comment at: flang/lib/Optimizer/Dialect/FIROps.cpp:1186
+    p << '(' << val << ')';
+  if (op.getOperation()->getAttr(fir::GlobalOp::getConstantAttrName()))
+    p << " constant";
----------------
mehdi_amini wrote:
> ODS generates already an accessor `constantAttrName` (same for all other attributes) which returns an Identifier (and so allows for pointer comparison instead of strcmp). 
Ok. It's a member function right? How to how access the attribute name in the parser? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110929



More information about the llvm-commits mailing list