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

================
Comment at: include/lldb/Symbol/FuncUnwinders.h:117
+  class LazyPlan {
+    lldb::UnwindPlanSP m_plan_sp;
+
----------------
clayborg wrote:
> clayborg wrote:
> > labath wrote:
> > > clayborg wrote:
> > > > maybe use:
> > > > 
> > > > ```
> > > > llvm::Optional<lldb::UnwindPlanSP> m_plan_sp;
> > > > ```
> > > > 
> > > > Then just check if it has no value, and if so compute and set it either 
> > > > to a valid shared pointer or an empty one?
> > > That would work, but it would increase the size of the FuncUnwinders 
> > > struct by about 80 bytes (8 bytes for each LazyPlan object). I can do 
> > > that, but given that "uncomputed value" trick is internal to the class 
> > > and does not leak out or affect the implementation, it seemed like a 
> > > worthwhile optimization to me.
> > Actually isn't there a pointer union class that can steal bool bits from 
> > the aligned values and not increase the size?
> I believe the clang type system steals 3 bits from a Type * to encode "const" 
> and a few other type qualifiers
Yes, there is a `llvm::PointerIntPair`, but AFAICT that only works with a raw 
pointer, not a shared_ptr. I believe implementing a similar trick for 
shared_ptr would be possible, but it would definitely be tricky. Way more 
trickier than this..


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

https://reviews.llvm.org/D61779



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to