Reapply [Tooling] Make clang-tool find libc++ dir on mac when running on a file without compilation database.

This reverts commit r351282, and re-lands r351222 and r351229 with the
use-after-free fixed.

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