[cfe-dev] CompilerInstance and setting compiler options

Alex L via cfe-dev cfe-dev at lists.llvm.org
Mon Nov 7 04:01:39 PST 2016


I think that you can use `clang::createInvocationFromCommandLine` to parse
your compiler arguments into an instance of CompilerInvocation. Then you
can call `CompilerInstance::setInvocation` to update the invocation in your
compiler instance.

I hope that helps,
Alex

On 7 November 2016 at 10:41, peter jacobsen via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi,
>
> I am developing a static analyzer using clang.  I setup a
> CompilerInstance, ASTConsumer etc. as copied from a number of examples.  I
> would like to know how to set compiler options.  In particular I would like
> to suppress 'warning: expression result unused'  (-Wunused-value)
>
> Thanks,
>
> peter
>
> _______________________________________________
> 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/20161107/6733af34/attachment.html>


More information about the cfe-dev mailing list