[PATCH] Remove pimpl class from PassRegistry.

David Blaikie dblaikie at gmail.com
Wed Jun 11 17:31:23 PDT 2014

Comment at: include/llvm/PassInfo.h:1
@@ +1,2 @@
+//===- llvm/PassInfo.h - Pass Info class ------------------------*- C++ -*-===//
Zachary Turner wrote:
> David Blaikie wrote:
> > I take it you had to split this out to resolve a dependency that wasn't exposed when everything was pmpld away?
> Yes, I actually updated the description on Phab, but it didn't send out an email notification for that.  Basically, the pimpl has a unique_ptr<PassInfo>, and PassSupport.h already includes PassRegistry.h, so I couldn't have PassRegistry.h include PassSupport.h to get this class.
> Plus, one class-one file is just better when the classes are non-trivial :)
Yep - that's what I figured. Just checking.

In theory if the ctor and dtor are out of line, a forward declaration should still be sufficient for the unique_ptr<PassInfo> member to be declared (if the dtor or ctor are inline, then they'd need to emit unique_ptr's dtor which would need to emit a call to PassInfo's dtor, etc...) but as you say, better to pull it into a separate file anyway, and include it in the right places. Looks good.


More information about the llvm-commits mailing list