[cfe-dev] How Variables and QualTypes work?
arcfide at sacrideo.us
Wed Nov 26 14:26:30 PST 2014
Dear Clang Developers:
I’m trying to understand how QualType and Variable references work in the system. Basically, I want to make some changes to the way that ActOnBinOp works depending on the types of the LHSExpr and the RHSExpr values. In particular, I want to detect when one of these expressions has a qualifier that I’ve added called “Block Size” on the type. I’ve basically implemented it following the Address Space pattern, and I have verified that the type information does get added to some node at the handling of type attributes. However, the node that I get in the LHS of ActOnBinOp doesn’t have the expected type information. Here’s a small example:
int global(8) *p = …;
p = p + 1;
In this case, I am dealing with “p + 1” and I expect the node representing “p” (LHSExpr) to be annotated with my new type attribute information. However, the node doesn’t have this. I dumped the AST and noticed that there is an ImplicitCast node wrapping an internal node. I suspect, but have not verified, that the type information is in the contained node, but that, for some reason, this type information isn’t being pushed up to the implicitcast. At this point, I’m running into my ignorance of how Clang does it’s AST parsing and handling, so I’m not sure of the correct way to deal with this to ensure that such expressions have the type information I want on them.
I would appreciate suggestions on how to properly move forward on this.
Aaron W. Hsu | arcfide at sacrideo.us | http://www.sacrideo.us
Please support my work: https://www.gratipay.com/arcfide/
לֵ֤ב חֲכָמִים֙ בְּבֵ֣ית אֵ֔בֶל וְלֵ֥ב כְּסִילִ֖ים בְּבֵ֥ית שִׂמְחָֽה׃
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev