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

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 4 12:57:53 PDT 2021


mehdi_amini added inline comments.


================
Comment at: flang/lib/Optimizer/Dialect/FIROps.cpp:1186
+    p << '(' << val << ')';
+  if (op.getOperation()->getAttr(fir::GlobalOp::getConstantAttrName()))
+    p << " constant";
----------------
clementval wrote:
> 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? 
Oh right, the parser won't have access to it since it get initialized in the AbstractOperation IIRC


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