classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view


Hubert Tong via cfe-dev

I maintain ffi-clang for Ruby.

We recently started reworking the gem to support llvm 10.0 - the last
supported release was llvm 4.0 which was a while ago.

So, most things seem to be working fine - we have several hundred
tests. However, I had some trouble with `clang_parseTranslationUnit`.

It seems like it's not picking up the system include directories.

We have the following code to parse a translation unit:

let(:filename) { fixture_path("completion.cpp") }
let(:translation_unit) { }

`parse_translation_unit` basically calls clang_parseTranslationUnit

But, in llvm 4.0, it seems this automatically detected file type and
exposed stdc++ headers. But with llvm 10.0 - it seems I need to
manually add header search paths. Doing something like the following

let(:includes) {[
let(:translation_unit) {,
[*includes]) }

I don't know if there is a better set of arguments to pass to
`clang_parseTranslationUnit` that behaves the same was as before i.e.
implicitly figures out what include paths to use.

By the way, I figured out what include paths to use by running:

echo "" | clang++ -v -x c++ -E -

So, it's definitely the case that at least `clang++` knows where those
headers are.

cfe-dev mailing list
[hidden email]