When an expression is used to generate a parameter to an inlined function call, a temporary variable is created to hold the result of the expression. When the inlined function doesn't contain any code, the result of the expression is unused and should be calculations should be removed. This is not the case.
Minimal example code follows:
******************************
integer DEBUG = FALSE;
//pragma inline
debugPrint(string msg){
if( DEBUG ){
llOwnerSay("debug: " + msg);
}
}
default {
state_entry() {
debugPrint("Free memory: " + (string)llGetFreeMemory());
}
}
********************
Which yields the following compiled code:
********************
// LSL script generated: test.lslp Mon Mar 7 22:26:46 CET 2011
default {
state_entry() {
string msg = ("Free memory: " + ((string)llGetFreeMemory()));
}
}
**********
The line: "string msg = ..." should be removed by the optimizer.