[PATCH] D140098: [NFC] Use std::optional over llvm::Optional to implement MaybeAlign

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 06:37:57 PST 2022


gchatelet marked an inline comment as done.
gchatelet added inline comments.


================
Comment at: llvm/include/llvm/Support/Alignment.h:132
+  constexpr MaybeAlign(std::nullopt_t None) : UP(None) {}
+  constexpr MaybeAlign(Align Value) : UP(Value) {}
+  MaybeAlign(uint64_t Value) {
----------------
courbet wrote:
> `explicit`
As discussed offline it is always safe to create a `MaybeAlign` from an `Align`.
Thx for noticing that an `explicit` is missing on the line below though.


================
Comment at: llvm/lib/Support/OptimizedStructLayout.cpp:14
 #include "llvm/Support/OptimizedStructLayout.h"
+#include "llvm/ADT/Optional.h"
 
----------------
courbet wrote:
> Layering I guess ?
Yep...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140098



More information about the llvm-commits mailing list