INSTRUMENTING PROGRAM CODE
First Claim
1. An extensible compiler, configured to:
- receive information identifying a programming language construct in a program;
receive instrumentation to be performed on the programming language construct in the program, such that the instrumentation for a particular compilation of the program is extended beyond a fixed set of predefined instrumentations hard-coded into the compiler without reprogramming the compiler; and
insert the instrumentation into an instrumented bound tree representing the program, the instrumented bound tree created by an instrumenting rewriter of the compiler.
1 Assignment
0 Petitions
Accused Products
Abstract
A compiler can instrument a program during the front end of compilation to collect data about runtime behavior when the program is executed. Instrumentation can occur during source language processing rather than later in the compilation chain. The instrumentation can occur in between semantic analysis and code generation. The instrumentation can occur in an instrumenting rewriting phase. The instrumentation can occur in a first lowering phase in which high level constructs in a programming language are rewritten as lower level constructs in intermediate representation (IR). The compiler can inject the instrumentation code at particular points in the source code based on specified language constructs in the source program. The types of instrumentation injected can be extended by providing additional information to the compiler at compilation time, without the need to reprogram the compiler.
12 Citations
20 Claims
-
1. An extensible compiler, configured to:
-
receive information identifying a programming language construct in a program; receive instrumentation to be performed on the programming language construct in the program, such that the instrumentation for a particular compilation of the program is extended beyond a fixed set of predefined instrumentations hard-coded into the compiler without reprogramming the compiler; and insert the instrumentation into an instrumented bound tree representing the program, the instrumented bound tree created by an instrumenting rewriter of the compiler. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 10)
-
-
9. (canceled)
-
11. A method of instrumenting code comprising:
-
receiving by a compiler for a particular compilation, instructions for instrumenting an identified programming language construct of a source code program; inserting instrumentation for the identified programming language construct into code representing the program without reprogramming the compiler, such that the instrumentation for the particular compilation of the program is extended beyond a fixed set of predefined instrumentations hard-coded into the compiler; generating an instrumented bound tree comprising the instrumented programming language construct. - View Dependent Claims (12, 13, 14, 15)
-
-
16. A device for instrumenting code during the front end of compilation, the device comprising:
-
a memory; a processor, the processor configured to; for a particular compilation of a source code program, rewrite a higher level programming language construct of a the source code program into a lower level construct in a representation of the source code program comprising intermediate representation (IR); receive instructions for identifying the higher level programming language construct; receive instructions for instrumenting the higher level programming language construct without reprogramming a compiler of the source code program, such that the instrumentation for the particular compilation of the source code program is extended beyond a fixed set of predefined instrumentations hard-coded into the compiler; store a location of the higher level programming language construct in the source code program; and instrument the lower level construct in the IR. - View Dependent Claims (17, 18, 19, 20)
-
Specification