Use std::unique_ptr in a few methods that take ownership.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215864 91177308-0d34-0410-b5e6-96231b3b80d8
Create a std::unique_ptr earlier.

Thanks to David Blaikie for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215865 91177308-0d34-0410-b5e6-96231b3b80d8
Use the pointer-like API of ErrorOr.

Thanks to David Blaikie for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215866 91177308-0d34-0410-b5e6-96231b3b80d8
Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid needing to mention the size.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215869 91177308-0d34-0410-b5e6-96231b3b80d8