[cfe-dev] Parsing clang++ output
Douglas Gregor
dgregor at apple.com
Wed Aug 24 11:37:39 PDT 2011
On Aug 22, 2011, at 8:39 PM, Ted Kremenek wrote:
>
> 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.
FWIW, -fdiagnostics-parseable-fixits is documented along with a few other "editor-parsing-friendly" diagnostics output flags at
http://clang.llvm.org/docs/UsersManual.html#cl_diag_formatting
- Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110824/3a00a08c/attachment.html>
More information about the cfe-dev
mailing list