[PATCH] D138934: mlir/tblgen: use std::optional in generation

Ramkumar Ramachandra via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 06:41:37 PST 2022


artagnon marked 2 inline comments as done.
artagnon added inline comments.


================
Comment at: mlir/lib/Dialect/Shape/IR/Shape.cpp:1337
     return nullptr;
-  Optional<int64_t> dim = getConstantDim();
+  auto dim = getConstantDim();
   if (!dim.has_value())
----------------
clementval wrote:
> artagnon wrote:
> > jpienaar wrote:
> > > Why couldn't this be std::optional<int64_t> ?
> > It could very well be. I suppose it's a matter of style: personally, I prefer `auto` to make the code less brittle to changes.
> `std::optional<int64_t>` seems better here (https://llvm.org/docs/CodingStandards.html#use-auto-type-deduction-to-make-code-more-readable)
Fixed now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138934



More information about the llvm-commits mailing list