This is an archive of the discontinued LLVM Phabricator instance.

Make clang/test/Index/pch-from-libclang.c pass in more places
ClosedPublic

Authored by thakis on Jan 28 2019, 11:17 AM.

Details

Summary
  • 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/.

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman: ping?

erik.pilkington, can you take a look? Looks like arphaman isn't around. Since this touches libclang, I figure it might make sense if one of you takes a look.

erik.pilkington resigned from this revision.Jan 31 2019, 8:49 AM

Sorry, this really seems more like @arphaman's wheelhouse. I'll ping him to take a look though.

arphaman accepted this revision.Jan 31 2019, 10:29 AM

Makes sense. The comments aren't really enforceable though, can we just factor this out into one function in lib/Basic that can be shared between all sites? It seems like there's nothing that would prevent that.

This revision is now accepted and ready to land.Jan 31 2019, 10:29 AM
arphaman requested changes to this revision.Jan 31 2019, 10:30 AM
This revision now requires changes to proceed.Jan 31 2019, 10:30 AM

Could it be somewhere in lib/Driver? libclang depends on lib/Frontend which depends on lib/Driver -- is there any reason libclang can't depend on lib/Driver?

Yes, that should work.

thakis updated this revision to Diff 184593.Jan 31 2019, 1:26 PM
thakis edited the summary of this revision. (Show Details)

shared function

This revision is now accepted and ready to land.Jan 31 2019, 1:30 PM
This revision was automatically updated to reflect the committed changes.
sbc100 added a subscriber: sbc100.Jan 31 2019, 5:27 PM

I think this broke the BUILD_SHARED_LIBS build: https://reviews.llvm.org/D57556

Herald added a project: Restricted Project. · View Herald TranscriptJan 31 2019, 5:27 PM