Linktime recognition of alternative implementations ofprogrammed functionality
First Claim
1. A method of generating an executable from a computer program having a plurality of statements in a source code, the method comprising the steps of:
- inserting, by a macro-preprocessor, a declaration statement for a first variable in a first source file in the computer program in response to detecting a first statement thereby rendering a modified first source file;
compiling the modified first source file to generate a first object module;
linking the first object module to generate an executable program, the linking step including resolving the first variable by linking a second object module having a definition corresponding to the first variable; and
providing a third object module in a linker library, the third object module corresponding to a second statement and including code supporting the first statement.
2 Assignments
0 Petitions
Accused Products
Abstract
A method and apparatus are disclosed for optimizing the runtime behavior of database or other applications by allowing selection of alternative code segments during linking of pre-compiled object modules. A macro-preprocessor inserts a declaration for a global variable in the source code in response to an occurrence of a command of interest. The linker selects object modules for executing other commands based on the presence or absence of the declaration for the global variable in the preprocessed source code. The method and apparatus are useful in implementing programming language statements including non-procedural programming languages such as the Embedded Structured Query Language (ESQL).
-
Citations
24 Claims
-
1. A method of generating an executable from a computer program having a plurality of statements in a source code, the method comprising the steps of:
-
inserting, by a macro-preprocessor, a declaration statement for a first variable in a first source file in the computer program in response to detecting a first statement thereby rendering a modified first source file;
compiling the modified first source file to generate a first object module;
linking the first object module to generate an executable program, the linking step including resolving the first variable by linking a second object module having a definition corresponding to the first variable; and
providing a third object module in a linker library, the third object module corresponding to a second statement and including code supporting the first statement. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A computer-readable medium having computer executable instructions for performing the steps of a method of generating an executable from a computer program having a plurality of statements in a source code, the method comprising the steps of:
-
inserting, by a macro-preprocessor, a declaration statement for a first variable in a first source file in the computer program in response to detecting a first statement thereby rendering a modified first source file;
compiling the modified first source file to generate a first object module;
linking the first object module to generate an executable program, the linking step including resolving the first variable by linking a second object module having a definition corresponding to the first variable; and
providing a third object module in a linker library, the third object module corresponding to a second statement and including code supporting the first statement. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17)
-
- 18. A linker library for generating an executable by a linker linking compiled object modules, the linker library comprising a first object module having a definition for a first variable providing a first value to the first variable and a declaration and definition for a second variable providing a second value to the second variable whereby a second object module can test, at runtime, the second variable for the second value to determine if the first object module is linked by the linker into the executable.
-
22. A linker library comprising a last object module having a definition for a variable, the last object module following at least one object module in the linker library wherein the variable is declared in at least one object module distinct from the last object module.
- 23. A macro-preprocessor for preprocessing program source code, the program source code comprising programming language statements such that an implementation of a first statement requires changing an implementation of a second programming language, wherein the macro-preprocessor introduces a declaration for a first variable in a preprocessed program source code in response to detecting an occurrence of the first programming statement in the program source code.
Specification