11 instantiations of TypePositionInfo
Microsoft.Interop.ComInterfaceGenerator (4)
ComInterfaceGenerator.cs (1)
329
new
TypePositionInfo
(SpecialTypeInfo.Int32, new ManagedHResultExceptionMarshallingInfo())
VirtualMethodPointerStubGenerator.cs (3)
183
elements.Add(new
TypePositionInfo
(new PointerTypeInfo("void*", "void*", false), methodStub.ManagedThisMarshallingInfo)
205
elements.Add(new
TypePositionInfo
(methodStub.TypeKeyOwner, methodStub.ManagedThisMarshallingInfo)
221
new
TypePositionInfo
(
Microsoft.Interop.SourceGeneration (7)
BoundGenerators.cs (1)
23
IBoundMarshallingGenerator defaultBoundGenerator = fallbackGenerator.Bind(new
TypePositionInfo
(SpecialTypeInfo.Void, NoMarshallingInfo.Instance), context);
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (1)
212
var elementInfo = new
TypePositionInfo
(marshallerData.CollectionElementType, marshallerData.CollectionElementMarshallingInfo)
MarshallingInfoParser.cs (2)
316
info = new
TypePositionInfo
(SpecialTypeInfo.Void, NoMarshallingInfo.Instance);
345
info = new
TypePositionInfo
(SpecialTypeInfo.Void, NoMarshallingInfo.Instance);
MethodSignatureElementInfoProvider.cs (1)
33
info = new
TypePositionInfo
(
SignatureContext.cs (1)
122
TypePositionInfo retTypeInfo =
new
(ManagedTypeInfo.CreateTypeInfoForTypeSymbol(method.ReturnType), marshallingInfoParser.ParseMarshallingInfo(method.ReturnType, method.GetReturnTypeAttributes()));
TypePositionInfo.cs (1)
92
var typeInfo = new
TypePositionInfo
(ManagedTypeInfo.CreateTypeInfoForTypeSymbol(paramSymbol.Type), marshallingInfo)
297 references to TypePositionInfo
Microsoft.Interop.ComInterfaceGenerator (66)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (4)
172
private static bool HasUnsupportedMarshalAsInfo(
TypePositionInfo
info)
188
private readonly Func<
TypePositionInfo
, StubCodeContext, ResolvedGenerator> _func;
190
public CallbackGeneratorResolver(Func<
TypePositionInfo
, StubCodeContext, ResolvedGenerator> func)
195
public ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context) => _func(info, context);
ComInterfaceGenerator.cs (6)
291
ImmutableArray<
TypePositionInfo
> returnSwappedSignatureElements = signatureContext.ElementTypeInformation;
312
var
managedSignatureAsNativeOut = returnSwappedSignatureElements[i] with
315
ManagedIndex =
TypePositionInfo
.ReturnIndex,
331
NativeIndex =
TypePositionInfo
.ReturnIndex
340
TypePositionInfo
? managedReturnInfo = signatureContext.ElementTypeInformation.FirstOrDefault(e => e.IsManagedReturnPosition);
356
foreach (
TypePositionInfo
parameter in signatureContext.ManagedParameters)
ComMethodContext.cs (1)
147
static ArgumentSyntax GenerateArgument(
TypePositionInfo
info)
Marshallers\ComInterfaceDispatchMarshallingResolver.cs (7)
19
public ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context)
35
public ManagedTypeInfo AsNativeType(
TypePositionInfo
info) =>
40
public IEnumerable<StatementSyntax> Generate(
TypePositionInfo
info, StubCodeContext codeContext, StubIdentifierContext context)
65
public SignatureBehavior GetNativeSignatureBehavior(
TypePositionInfo
info) => SignatureBehavior.NativeType;
66
public ValueBoundaryBehavior GetValueBoundaryBehavior(
TypePositionInfo
info, StubCodeContext context) => ValueBoundaryBehavior.NativeIdentifier;
67
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind,
TypePositionInfo
info, out GeneratorDiagnostic? diagnostic)
69
public bool UsesNativeIdentifier(
TypePositionInfo
info, StubCodeContext context) => true;
Marshallers\KeepAliveThisMarshaller.cs (6)
17
public ManagedTypeInfo AsNativeType(
TypePositionInfo
info) => info.ManagedType;
18
public IEnumerable<StatementSyntax> Generate(
TypePositionInfo
info, StubCodeContext codeContext, StubIdentifierContext context)
33
public SignatureBehavior GetNativeSignatureBehavior(
TypePositionInfo
info) => SignatureBehavior.NativeType;
34
public ValueBoundaryBehavior GetValueBoundaryBehavior(
TypePositionInfo
info, StubCodeContext context) => ValueBoundaryBehavior.ManagedIdentifier;
35
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind,
TypePositionInfo
info, out GeneratorDiagnostic? diagnostic)
38
public bool UsesNativeIdentifier(
TypePositionInfo
info, StubCodeContext context) => false;
Marshallers\ManagedHResultExceptionGeneratorResolver.cs (13)
18
public ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context)
37
public ManagedTypeInfo AsNativeType(
TypePositionInfo
info) => info.ManagedType;
38
public IEnumerable<StatementSyntax> Generate(
TypePositionInfo
info, StubCodeContext codeContext, StubIdentifierContext context)
56
public SignatureBehavior GetNativeSignatureBehavior(
TypePositionInfo
info) => SignatureBehavior.NativeType;
57
public ValueBoundaryBehavior GetValueBoundaryBehavior(
TypePositionInfo
info, StubCodeContext context) => ValueBoundaryBehavior.ManagedIdentifier;
58
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind,
TypePositionInfo
info, out GeneratorDiagnostic? diagnostic)
60
public bool UsesNativeIdentifier(
TypePositionInfo
info, StubCodeContext context) => false;
65
public ManagedTypeInfo AsNativeType(
TypePositionInfo
info) => info.ManagedType;
66
public IEnumerable<StatementSyntax> Generate(
TypePositionInfo
info, StubCodeContext codeContext, StubIdentifierContext context)
93
public SignatureBehavior GetNativeSignatureBehavior(
TypePositionInfo
info) => SignatureBehavior.NativeType;
94
public ValueBoundaryBehavior GetValueBoundaryBehavior(
TypePositionInfo
info, StubCodeContext context) => ValueBoundaryBehavior.ManagedIdentifier;
95
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind,
TypePositionInfo
info, out GeneratorDiagnostic? diagnostic)
97
public bool UsesNativeIdentifier(
TypePositionInfo
info, StubCodeContext context) => false;
Marshallers\ObjectUnwrapperResolver.cs (7)
17
public ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context)
33
public ManagedTypeInfo AsNativeType(
TypePositionInfo
info) => new PointerTypeInfo("void*", "void*", false);
34
public IEnumerable<StatementSyntax> Generate(
TypePositionInfo
info, StubCodeContext codeContext, StubIdentifierContext context)
60
public SignatureBehavior GetNativeSignatureBehavior(
TypePositionInfo
info) => SignatureBehavior.NativeType;
61
public ValueBoundaryBehavior GetValueBoundaryBehavior(
TypePositionInfo
info, StubCodeContext context) => ValueBoundaryBehavior.NativeIdentifier;
62
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind,
TypePositionInfo
info, out GeneratorDiagnostic? diagnostic)
64
public bool UsesNativeIdentifier(
TypePositionInfo
info, StubCodeContext context) => true;
Marshallers\StructAsHResultMarshallerFactory.cs (7)
17
public ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context)
30
public ManagedTypeInfo AsNativeType(
TypePositionInfo
info) => SpecialTypeInfo.Int32;
32
public IEnumerable<StatementSyntax> Generate(
TypePositionInfo
info, StubCodeContext codeContext, StubIdentifierContext context)
79
public SignatureBehavior GetNativeSignatureBehavior(
TypePositionInfo
info)
84
public ValueBoundaryBehavior GetValueBoundaryBehavior(
TypePositionInfo
info, StubCodeContext context)
94
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind,
TypePositionInfo
info, out GeneratorDiagnostic? diagnostic)
97
public bool UsesNativeIdentifier(
TypePositionInfo
info, StubCodeContext context) => true;
UnmanagedToManagedStubGenerator.cs (1)
23
ImmutableArray<
TypePositionInfo
> argTypes,
VirtualMethodPointerStubGenerator.cs (14)
29
ImmutableArray<
TypePositionInfo
> elements = methodStub.SignatureContext.ElementTypeInformation;
136
ImmutableArray<
TypePositionInfo
> elements = AddUnmanagedToManagedImplicitElementInfos(methodStub);
177
private static ImmutableArray<
TypePositionInfo
> AddManagedToUnmanagedImplicitThis(IncrementalMethodStubGenerationContext methodStub)
179
ImmutableArray<
TypePositionInfo
> originalElements = methodStub.SignatureContext.ElementTypeInformation;
181
var elements = ImmutableArray.CreateBuilder<
TypePositionInfo
>(originalElements.Length + 2);
188
foreach (
TypePositionInfo
element in originalElements)
192
NativeIndex =
TypePositionInfo
.IncrementIndex(element.NativeIndex)
199
private static ImmutableArray<
TypePositionInfo
> AddUnmanagedToManagedImplicitElementInfos(IncrementalMethodStubGenerationContext methodStub)
201
ImmutableArray<
TypePositionInfo
> originalElements = methodStub.SignatureContext.ElementTypeInformation;
203
var elements = ImmutableArray.CreateBuilder<
TypePositionInfo
>(originalElements.Length + 2);
210
foreach (
TypePositionInfo
element in originalElements)
214
NativeIndex =
TypePositionInfo
.IncrementIndex(element.NativeIndex)
226
ManagedIndex =
TypePositionInfo
.ExceptionIndex,
227
NativeIndex =
TypePositionInfo
.ReturnIndex
Microsoft.Interop.JavaScript.JSImportGenerator (21)
JSExportCodeGenerator.cs (1)
24
ImmutableArray<
TypePositionInfo
> argTypes,
JSGeneratorFactory.cs (3)
16
public ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context)
36
bool isToJs = info.ManagedIndex !=
TypePositionInfo
.ReturnIndex ^ context.Direction == MarshalDirection.UnmanagedToManaged;
96
internal static ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context, bool isToJs, KnownManagedType marshaledType, KnownManagedType[] argumentTypes, JSTypeFlags jsType, JSTypeFlags[] jsTypeArguments, Func<string, ResolvedGenerator> failWithReason)
JSImportCodeGenerator.cs (1)
31
ImmutableArray<
TypePositionInfo
> argTypes,
JSSignatureContext.cs (1)
53
foreach (
var
param in sigContext.ElementTypeInformation)
Marshaling\ArrayJSGenerator.cs (1)
16
public ArrayJSGenerator(
TypePositionInfo
info, StubCodeContext context, MarshalerType elementMarshalerType)
Marshaling\ArraySegmentJSGenerator.cs (1)
15
public ArraySegmentJSGenerator(
TypePositionInfo
info, StubCodeContext context, MarshalerType elementMarshalerType)
Marshaling\BaseJSGenerator.cs (1)
24
public
TypePositionInfo
TypeInfo => _inner.TypeInfo;
Marshaling\EmptyJSGenerator.cs (6)
12
public ManagedTypeInfo AsNativeType(
TypePositionInfo
info) => info.ManagedType;
13
public IEnumerable<StatementSyntax> Generate(
TypePositionInfo
info, StubCodeContext codeContext, StubIdentifierContext identifierContext) => Array.Empty<StatementSyntax>();
14
public SignatureBehavior GetNativeSignatureBehavior(
TypePositionInfo
info) => SignatureBehavior.ManagedTypeAndAttributes;
15
public ValueBoundaryBehavior GetValueBoundaryBehavior(
TypePositionInfo
info, StubCodeContext context) => ValueBoundaryBehavior.ManagedIdentifier;
16
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind,
TypePositionInfo
info, out GeneratorDiagnostic? diagnostic)
18
public bool UsesNativeIdentifier(
TypePositionInfo
info, StubCodeContext context) => false;
Marshaling\FuncJSGenerator.cs (1)
19
public FuncJSGenerator(
TypePositionInfo
info, StubCodeContext context, bool isAction, MarshalerType[] argumentMarshalerTypes)
Marshaling\NullableJSGenerator.cs (1)
13
public NullableJSGenerator(
TypePositionInfo
info, StubCodeContext context, MarshalerType resultMarshalerType)
Marshaling\PrimitiveJSGenerator.cs (1)
19
public PrimitiveJSGenerator(
TypePositionInfo
info, StubCodeContext context, MarshalerType marshalerType)
Marshaling\SpanJSGenerator.cs (1)
15
public SpanJSGenerator(
TypePositionInfo
info, StubCodeContext context, MarshalerType elementMarshalerType)
Marshaling\TaskJSGenerator.cs (1)
16
public TaskJSGenerator(
TypePositionInfo
info, StubCodeContext context, MarshalerType resultMarshalerType)
Marshaling\VoidGenerator.cs (1)
8
internal sealed class VoidGenerator(
TypePositionInfo
info, StubCodeContext context, MarshalerType marshalerType) : BaseJSGenerator(marshalerType, new Forwarder().Bind(info, context));
Microsoft.Interop.LibraryImportGenerator (4)
Analyzers\ConvertToLibraryImportAnalyzer.cs (3)
201
private static bool HasUnsupportedMarshalAsInfo(
TypePositionInfo
info)
230
private sealed class CallbackGeneratorResolver(Func<
TypePositionInfo
, StubCodeContext, ResolvedGenerator> func) : IMarshallingGeneratorResolver
232
public ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context) => func(info, context);
ForwarderResolver.cs (1)
14
public ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context) => ResolvedGenerator.Resolved(s_forwarder.Bind(info, context));
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
ForwarderResolver.cs (1)
14
public ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context) => ResolvedGenerator.Resolved(s_forwarder.Bind(info, context));
Microsoft.Interop.SourceGeneration (205)
BoundGenerators.cs (11)
21
public static BoundGenerators Create(ImmutableArray<
TypePositionInfo
> elementTypeInfo, IMarshallingGeneratorResolver generatorResolver, StubCodeContext context, IUnboundMarshallingGenerator fallbackGenerator, out ImmutableArray<GeneratorDiagnostic> generatorBindingDiagnostics)
33
TypePositionInfo
? managedExceptionInfo = null;
35
foreach (
TypePositionInfo
argType in elementTypeInfo)
59
if (!
TypePositionInfo
.IsSpecialIndex(argType.ManagedIndex))
63
if (!
TypePositionInfo
.IsSpecialIndex(argType.NativeIndex))
130
static IEnumerable<(bool IsManagedIndex, int Index)> GetInfoDependencies(
TypePositionInfo
info)
133
if (info.ManagedIndex ==
TypePositionInfo
.UnsetIndex)
141
static (bool IsManagedIndex, int Index) GetInfoIndex(
TypePositionInfo
info)
147
if (info.ManagedIndex !=
TypePositionInfo
.UnsetIndex)
154
IBoundMarshallingGenerator CreateGenerator(
TypePositionInfo
p, IMarshallingGeneratorResolver factory)
204
public ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context)
DefaultIdentifierContext.cs (1)
26
public override (string managed, string native) GetIdentifiers(
TypePositionInfo
info)
GeneratorDiagnosticsBag.cs (1)
29
/// <param name="locations">A provider of locations for diagnostics on <see cref="
TypePositionInfo
"/>s.</param>
LinearCollectionElementIdentifierContext.cs (4)
12
private readonly
TypePositionInfo
_elementInfo;
29
TypePositionInfo
elementInfo,
46
public override (string managed, string native) GetIdentifiers(
TypePositionInfo
info)
63
public override string GetAdditionalIdentifier(
TypePositionInfo
info, string name)
ManagedToNativeStubGenerator.cs (2)
51
ImmutableArray<
TypePositionInfo
> argTypes,
96
public string GetNativeIdentifier(
TypePositionInfo
info)
MarshalAsParser.cs (1)
143
if (!elementInfoProvider.TryGetInfoForParamIndex(attributeData, (short)sizeParamIndexArg.Value!, marshallingInfoCallback, out
TypePositionInfo
paramIndexInfo))
Marshalling\AttributedMarshallingModelGeneratorResolver.cs (11)
43
public ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context)
65
private GeneratorDiagnostic.NotSupported? ValidateCountInfo(
TypePositionInfo
info, CountInfo count, StubCodeContext context, out bool countInfoRequiresCast)
72
SizeAndParamIndexInfo(_,
TypePositionInfo
param) => ValidateNumElementsExpression(param, out countInfoRequiresCast),
73
CountElementCountInfo(
TypePositionInfo
elementInfo) => ValidateNumElementsExpression(elementInfo, out countInfoRequiresCast),
80
GeneratorDiagnostic.NotSupported? ValidateNumElementsExpression(
TypePositionInfo
paramInfo, out bool requiresCast)
131
private CustomTypeMarshallerData GetMarshallerDataForTypePositionInfo(CustomTypeMarshallers marshallers,
TypePositionInfo
info, StubCodeContext context)
144
private ResolvedGenerator CreateCustomNativeTypeMarshaller(
TypePositionInfo
info, StubCodeContext context, NativeMarshallingAttributeInfo marshalInfo)
207
TypePositionInfo
info,
212
var
elementInfo = new TypePositionInfo(marshallerData.CollectionElementType, marshallerData.CollectionElementMarshallingInfo)
366
private static FreeStrategy GetFreeStrategy(
TypePositionInfo
info, StubCodeContext context)
417
private GeneratorDiagnostic.NotSupported? ValidateCustomNativeTypeMarshallingSupported(
TypePositionInfo
info, StubCodeContext context, NativeMarshallingAttributeInfo marshalInfo)
Marshalling\BlittableMarshaller.cs (6)
14
public ManagedTypeInfo AsNativeType(
TypePositionInfo
info)
19
public SignatureBehavior GetNativeSignatureBehavior(
TypePositionInfo
info)
24
public ValueBoundaryBehavior GetValueBoundaryBehavior(
TypePositionInfo
info, StubCodeContext context)
37
public IEnumerable<StatementSyntax> Generate(
TypePositionInfo
info, StubCodeContext codeContext, StubIdentifierContext context)
97
public bool UsesNativeIdentifier(
TypePositionInfo
info, StubCodeContext context)
102
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind,
TypePositionInfo
info, out GeneratorDiagnostic? diagnostic)
Marshalling\BlittableMarshallerResolver.cs (2)
12
/// Resolves a <see cref="
TypePositionInfo
"/> with <see cref="UnmanagedBlittableMarshallingInfo"/> based on the target compilation's
23
public ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context)
Marshalling\BoolMarshaller.cs (6)
29
public ManagedTypeInfo AsNativeType(
TypePositionInfo
info)
35
public SignatureBehavior GetNativeSignatureBehavior(
TypePositionInfo
info)
40
public ValueBoundaryBehavior GetValueBoundaryBehavior(
TypePositionInfo
info, StubCodeContext context)
50
public IEnumerable<StatementSyntax> Generate(
TypePositionInfo
info, StubCodeContext codeContext, StubIdentifierContext context)
98
public bool UsesNativeIdentifier(
TypePositionInfo
info, StubCodeContext context) => true;
100
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind,
TypePositionInfo
info, out GeneratorDiagnostic? diagnostic)
Marshalling\BreakingChangeDetector.cs (1)
17
public ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context)
Marshalling\ByValueContentsMarshalKindValidator.cs (3)
9
/// An <see cref="IMarshallingGeneratorResolver"/> implementation that wraps an inner <see cref="IMarshallingGeneratorResolver"/> instance and validates that the <see cref="
TypePositionInfo
.ByValueContentsMarshalKind"/> on the provided <see cref="
TypePositionInfo
"/> is valid in the current marshalling scenario.
22
public ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context)
Marshalling\ByValueMarshalKindSupportDescriptor.cs (4)
12
public ByValueMarshalKindSupport GetSupport(
TypePositionInfo
info, out GeneratorDiagnostic? diagnostic)
42
/// Provides an implementation of <see cref="IUnboundMarshallingGenerator.SupportsByValueMarshalKind(ByValueContentsMarshalKind,
TypePositionInfo
, out GeneratorDiagnostic?)"/> through <see cref="GetSupport(ByValueContentsMarshalKind,
TypePositionInfo
, out GeneratorDiagnostic?)"/>
71
public ByValueMarshalKindSupport GetSupport(ByValueContentsMarshalKind marshalKind,
TypePositionInfo
info, out GeneratorDiagnostic? diagnostic)
Marshalling\CharMarshaller.cs (7)
18
public ValueBoundaryBehavior GetValueBoundaryBehavior(
TypePositionInfo
info, StubCodeContext context)
36
public ManagedTypeInfo AsNativeType(
TypePositionInfo
info)
42
public SignatureBehavior GetNativeSignatureBehavior(
TypePositionInfo
info)
47
public IEnumerable<StatementSyntax> Generate(
TypePositionInfo
info, StubCodeContext codeContext, StubIdentifierContext context)
123
public bool UsesNativeIdentifier(
TypePositionInfo
info, StubCodeContext context)
129
private static bool IsPinningPathSupported(
TypePositionInfo
info, StubCodeContext context)
137
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind,
TypePositionInfo
info, out GeneratorDiagnostic? diagnostic)
Marshalling\CharMarshallingGeneratorResolver.cs (2)
24
public ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context)
34
private ResolvedGenerator CreateCharMarshaller(
TypePositionInfo
info, StubCodeContext context)
Marshalling\CompositeMarshallingGeneratorResolver.cs (1)
26
public ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context)
Marshalling\CustomTypeMarshallingGenerator.cs (1)
22
public
TypePositionInfo
TypeInfo => nativeTypeMarshaller.TypeInfo;
Marshalling\DelegateMarshaller.cs (6)
15
public ManagedTypeInfo AsNativeType(
TypePositionInfo
info)
20
public SignatureBehavior GetNativeSignatureBehavior(
TypePositionInfo
info)
25
public ValueBoundaryBehavior GetValueBoundaryBehavior(
TypePositionInfo
info, StubCodeContext context)
30
public IEnumerable<StatementSyntax> Generate(
TypePositionInfo
info, StubCodeContext codeContext, StubIdentifierContext context)
93
public bool UsesNativeIdentifier(
TypePositionInfo
info, StubCodeContext context) => true;
95
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind,
TypePositionInfo
info, out GeneratorDiagnostic? diagnostic)
Marshalling\ElementsMarshalling.cs (7)
18
TypePositionInfo
TypeInfo { get; }
68
SizeAndParamIndexInfo(SizeAndParamIndexInfo.UnspecifiedConstSize,
TypePositionInfo
param) => GetExpressionForParam(param),
69
SizeAndParamIndexInfo(int size,
TypePositionInfo
param) => CheckedExpression(SyntaxKind.CheckedExpression,
73
CountElementCountInfo(
TypePositionInfo
elementInfo) => GetExpressionForParam(elementInfo),
96
ExpressionSyntax GetExpressionForParam(
TypePositionInfo
paramInfo)
113
public static StatementSyntax GetNumElementsAssignmentFromManagedValuesSource(this IElementsMarshallingCollectionSource source,
TypePositionInfo
info, StubIdentifierContext context)
127
public static StatementSyntax GetNumElementsAssignmentFromManagedValuesDestination(this IElementsMarshallingCollectionSource source,
TypePositionInfo
info, StubIdentifierContext context)
Marshalling\Forwarder.cs (6)
12
public ManagedTypeInfo AsNativeType(
TypePositionInfo
info)
17
public SignatureBehavior GetNativeSignatureBehavior(
TypePositionInfo
info)
22
public ValueBoundaryBehavior GetValueBoundaryBehavior(
TypePositionInfo
info, StubCodeContext context)
27
public IEnumerable<StatementSyntax> Generate(
TypePositionInfo
info, StubCodeContext codeContext, StubIdentifierContext context)
32
public bool UsesNativeIdentifier(
TypePositionInfo
info, StubCodeContext context) => false;
34
public ByValueMarshalKindSupport SupportsByValueMarshalKind(ByValueContentsMarshalKind marshalKind,
TypePositionInfo
info, out GeneratorDiagnostic? diagnostic)
Marshalling\GeneratorDiagnostic.cs (5)
13
private GeneratorDiagnostic(
TypePositionInfo
typePositionInfo, bool isFatal)
23
public
TypePositionInfo
TypePositionInfo { get; }
28
public sealed record NotSupported(
TypePositionInfo
TypePositionInfo) : GeneratorDiagnostic(TypePositionInfo, isFatal: true)
45
public sealed record UnnecessaryData(
TypePositionInfo
TypePositionInfo, ImmutableArray<Location> UnnecessaryDataLocations) : GeneratorDiagnostic(TypePositionInfo, isFatal: false)
64
public sealed record NotRecommended(
TypePositionInfo
TypePositionInfo) : GeneratorDiagnostic(TypePositionInfo, isFatal: false)
Marshalling\GenericFriendlyPointerIdentifierContext.cs (4)
14
private readonly
TypePositionInfo
_adaptedInfo;
17
public GenericFriendlyPointerIdentifierContext(StubIdentifierContext inner,
TypePositionInfo
adaptedInfo, string baseIdentifier)
25
public override (string managed, string native) GetIdentifiers(
TypePositionInfo
info)
36
public override string GetAdditionalIdentifier(
TypePositionInfo
info, string name) => _innerContext.GetAdditionalIdentifier(info, name);
Marshalling\ICustomTypeMarshallingStrategy.cs (1)
14
TypePositionInfo
TypeInfo { get; }
Marshalling\IMarshallingGeneratorResolver.cs (1)
17
TypePositionInfo
info,
Marshalling\MarshalAsMarshallingGeneratorResolver.cs (1)
35
TypePositionInfo
info,
Marshalling\MarshallerHelpers.cs (28)
64
public static string GetMarshallerIdentifier(
TypePositionInfo
info, StubIdentifierContext context)
69
public static string GetManagedSpanIdentifier(
TypePositionInfo
info, StubIdentifierContext context)
74
public static string GetNativeSpanIdentifier(
TypePositionInfo
info, StubIdentifierContext context)
79
public static string GetNumElementsIdentifier(
TypePositionInfo
info, StubIdentifierContext context)
84
public static string GetLastIndexMarshalledIdentifier(
TypePositionInfo
info, StubIdentifierContext context)
94
public static ExpressionSyntax GetIndexedManagedElementExpression(
TypePositionInfo
info, StubCodeContext codeContext, StubIdentifierContext context)
105
internal static bool CanUseCallerAllocatedBuffer(
TypePositionInfo
info, StubCodeContext context)
232
public static IEnumerable<
TypePositionInfo
> GetDependentElementsOfMarshallingInfo(
237
if (nestedCollection.ElementCountInfo is CountElementCountInfo { ElementInfo:
TypePositionInfo
nestedCountElement })
241
if (nestedCountElement.ManagedIndex !=
TypePositionInfo
.UnsetIndex || nestedCountElement.NativeIndex !=
TypePositionInfo
.UnsetIndex)
248
foreach (
TypePositionInfo
nestedElement in GetDependentElementsOfMarshallingInfo(mode.Value.CollectionElementMarshallingInfo))
250
if (nestedElement.ManagedIndex !=
TypePositionInfo
.UnsetIndex || nestedElement.NativeIndex !=
TypePositionInfo
.UnsetIndex)
260
public static StatementSyntax SkipInitOrDefaultInit(
TypePositionInfo
info, StubIdentifierContext context)
282
public static StatementSyntax DefaultInit(
TypePositionInfo
info, StubIdentifierContext context)
291
/// Get the marshalling direction for a given <see cref="
TypePositionInfo
"/> in a given <see cref="StubCodeContext"/>.
298
public static MarshalDirection GetMarshalDirection(
TypePositionInfo
info, StubCodeContext context)
353
public static StubIdentifierContext.Stage GetCleanupStage(
TypePositionInfo
info, StubCodeContext context)
375
public static void ValidateCountInfoAvailableAtCall(MarshalDirection stubDirection,
TypePositionInfo
info, GeneratorDiagnosticsBag generatorDiagnostics, IMethodSymbol symbol, DiagnosticDescriptor outParamDescriptor, DiagnosticDescriptor returnValueDescriptor)
383
|| info.ManagedIndex is
TypePositionInfo
.ReturnIndex)
389
Location location =
TypePositionInfo
.GetLocation(info, symbol);
397
else if (countInfo.ElementInfo.ManagedIndex is
TypePositionInfo
.ReturnIndex)
399
Location location =
TypePositionInfo
.GetLocation(info, symbol);
410
public static SyntaxTokenList GetManagedParameterModifiers(
TypePositionInfo
typeInfo)
453
public static SyntaxToken GetManagedArgumentRefKindKeyword(
TypePositionInfo
typeInfo)
471
public static bool IsInStubReturnPosition(
TypePositionInfo
info, MarshalDirection direction)
486
public static bool IsInInvocationReturnPosition(
TypePositionInfo
info, MarshalDirection direction)
Marshalling\MarshallingGenerator.cs (11)
11
/// An enumeration describing how a <see cref="
TypePositionInfo
"/> should be represented in its corresponding native signature element (parameter, field, or return value).
21
/// The native signature should be the type returned by <see cref="IUnboundMarshallingGenerator.AsNativeType(
TypePositionInfo
)"/> passed by value.
26
/// The native signature should be a pointer to the type returned by <see cref="IUnboundMarshallingGenerator.AsNativeType(
TypePositionInfo
)"/> passed by value.
32
/// An enumeration describing how a <see cref="
TypePositionInfo
"/> should be represented in its corresponding native signature element (parameter, field, or return value).
42
/// The native identifier provided by <see cref="StubIdentifierContext.GetIdentifiers(
TypePositionInfo
)"/> should be passed by value.
47
/// The address of the native identifier provided by <see cref="StubIdentifierContext.GetIdentifiers(
TypePositionInfo
)"/> should be passed by value.
52
/// The native identifier provided by <see cref="StubIdentifierContext.GetIdentifiers(
TypePositionInfo
)"/> should be cast to the native type.
88
TypePositionInfo
TypeInfo { get; }
152
/// A bound generator that binds an <see cref="IUnboundMarshallingGenerator"/> to a specific <see cref="
TypePositionInfo
"/>.
156
internal sealed class BoundMarshallingGenerator(
TypePositionInfo
info, StubCodeContext context, IUnboundMarshallingGenerator unbound) : IBoundMarshallingGenerator
162
public
TypePositionInfo
TypeInfo => info;
Marshalling\MarshallingGeneratorExtensions.cs (4)
104
private static ParameterSyntax GenerateForwardingParameter(
TypePositionInfo
info, string identifier)
141
TypePositionInfo
info = generator.TypeInfo;
156
TypePositionInfo
info = generator.TypeInfo;
167
TypePositionInfo
info = generator.TypeInfo;
Marshalling\NoMarshallingInfoErrorResolver.cs (1)
15
TypePositionInfo
info,
Marshalling\NotSupportedResolver.cs (1)
8
public ResolvedGenerator Create(
TypePositionInfo
info, StubCodeContext context) =>
Marshalling\ResolvedGenerator.cs (1)
25
public static ResolvedGenerator NotSupported(
TypePositionInfo
info, StubCodeContext context, GeneratorDiagnostic.NotSupported notSupportedDiagnostic)
Marshalling\StatefulMarshallingStrategy.cs (3)
13
internal sealed class StatefulValueMarshalling(
TypePositionInfo
info, StubCodeContext stubContext, ManagedTypeInfo marshallerType, ManagedTypeInfo unmanagedType, MarshallerShape shape) : ICustomTypeMarshallingStrategy
21
public
TypePositionInfo
TypeInfo => info;
175
public static string GetMarshallerIdentifier(
TypePositionInfo
info, StubIdentifierContext context)
Marshalling\StatelessMarshallingStrategy.cs (2)
17
internal sealed class StatelessValueMarshalling(
TypePositionInfo
info, StubCodeContext codeContext, TypeSyntax marshallerTypeSyntax, ManagedTypeInfo unmanagedType, MarshallerShape shape) : ICustomTypeMarshallingStrategy
23
public
TypePositionInfo
TypeInfo => info;
Marshalling\StaticPinnableManagedValueMarshaller.cs (1)
15
public
TypePositionInfo
TypeInfo => innerMarshallingGenerator.TypeInfo;
Marshalling\UnmanagedToManagedOwnershipTrackingStrategy.cs (2)
14
/// Marshalling strategy that introduces a variable to hold the initial value of the provided <see cref="
TypePositionInfo
"/> and a variable to track if the original value has been replaced.
23
public
TypePositionInfo
TypeInfo => innerMarshaller.TypeInfo;
MarshallingAttributeInfo.cs (3)
90
public sealed record CountElementCountInfo(
TypePositionInfo
ElementInfo) : CountInfo
95
public sealed record SizeAndParamIndexInfo(int ConstSize,
TypePositionInfo
? ParamAtIndex) : CountInfo
99
public const
TypePositionInfo
UnspecifiedParam = null;
MarshallingInfoParser.cs (22)
109
/// Get a <see cref="
TypePositionInfo
"/> instance for the given element name.
112
/// <param name="elementName">The element name to retrieve a <see cref="
TypePositionInfo
"/> instance for.</param>
113
/// <param name="marshallingInfoCallback">A callback to retrieve marshalling info to put into the <see cref="
TypePositionInfo
"/>.</param>
116
/// <returns><c>true</c> if a <see cref="
TypePositionInfo
"/> instance could be created for the type; otherwise <c>false</c></returns>
117
bool TryGetInfoForElementName(AttributeData attrData, string elementName, GetMarshallingInfoCallback marshallingInfoCallback, IElementInfoProvider rootProvider, out
TypePositionInfo
info);
119
/// Get a <see cref="
TypePositionInfo
"/> instance for the given element index.
122
/// <param name="paramIndex">The element index to retrieve a <see cref="
TypePositionInfo
"/> instance for.</param>
123
/// <param name="marshallingInfoCallback">A callback to retrieve marshalling info to put into the <see cref="
TypePositionInfo
"/>.</param>
126
/// <returns><c>true</c> if a <see cref="
TypePositionInfo
"/> instance could be created for the type; otherwise <c>false</c></returns>
127
bool TryGetInfoForParamIndex(AttributeData attrData, int paramIndex, GetMarshallingInfoCallback marshallingInfoCallback, IElementInfoProvider rootProvider, out
TypePositionInfo
info);
136
/// Get a <see cref="
TypePositionInfo
"/> instance for the given element name.
139
/// <param name="elementName">The element name to retrieve a <see cref="
TypePositionInfo
"/> instance for.</param>
140
/// <param name="marshallingInfoCallback">A callback to retrieve marshalling info to put into the <see cref="
TypePositionInfo
"/>.</param>
142
/// <returns><c>true</c> if a <see cref="
TypePositionInfo
"/> instance could be created for the type; otherwise <c>false</c></returns>
143
public static bool TryGetInfoForElementName(this IElementInfoProvider provider, AttributeData attrData, string elementName, GetMarshallingInfoCallback marshallingInfoCallback, out
TypePositionInfo
info)
149
/// Get a <see cref="
TypePositionInfo
"/> instance for the given element index.
152
/// <param name="paramIndex">The element index to retrieve a <see cref="
TypePositionInfo
"/> instance for.</param>
153
/// <param name="marshallingInfoCallback">A callback to retrieve marshalling info to put into the <see cref="
TypePositionInfo
"/>.</param>
155
/// <returns><c>true</c> if a <see cref="
TypePositionInfo
"/> instance could be created for the type; otherwise <c>false</c></returns>
156
public static bool TryGetInfoForParamIndex(this IElementInfoProvider provider, AttributeData attrData, int paramIndex, GetMarshallingInfoCallback marshallingInfoCallback, out
TypePositionInfo
info)
298
public bool TryGetInfoForElementName(AttributeData attrData, string elementName, GetMarshallingInfoCallback marshallingInfoCallback, IElementInfoProvider rootProvider, [NotNullWhen(true)] out
TypePositionInfo
? info)
325
public bool TryGetInfoForParamIndex(AttributeData attrData, int paramIndex, GetMarshallingInfoCallback marshallingInfoCallback, IElementInfoProvider rootProvider, [NotNullWhen(true)] out
TypePositionInfo
? info)
MarshalUsingAttributeParser.cs (1)
103
if (!elementInfoProvider.TryGetInfoForElementName(attributeData, elementName, marshallingInfoCallback, out
TypePositionInfo
elementInfo))
MethodSignatureElementInfoProvider.cs (5)
29
public bool TryGetInfoForElementName(AttributeData attrData, string elementName, GetMarshallingInfoCallback marshallingInfoCallback, IElementInfoProvider rootProvider, out
TypePositionInfo
info)
37
ManagedIndex =
TypePositionInfo
.ReturnIndex
47
info =
TypePositionInfo
.CreateForParameter(
60
public bool TryGetInfoForParamIndex(AttributeData attrData, int paramIndex, GetMarshallingInfoCallback marshallingInfoCallback, IElementInfoProvider rootProvider, out
TypePositionInfo
info)
69
info =
TypePositionInfo
.CreateForParameter(
SignatureContext.cs (15)
30
public ImmutableArray<
TypePositionInfo
> ElementTypeInformation { get; init; }
32
public IEnumerable<
TypePositionInfo
> ManagedParameters => ElementTypeInformation.Where(tpi => !
TypePositionInfo
.IsSpecialIndex(tpi.ManagedIndex));
40
foreach (
TypePositionInfo
typeInfo in ElementTypeInformation)
42
if (typeInfo.ManagedIndex !=
TypePositionInfo
.UnsetIndex
43
&& typeInfo.ManagedIndex !=
TypePositionInfo
.ReturnIndex)
62
ImmutableArray<
TypePositionInfo
> typeInfos = GenerateTypeInformation(method, marshallingInfoParser, env);
101
private static ImmutableArray<
TypePositionInfo
> GenerateTypeInformation(
108
ImmutableArray<
TypePositionInfo
>.Builder typeInfos = ImmutableArray.CreateBuilder<
TypePositionInfo
>();
113
var
typeInfo =
TypePositionInfo
.CreateForParameter(param, marshallingInfo, env.Compilation);
122
TypePositionInfo
retTypeInfo = new(ManagedTypeInfo.CreateTypeInfoForTypeSymbol(method.ReturnType), marshallingInfoParser.ParseMarshallingInfo(method.ReturnType, method.GetReturnTypeAttributes()));
125
ManagedIndex =
TypePositionInfo
.ReturnIndex,
126
NativeIndex =
TypePositionInfo
.ReturnIndex,
StubCodeContext.cs (1)
59
public bool IsInStubReturnPosition(
TypePositionInfo
info)
StubIdentifierContext.cs (3)
45
/// <see cref="IUnboundMarshallingGenerator.AsArgument(
TypePositionInfo
)"/> should provide the
103
public virtual (string managed, string native) GetIdentifiers(
TypePositionInfo
info)
114
public virtual string GetAdditionalIdentifier(
TypePositionInfo
info, string name)
TypePositionInfo.cs (4)
83
public bool PositionsEqual(
TypePositionInfo
other)
88
public static
TypePositionInfo
CreateForParameter(IParameterSymbol paramSymbol, MarshallingInfo marshallingInfo, Compilation compilation)
92
var
typeInfo = new TypePositionInfo(ManagedTypeInfo.CreateTypeInfoForTypeSymbol(paramSymbol.Type), marshallingInfo)
105
public static Location GetLocation(
TypePositionInfo
info, IMethodSymbol methodSymbol)
VariableDeclarations.cs (2)
23
TypePositionInfo
info = marshaller.TypeInfo;
86
TypePositionInfo
info = marshaller.TypeInfo;