[Lldb-commits] [PATCH] D51557: Replace uses of LazyBool with LazyBool template

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 11 07:35:04 PDT 2018


teemperor marked 4 inline comments as done.
teemperor added a comment.

(Phabricator didn't send my draft, sorry for the delay).

I have more similar patches coming up for the other uses of LazyBool, so I would prefer finishing the implementation in LLDB and then afterwards asking if the ADT folks want it. I moved this patch to LLVM code style to make this easier later on. Sounds good?

To add to @labath's points about performance: If we have the calc* functions as lambdas, then I would have to declare all these lambdas in the constructor, which doesn't look very nice.



================
Comment at: include/lldb/Utility/Lazy.h:25-28
+  T m_value;
+  bool m_needs_update;
+
+  static_assert(std::is_trivial<T>::value, "Only trivial types are supported.");
----------------
labath wrote:
> if you use `Optional<T>` instead of hand-rolling the flag here, you could probably get rid of the "trivial type" limitation.
Makes sense, thanks!


https://reviews.llvm.org/D51557





More information about the lldb-commits mailing list