[Lldb-commits] [PATCH] D40212: refactor: Unify+simplify DWARFCompileUnit ctor+Clear() into in-class initializers

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Nov 19 10:44:39 PST 2017

clayborg added a comment.

In https://reviews.llvm.org/D40212#929740, @jankratochvil wrote:

> In https://reviews.llvm.org/D40212#929716, @clayborg wrote:
> > Good change in the header file.
> If you mean the in-class initializers they obviously cannot be used without the in-place construction+destruction as they would stay duplicate to the Clear() method.
> OK if you are also uncomfortable with it I will keep Clear() as is and just call Clear() from the ctor to unify it at least a bit.

Or we can get rid of Clear(), make the constructor private and make DWARFCompileInit::Extract be static and return a shared pointer as suggested in your other patch. I doubt many compile units fail to construct so we can just avoid the Clear() call all together and keep the initialization in the header file. Let me know


More information about the lldb-commits mailing list