Investigate nicer Xcode integration
(Related to #5)
Can the plugin add only the key path warnings, instead of overwriting all diagnostics?
Can we compile / run the verification as a separate pass without the rest of clang?
Can the plugin add only the key path warnings, instead of overwriting all diagnostics?
Yes, you should use -add-plugin instead of -plugin.
Can the plugin add only the key path warnings, instead of overwriting all diagnostics?
Yes, you should use
-add-plugininstead of-plugin.
Sorry, I was unclear. The script as-is generates clang's regular warnings in addition to the ones added by the plugin. However, the "regular" warnings don't always match those generated by Xcode's bundled clang. In particular, -Wunused-property-ivar fires too often; this commit isn't in RELEASE_34, but is in Apple's clang. Hence this ugly hack to disable it.
When Xcode invokes clang, it asks it to serialize diagnostics to a file. On each invocation that file is overwritten by the compiler, so the secondary clang need to re-emit the same diagnostics a second time, with the caveat above. Instead, it would be much better to just append the new warnings to the serialized diagnostics file.
Currently, the header notes this is non-appending, but there is also API to load diagnostics, so maybe we can read it in, and re-emit them along with our own. Or make the file append-able, and submit a patch to clang.
I've got your point, now it's clear!