[PATCH] D113992: [fir] Add fir.string_lit conversion

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 16 08:08:49 PST 2021


awarzynski accepted this revision.
awarzynski added a comment.
This revision is now accepted and ready to land.

LG, thanks!



================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:477-496
+    if (attr.isa<mlir::StringAttr>()) {
+      rewriter.replaceOpWithNewOp<mlir::LLVM::ConstantOp>(constop, ty, attr);
+    } else {
+      auto arr = attr.cast<mlir::ArrayAttr>();
+      auto charTy = constop.getType().cast<fir::CharacterType>();
+      unsigned bits = lowerTy().characterBitsize(charTy);
+      mlir::Type intTy = rewriter.getIntegerType(bits);
----------------
[nit] `else` is not really required.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113992



More information about the llvm-commits mailing list