[cfe-dev] clang analysis program in dram rather in file

Manuel Klimek klimek at google.com
Sat Oct 5 06:51:15 PDT 2013


On Tue, Sep 24, 2013 at 9:33 PM, Xiuxia <zhangxiuxia1 at gmail.com> wrote:

> Hi All,
>        I am writing a simple OpenCL program function parser  which get the
> the qualifier of parameter,
> like _global, __constant.
>        I have a problem here, I implemented this by modifying a clang
> sample. I saw most sample get input from files. Due to  the project
> property, the source file is already in a char * array.
> Now I implemented a version: First  output data from array to a file ,and
> then use sourceManager to load file into memory again. I think there should
> be overhead by doing this, but I don't know how to do with other method.
>
> I don't know which class or interface should I use , can anyone help me ?
>

Clang supports the idea of "virtual files", which you can inject via the
SourceManager. You can find some samples of how to use those throughout the
code base...

Cheers,
/Manuel


>
>
>
>
>
> --
> View this message in context:
> http://clang-developers.42468.n3.nabble.com/clang-analysis-program-in-dram-rather-in-file-tp4034649.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131005/ba9d723f/attachment.html>


More information about the cfe-dev mailing list