[cfe-dev] Future of AST transformation

Sean Silva silvas at purdue.edu
Mon Jul 23 14:26:08 PDT 2012


You can easily get the Sema from the CompilerInstance with
CompilerInstance::getSema().

--Sean Silva

On Mon, Jul 23, 2012 at 2:20 AM, Olaf Krzikalla
<Olaf.Krzikalla at tu-dresden.de> wrote:
> Am 21.07.2012 01:08, schrieb Sean Silva:
>> Check out the block comment right above the class declaration, it
>> contains a quite thorough discussion. TreeTransform is just a standard
>> visitor pattern which recursively accumulates the results of
>> subinvocations. If you're familiar with Pythons `ast.NodeTransformer`,
>> TreeTransform is basically the same idea.
> There are at least two reasons against TreeTransform: firstly, it is not
> even exposed as an API but just a part of the sema lib. Secondly, even
> if it would be available, I won't be able to construct an actual object,
> since I don't have a proper sema object. For various reasons I have to
> construct the complete AST before I start transforming it. And then I
> don't have an idea, how I get sema back to the appropriate state.
>
> For the moment I'm going to implement my own simple EvaluateAsRValue
> function. Of course I'm very unhappy with this solution right now.
>
>
> Best regards
> Olaf Krzikalla
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



More information about the cfe-dev mailing list