Plugin access to Variable scopes

Santanu Dash s.dash@surrey.ac.uk
Mon May 11 11:58:38 GMT 2020


Apologies, please ignore my previous email. We would like to hear from the experts on the mailing list.

Best,
Santanu

From: "Dash, Santanu Dr (Computer Science)" <s.dash@surrey.ac.uk>
Date: Monday, 11 May 2020 at 12:57
To: A Butler <AlexisB1011@outlook.com>, "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Re: Plugin access to Variable scopes

No, it should not be dependent on the position in the tree, it should be a property of the decl itself. As we discussed briefly over slack, the best way to hunt this down is to use the namespace which should be available in the decl context.

Best,
Santanu

From: A Butler <AlexisB1011@outlook.com>
Date: Monday, 11 May 2020 at 09:29
To: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Plugin access to Variable scopes

I’ve been trying to write a plugin for GCC to act as a harness for a code synthesis system, and am having trouble with extracting the scope of variable declaration nodes from the AST.
Is it the case that variable scope is implicit based on the declarations position on the tree, or is it a defined property of the declaration node? If so how would be best to go about accessing the property?

Note:
I’m currently running the plugin on the PRE_GENERICIZE event as the target Language is C

Thanks for any help.



More information about the Gcc-help mailing list