[cfe-dev] Libclang and Objective-C headers

David Chisnall csdavec at swan.ac.uk
Sat Jan 1 14:44:28 PST 2011


On 1 Jan 2011, at 22:38, Ted Kremenek wrote:

> 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?


For one thing, I want to perform syntax highlighting on the header - including it would make that vastly more complicated because I'd have to create two translation units per header and track them independently.  

I'm not sure what you mean by 'less meaning' either.  There is no semantic difference between a header and a one-line source file that just includes that header, as a compilation unit.  Neither C, C++, nor Objective-C makes any differentiation between source files and header files - they're purely programmer a convention, as is the file extension given to source files, so libclang should not really be treating them differently.  If someone chooses to name their source files .cplusplus or .objectivec then this should work as well, as long as a language is specified (although, going back to my original point, libclang apparently refuses to accept -x flags, and I don't know why).

David

--
This email complies with ISO 3103





More information about the cfe-dev mailing list