Make clang/test/Index/pch-from-libclang.c pass in more places
authorNico Weber <nicolasweber@gmx.de>
Thu, 31 Jan 2019 22:15:32 +0000 (22:15 +0000)
committerNico Weber <nicolasweber@gmx.de>
Thu, 31 Jan 2019 22:15:32 +0000 (22:15 +0000)
commit0abcafd8a48ddfcf80b41c20810d6f44de58fc24
tree0fab38bb6304df4c9377f5a8808e7e53d5a61926
parent8f6182f7f669f21e90ad7920a7e911f0444c9da9
Make clang/test/Index/pch-from-libclang.c pass in more places

- fixes the test on macOS with LLVM_ENABLE_PIC=OFF
- together with D57343, gets the test to pass on Windows
- makes it run everywhere (it seems to just pass on Linux)

The main change is to pull out the resource directory computation into a
function shared by all 3 places that do it. In CIndexer.cpp, this now works no
matter if libclang is in lib/ or bin/ or statically linked to a binary in bin/.

Differential Revision: https://reviews.llvm.org/D57345

llvm-svn: 352803
clang/include/clang/Driver/Driver.h
clang/lib/Driver/Driver.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/Index/pch-from-libclang.c
clang/tools/libclang/CIndexer.cpp