Currently it's possible to take a T* and cast it to a U* using llvm's casting mechanics, but it's not possible to take a std::unique_ptr<T> and cast it to a std::unique_ptr<U> even if they are compatible. This patch adds this functionality.
I tried to modify the cast macros as well as the dyn_cast macros, but honestly the template mechanics started getting a little hairy and I wasn't able to get it working. Upon further reflection, I decided that maybe we don't even want that behavior anyway, since if T is not a U, then no good can possibly come of casting it to one in the face of unique_ptr's RAII semantics. So hopefully I can get this in without adding cast<>() functionality, and then if/when someone actually needs cast functionality in the future, they can revisit this.