labath added a comment.

I don't agree with the two-stage initialization of the MinidumpParser class 
being introduced here. We deliberately introduced the `Create` static function 
to avoid this. If this `Initialize` function in checking invariants which are 
assumed to be hold by other parser methods, then it should be done by the 
`Create` function. Ideally this would be done before even constructing the 
parser object, but if this is impractical for some reason then you can make the 
`Initialize` function private and call it directly from `Create`. This way a 
user will never be able to see an malformed parser object. To make sure you 
propagate the error, you can change the return type of `Create` to 
`llvm::Expected<MinidumpParser` (the only reason we did not do this back then 
was that there was no precedent for using `Expected` in LLDB, but this is no 
longer the case).


Repository:
  rL LLVM

https://reviews.llvm.org/D49202



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

Reply via email to