[cleanup] Factor out handling CC1 tools. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215759 91177308-0d34-0410-b5e6-96231b3b80d8
[cleanup] Range-for'ify this loop. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215760 91177308-0d34-0410-b5e6-96231b3b80d8
[cleanup] Rename this function to better reflect its purpose. NFC.

This also suggests some refactoring to simplify this code. Basically, a
ton of complexity in this argument handling code comes from the need to
save const char *'s in stable storage for pushing onto argv.
It seems like llvm::cl::StringSaver can be improved to cover all the
needs here.

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