[cfe-commits] clang formatter patch to move and rename RewriterTestContext.h

jahanian fjahanian at apple.com
Tue Dec 18 09:49:31 PST 2012


On Dec 18, 2012, at 12:54 AM, Manuel Klimek <klimek at google.com> wrote:

>> 
>> So, to summarize what I said in an earlier mail, I would propose the following (if we decide we really want something along those lines):
>> - come up with an interface that clients like libclang would need; from what I can see that would be putting together all the dependencies of the Rewriter into an easy-to-instantiate bundle and having a covenience method to create an in-memory file on the source manager (from what I saw the proposed change does not use all the temp file magic, which is both the most brittle and what I don't expect anything bu the test to use)
>> - put that into a decently named class in Rewrite/; perhaps RewriterDependencies, or RewriterContext, or VirtualRewriterContext (to underline the use for virtual files)
> 
> I think we're mostly in agreement here. VirtualRewriterContext in Rewrite would be fine by me.
> 
>> But to take a step back (and maybe I missed something) - doesn't libclang already have a way to instantiate everything needed for Rewriting a bunch of files?
> 
> We're not rewriting files, we're rewriting text produced by calling Decl::print(). Since we'll be doing this a lot within libclang, we need to keep the context object around so we're not rebuilding the SourceManager, Lexer, etc.
> 
> Makes sense. Sounds like we have a plan then... 
> 
> Fariborz, anything unclear?

Yes (I may have another name for the header-file/class though).

- Fariborz

> 
> Cheers,
> /Manuel
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121218/cb3b227a/attachment.html>


More information about the cfe-commits mailing list