-
Notifications
You must be signed in to change notification settings - Fork 256
/
CompilerInstrumenter.cs
25 lines (21 loc) · 971 Bytes
/
CompilerInstrumenter.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using Microsoft.Dafny.Compilers;
namespace Microsoft.Dafny.Plugins;
/// <summary>
/// A hook for plugins to customize some of the code generation of other IExecutableBackends.
/// </summary>
public abstract class CompilerInstrumenter : ErrorReportingBase {
public CompilerInstrumenter(ErrorReporter reporter) : base(reporter) { }
/// <summary>
/// Instrument the given compiler.
///
/// Unlike with Rewriters, there is less consistent structure
/// to the implementation of the various compilers.
/// Therefore there isn't a single generic interface for instrumentation support
/// for an arbitrary SinglePassCompiler subclass.
/// CompilerInstrumenters will generally want to check for known subtypes
/// and downcast to interface with them,
/// possibly reporting an error if they don't recognize the compiler.
/// </summary>
public virtual void Instrument(IExecutableBackend backend, SinglePassCompiler compiler, Program program) {
}
}