Grant Jacobs wrote:
Forgive me for a rambling a few thoughts on this.
I haven't time to test this, but how does it go if a procedure does no productive activity - does the compiler strip the procedure and its calls out? (i.e. detecting an empty procedure body.) Have a constant, something like:
const doAsserts = false ;
and somewhere in the code calling your own assert defined like:
procedure assert( ... ) begin if doAsserts then begin end end
Would the compiler recognise that the above procedure is useless (when doAsserts = true) and strip out the calls to new assert() procedure ?
AFAIK, only when inlining (as the special case of inling "nothing"). Inlining doesn't work across units/modules (yet), so I guess it's not too useful for Peter. Currently, the importer of a unit/module only sees its interface, so it can't know that the body is empty. (The `const' attribute I mentioned in my previous mail is basically a way to specify this fact, or something similar, in the interface.) Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: 51FF C1F0 1A77 C6C2 4482 4DDC 117A 9773 7F88 1707