[cfe-dev] Circumventing ExecuteAction's initialization of SourceManager instance

Garrison Venn gvenn.cfe.dev at gmail.com
Wed Nov 10 03:35:37 PST 2010


FYI, in trunk it looks like they got rid of CompilerInvocation::setLangDefaults, and
replaced your usage with:

(CI->getLangOpts()).OpenCL = 1;

Thanks again, the code mod motivated by your code worked great.

Garrison

On Nov 9, 2010, at 23:59, Peter Collingbourne wrote:

> On Tue, Nov 09, 2010 at 08:58:48PM -0500, Garrison Venn wrote:
>> I'm trying to switch from using ParseAST to CompilerInstance::ExecuteAction when
>> operating on memory buffers initialized with a code string.
> 
> Hi Garrison,
> 
> The way I handle this is to use PreprocessorOpts::addRemappedFile to
> set up a mapping from a source code "file" name to the memory buffer
> (which is really a dummy file name that shows up in diagnostics etc).
> I then add that name to the input list.  You can see my source
> code here:
> 
> http://git.pcc.me.uk/?p=~peter/klee-fp.git;a=blob;f=lib/Core/SpecialFunctionHandler.cpp;h=12366319f85110634e2267ddb221050485b4e717;hb=HEAD#l815
> (in particular lines 815-816 and 818)
> 
> Thanks,
> -- 
> Peter





More information about the cfe-dev mailing list