[PATCH] D138934: mlir/tblgen: use std::optional in generation
Valentin Clement via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 7 06:55:33 PST 2022
clementval 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())
----------------
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)
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