I have been looking through the Clang source code and I found this snippet:
void CompilerInstance::setInvocation( std::shared_ptr
By using move you avoid increasing, and then immediately decreasing, the number of shares. That might save you some expensive atomic operations on the use count.
move