[cfe-dev] Plugin argument parsing
daniel at zuster.org
Mon Aug 2 10:32:19 CDT 2010
I changed the API to pass in the CompilerInstance to ParseArgs, you
can use that to report diagnostics. If you want to abort execution,
you can return false from the ParseArgs function. See
includes an update to the PrintFunctionNames example.
On Sun, Aug 1, 2010 at 10:09 AM, Jan Bierbaum
<s3306700 at inf.tu-dresden.de> wrote:
> Is there a way to access Clang's Diagnostic from inside the ParseArgs
> function of a plugin? I tried to grab it via the CompilerInstance but at
> that time getCompilerInstance fails since the instance isn't set yet.
> It would be good to get errors/warnings during the argument parsing out
> through Clang's Diagnostic so they count in the total.
> Another issue: How do I terminate Clang once a fatal error occurs during
> the parsing, e.g. some essential information is missing. Returning
> 'false' doesn't do the trick. In fact the return value is just dropped
> by Clang. So I just do an 'exit(1)' which works fine. Are there any
> problems this can cause, like inconsistent state somewhere?
> Regards, Jan.
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
More information about the cfe-dev