[cfe-dev] Fundamental libclang question on architecture support

Seth Willits slists at araelium.com
Sat Dec 10 19:01:06 PST 2011


I'm in the early stages of a new application with some C code parsing requirements and really want to use libclang's amaaazingly friendly API. However, I have a fundamental question on whether this will work as I need. The platform this code is destined for isn't supported by clang, so I couldn't actually compile it, but all I'm looking to do is correctly parse it.

The thought that occurred to me is, if I can't pass -arch MYPLATFORM, then many of the architecture-dependent macros (such as __BIG_ENDIAN__, _LP64, or whatever they may be) wouldn't be defined properly and could lead to incorrect parsing/diagnostics etc. So what's the correct workaround for this? Perhaps I can simply use -D to define them as they should be when parsing the translation unit? Something else? Can I use libclang at all?


Thanks,

--
Seth Willits







More information about the cfe-dev mailing list