On Thu, Apr 14, 2011 at 10:29:08AM +0530, anirud...@csa.iisc.ernet.in wrote: > I wish to pass some statement-level annotations (by this I mean, some > information associated with each source statement, say a string) to the > backend for my analysis. If I try to attach labels, CIL seems to remove > them in the code it generates.
Unused labels are removed at the very end of CIL transformations, by the Rmtmp pass. You can keep them in the generated output with the --keepunused flag. You can use them anyway to carry whatever information you need, they will be handed to your visitors. > The CIL paper (CIL: Intermediate Language and Tools for Analysis and > Transformation of C Programs) says that CIL extends the GNU C notation for > pragmas and attributes for the purpose of communicating extra information > to the analysis. Has anyone used this mechanism? Could someone tell me how > to do this / point me to an example where this is done? You shall not need this, but just FYI: http://www.eecs.berkeley.edu/~necula/cil/attributes.html (section 6.4) http://www.eecs.berkeley.edu/~necula/cil/api/Cil.htm (see "Values for manipulating attributes") You can only attach attributes to variables and types. Pragma have the same syntax as attributes, but can only be used at toplevel. -- Gabriel ------------------------------------------------------------------------------ Benefiting from Server Virtualization: Beyond Initial Workload Consolidation -- Increasing the use of server virtualization is a top priority.Virtualization can reduce costs, simplify management, and improve application availability and disaster protection. Learn more about boosting the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev _______________________________________________ CIL-users mailing list CIL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cil-users