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

Peter Collingbourne peter at pcc.me.uk
Tue Nov 9 20:59:22 PST 2010


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