alexfh added a comment.

In http://reviews.llvm.org/D16535#362761, @xazax.hun wrote:

> In http://reviews.llvm.org/D16535#362726, @alexfh wrote:
>
> > I think, the check can be submitted as is and guards against spurious 
> > errors on invalid AST can be added as a follow up.
>
>
> This check is already submitted.


Yup, /me needs to sleep more ;)

> However I did not found any API in tidy to check whether the compilation 
> failed. It would be great to be able to query that information at the time of 
> registering matchers.


This information is not available when registering matchers, since this happens 
before parsing. You can use `isInvalidDecl()` to check whether particular 
declaration had any errors, or 
`Result.Context->getTranslationUnitDecl()->isInvalidDecl()` to check the whole 
translation unit.

> I have one more question though: does it make sense to run clang tidy at all, 
> when the compilation failed? Isn't it a better default behaviour to not to 
> run any of the checks in that case?


There are some valid use cases for running checks on a non-compilable code, 
e.g. editor integration.


Repository:
  rL LLVM

http://reviews.llvm.org/D16535



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to