Hello, there seems to be a small efficiency issue in visitCilType (more precisely childrenType): in TPtr and TArray cases, the visited pointed-to type is compared against the original pointer type, not the original pointed-to type, so that the type gets always rebuilt, even if it is not modified. This behavior is correct but could be more efficient.
Attached is a patch against 1.3.7 which performs correct comparisons. Best regards, -- E tutto per oggi, a la prossima volta. Virgile
--- src/cil.ml 2009-04-24 20:50:33.000000000 +0200 +++ src/cil.ml.new 2010-05-06 09:46:29.877794389 +0200 @@ -5377,16 +5377,16 @@ TPtr(t1, a) -> let t1' = fTyp t1 in let a' = fAttr a in - if t1' != t || a' != a then TPtr(t1', a') else t + if t1' != t1 || a' != a then TPtr(t1', a') else t | TArray(t1, None, a) -> let t1' = fTyp t1 in let a' = fAttr a in - if t1' != t || a' != a then TArray(t1', None, a') else t + if t1' != t1 || a' != a then TArray(t1', None, a') else t | TArray(t1, Some e, a) -> let t1' = fTyp t1 in let e' = visitCilExpr vis e in let a' = fAttr a in - if t1' != t || e' != e || a' != a then TArray(t1', Some e', a') else t + if t1' != t1 || e' != e || a' != a then TArray(t1', Some e', a') else t (* DON'T recurse into the compinfo, this is done in visitCilGlobal. User can iterate over cinfo.cfields manually, if desired.*)
------------------------------------------------------------------------------
_______________________________________________ CIL-users mailing list CIL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cil-users