[cfe-dev] Is it possible to get static analyzer fixits via libclang?

Dan Walmsley via cfe-dev cfe-dev at lists.llvm.org
Thu May 25 00:43:50 PDT 2017


Thanks for the reply, my usage scenario is for ide integration rather than an end user. I understand that not all checks emit visits, but for those that do how does xcode capture this information?



Sent from my Windows 10 phone



From: Artem Dergachev<mailto:noqnoqneo at gmail.com>
Sent: 25 May 2017 07:39
To: Dan Walmsley<mailto:dan at walms.co.uk>; cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>
Subject: Re: [cfe-dev] Is it possible to get static analyzer fixits via libclang?



Static analyzer doesn't currently produce fixits, because classes of
bugs it finds ("path-sensitive" bug reports that take a lot of different
source code locations into account, such as memory leak paths or null
dereference paths) are quite different in nature from normal warnings
issued by the compiler or lint tools like clang-tidy, and most of them
are very hard to reasonably fix automatically.


The analyzer also doesn't work when the translation unit has errors,
which seems to be your case (missing semicolon?).


I'd also hint that using the scan-build tool instead of adding --analyze
manually is usually easier for bigger projects.



On 5/24/17 11:37 PM, Dan Walmsley via cfe-dev wrote:
>
> Hi,
>
>
>    Is it possible to get the fixits that clang-tidy can produce, but
> via libclang?
>
>
> I tried adding the --analyze option when creating the translation
> unit, but I don't see any static analyser warnings and only fixit I
> have seen so far is to add missing semi colon.
>
>
> Thanks in advance
>
>
> Dan
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170525/3d822d0c/attachment.html>


More information about the cfe-dev mailing list