[cfe-dev] Parsing clang++ output

Ted Kremenek kremenek at apple.com
Mon Aug 22 20:39:12 PDT 2011


On Aug 22, 2011, at 1:59 PM, Jonathan Sauer wrote:

>> I'd guess/bet that XCode doesn't parse clang's output. Judging by Ted's post on this ( http://llvm.org/bugs/show_bug.cgi?id=10696 ) bug I was just reading tihs morning, where he implies that the XCode is doing something correctly where the console output is incorrect - if XCode was parsing clang's text output it wouldn't have any hope of getting this right. Though I wouldn't know which builds that would be applicable to.
> 
> Oh. I guess things changed with XCode 4, when clang was integrated into the IDE as a plugin. XCode 3.2.6
> parses clang's output (at least that's my guess from looking into XCode's "Clang LLVM 1.0.xcspec" file).
> 

That's not quite correct.

Xcode 4 uses a clang dylib for syntax highlighting, code completion, and indexing.  As part of this, it also obtains "live issues" from clang through an API.

For compilation, Xcode 4 still uses the standalone compiler.  It passes a "special" flag, -fdiagnostics-parseable-fixits, which causes the text output of the compiler to include a "serialized" version of the FIXIT hints that is easy for an external tool to process.  That information includes essentially ranges of characters to insert and delete.  This is different from the *display* of FIXITs from Clang on the command line, which runs into the problems mentioned in 10696.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110822/c09e9e02/attachment.html>


More information about the cfe-dev mailing list