[cfe-dev] Libclang and Objective-C headers
kremenek at apple.com
Sat Jan 1 14:38:19 PST 2011
Header files inherently have less meaning until they are actually included. How about create a fake t.m that includes the header, and analyze that?
On Dec 31, 2010, at 9:47 AM, David Chisnall <csdavec at swan.ac.uk> wrote:
> I'm trying to use libclang to gather information about Objective-C headers. Unfortunately, clang appears to default to C for .h files (probably sensible) and to refer to ignore -x options passed in to clang_createTranslationUnitFromSourceFile() and clang_parseTranslationUnit().
> Is there an existing way of overriding the default language choice when parsing headers (I assume that the XCode people needed this for editing Objective-C headers?), and if so what is it?
> Alternatively, would it be possible for libclang to automatically detect the language of header files? It's relatively easy to tell C[++] and Objective-C[++] apart (spot an #import or an @-keyword anywhere), but telling C and C++ apart is probably a bit harder.
> -- Sent from my STANTEC-ZEBRA
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
More information about the cfe-dev