[cfe-dev] How to use libtooling to parse multiple files at once? and succesfully find stddef.h?

Manuel Klimek klimek at google.com
Sun Nov 3 09:47:48 PST 2013


On Wed, Oct 30, 2013 at 4:54 AM, rayjcwu <rayjcwu at gmail.com> wrote:

> Edwin Vane replied me says compilation database should be self contained.
> First I need to make sure the compile_commands.json is generated with using
> clang and I could use clang to build opencv.
>
> I set these environment variables
>
> export CC=/home/jcwu/repos/llvm-release/Release/bin/clang
> export CXX=/home/jcwu/repos/llvm-release/Release/bin/clang++
> export
>
> C_INCLUDE_PATH=/usr/local/include:/home/jcwu/repos/llvm-release/Release/lib/clang/3.4/include:/usr/include/x86_64-linux-gnu:/usr/include
> # these are from clang -v -c files.cpp
> export
>
> CPLUS_INCLUDE_PATH=/usr/local/include:/home/jcwu/repos/llvm-release/Release/lib/clang/3.4/include:/usr/include/x86_64-linux-gnu:/usr/include
>
> then regenerate compile_commands.json, it could find stddef.h but new issue
> comes up
>
> [ 31%] Building CXX object modules/ts/CMakeFiles/opencv_ts.dir/src/ts.cpp.o
> In file included from /home/jcwu/repos/opencv/modules/ts/src/ts.cpp:116:
> /usr/include/setjmp.h:60:12: error: conflicting types for '__sigsetjmp'
> extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask)
> __THROWNL;
>            ^
> /usr/include/pthread.h:727:12: note: previous declaration is here
> extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask)
> __THROW;
>            ^
> 1 error generated.
> make[2]: *** [modules/ts/CMakeFiles/opencv_ts.dir/src/ts.cpp.o] Error 1
> make[1]: *** [modules/ts/CMakeFiles/opencv_ts.dir/all] Error 2
> make: *** [all] Error 2
>
> I can't use clang to build opencv due to a type conflict or two system
> header files.
> Havne't figured out how to solve this.
>

Well, if you cannot use clang to build your code, you cannot use libtooling
to parse it (or am I misunderstanding something?)

Cheers,
/Manuel


>
>
>
> --
> View this message in context:
> http://clang-developers.42468.n3.nabble.com/How-to-use-libtooling-to-parse-multiple-files-at-once-and-succesfully-find-stddef-h-tp4035389p4035422.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131103/c8c80c33/attachment.html>


More information about the cfe-dev mailing list