[cfe-dev] Clang static analyzer

Billy Araujo via cfe-dev cfe-dev at lists.llvm.org
Fri May 29 07:12:52 PDT 2020


Thanks Artem. I will try that.


On Fri, May 29, 2020 at 1:13 PM Artem Dergachev <noqnoqneo at gmail.com> wrote:

> I never tried this but what you're doing is clearly not sufficient.
> SetUpStaticAnalyzer only asks the preprocessor to act as if the static
> analyzer is eventually going to be run.
>
> You should start with making sure your action is AnalysisAction. You can
> probably use clang-check as an example.
>
> On 5/28/20 8:53 PM, Billy Araujo via cfe-dev wrote:
> > Hi All,
> >
> > In my clang tool I setup the static analyzer using the following code:
> > But I am not sure if this is sufficient. I don't see any analyzer
> > messages in the output. Is there any way to test if it is active?
> >
> >
> > bool runInvocation(std::shared_ptr<clang::CompilerInvocation>
> > invocation, clang::FileManager* files,
> > std::shared_ptr<clang::PCHContainerOperations> PCHContainerOps,
> > clang::DiagnosticConsumer* diagConsumer) override
> > {
> > invocation->getPreprocessorOpts().SetUpStaticAnalyzer = true;
> > return
> > clang::tooling::FrontendActionFactory::runInvocation(invocation,
> > files, PCHContainerOps, diagConsumer);
> > }
> >
> > _______________________________________________
> > cfe-dev mailing list
> > cfe-dev at lists.llvm.org
> > https://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/20200529/7028ad1b/attachment.html>


More information about the cfe-dev mailing list