[PATCH] D88267: Common code preparation for tblgen-types patch

Stephen Neuendorffer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 24 15:50:05 PDT 2020


jdd created this revision.
Herald added subscribers: llvm-commits, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, lucyrfox, mgester, arpith-jacob, antiagainst, shauheen, jpienaar, rriddle, mehdi_amini, hiraditya.
Herald added a reviewer: antiagainst.
Herald added projects: MLIR, LLVM.
stephenneuendorffer published this revision for review.
stephenneuendorffer added a comment.
Herald added a subscriber: nicolasvasilache.

Seems generally reasonable to me.



================
Comment at: llvm/lib/TableGen/Record.cpp:2244-2255
   const RecordVal *R = getValue(FieldName);
   if (!R || !R->getValue())
     PrintFatalError(getLoc(), "Record `" + getName() +
       "' does not have a field named `" + FieldName + "'!\n");
 
   if (StringInit *SI = dyn_cast<StringInit>(R->getValue()))
     return SI->getValue();
----------------
Probably this should now call getValueAsOptionalString?


================
Comment at: llvm/lib/TableGen/Record.cpp:2278
+    return llvm::Optional<StringRef>();
+
+  if (CodeInit *CI = dyn_cast<CodeInit>(R->getValue()))
----------------
No case for UnsetInit needed here?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88267

Files:
  llvm/include/llvm/TableGen/Record.h
  llvm/lib/TableGen/Record.cpp
  mlir/include/mlir/TableGen/CodeGenHelpers.h
  mlir/include/mlir/TableGen/Operator.h
  mlir/lib/TableGen/Operator.cpp
  mlir/tools/mlir-tblgen/DialectGen.cpp
  mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88267.294192.patch
Type: text/x-patch
Size: 9059 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200924/1d1218f8/attachment.bin>


More information about the llvm-commits mailing list