labath added a comment.

Trying to be smart while being lazy and multithreaded is going to make the code 
complicated (possibility for bugs) and/or introduce a lot of locking overhead.

A lot simpler solution is to let the caller decide if it want's the full CU or 
just the root DIE, and then make it hard for him to get this wrong. This 
shouldn't be too much to ask, as that's  pretty much what we have now, without 
the second part. The second part can be achieved by changing the 
`GetUnitDIEOnly` function to return a different type, say `DWARFBasicDIE` which 
does not even have child accessor functions. Then DWARFDIE can inherit from 
that and add the extra child/parent accessor methods. This way it will be 
impossible to get it wrong as you'll get a compile error if you try to access 
the children of a unit-only die.


https://reviews.llvm.org/D46810



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

Reply via email to