On Tue, May 15, 2012 at 10:43:56PM +0200, Smets, Jan (Jan) wrote:
> > We could modify the "unused variables" analysis to also 
> > remove unused labels.
> 
> That would be great.

I just pushed a change to fix this issue:
http://github.com/kerneis/cil/commit/23f2f201e003421699517ca872d148c56b2598ab

The problem was that CIL's printers does not output some trivial gotos, but of
course since they were actually part of the AST, the corresponding labels were
kept.  And it is very difficult to decide not to print the labels, since they
might be prefered to by other gotos.

The solution is to get rid of these trivial gotos (and labels, eventually)
during the "unused variables" analysis.  Removing statements during unused
variables elimination is a bit aggressive, but should do no harm since we did
not print them anyway.  Beware if you relied somehow on these explicit gotos in
your modules.

(An even better solution would be not to introduce them in the first place, and
remove this ugly special case in the printer. If someone wants to propose a
patch, I'll happily revert mine.)

Best,
-- 
Gabriel

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users

Reply via email to