Patent ID: 7921418

Claim:
A computer-implemented method of evaluating a call to a library function at compile time, comprising: identifying a first call included in a program being compiled by a compiler during a compile time of said program, said first call being a call to a library function included in a pre-defined list of library functions, said first call including one or more arguments, said library function including one or more formal arguments associated with said one or more arguments in a one-to-one correspondence, and said identifying including searching said pre-defined list of library functions for said library function, said library functions being external to said program; determining that said one or more arguments are one or more constant values; constructing, in an optimizer of said compiler, and responsive to said identifying and said determining, a second call to said library function, said second call including said one or more constant values; statically computing, in said optimizer, a result of said second call, said result computed by issuing said second call to said library function with said one or more constant values bound to said one or more formal parameters in a one-to-one correspondence; and replacing, during said compile time, said first call included in said program with said result.