dotnet / dotnet/roslyn

Add EmitDifferenceOptions

Open
#78,035 1 comment 0 reactions 0 assignees View on GitHub
api-approved Area-Compilers Concept-API Feature Request
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

## Background and Motivation

Hot Reload: The IDE needs to configure the compiler to emit different code based on the capabilities of the runtime.

## Proposed API

```diff
namespace Microsoft.CodeAnalysis.Emit;

class Compilation
{
public EmitDifferenceResult EmitDifference(
EmitBaseline baseline,
IEnumerable edits,
Func isAddedSymbol,
Stream metadataStream,
Stream ilStream,
Stream pdbStream,
+ EmitDifferenceOptions options,
CancellationToken cancellationToken);
}

+public readonly struct EmitDifferenceOptions
+{
+ public static readonly EmitDifferenceOptions Default;
+
+ ///
+ /// True to emit FieldRva table entries. The runtime must support this feature.
+ ///
+ public bool EmitFieldRva { get; init; }
+
+ public EmitDifferenceOptions();
}
```

## Usage Examples

## Alternative Designs

## Risks

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.