[cfe-dev] Force clang to disable preprocessing

Andrey Tarasevich tarasevich.andrey at googlemail.com
Sun Aug 14 16:25:32 PDT 2011


Hello!

Currently I'm parsing Linux kernel source code and want to do some source
code manipulations. I wanted to use clang for this, but in order to build
AST clang should first preprocess source code and this causes clang to
produce corrupted code in many cases, since kernel has lots of magic and not
trivial behaviour.
Is it possible to force clang disable preprocessing and make it think, that
source code is sane and thus build complete AST without macro and includes
expansion? I do understand, that this is not how compiler suppose to work,
but maybe there are any workarounds?

best regards,
Andrey Tarasevich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110815/41176723/attachment.html>


More information about the cfe-dev mailing list