8 instantiations of FunctionPointerTypeSymbol
Microsoft.CodeAnalysis.CSharp (8)
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (8)
19=> new FunctionPointerTypeSymbol( 40=> new FunctionPointerTypeSymbol(FunctionPointerMethodSymbol.CreateFromPartsForTest(callingConvention, returnType, refCustomModifiers, returnRefKind, parameterTypes, parameterRefCustomModifiers, parameterRefKinds, compilation)); 53=> new FunctionPointerTypeSymbol(FunctionPointerMethodSymbol.CreateFromParts(callingConvention, callingConventionModifiers, returnType, returnRefKind, parameterTypes, parameterRefKinds, compilation)); 56=> new FunctionPointerTypeSymbol( 64=> new FunctionPointerTypeSymbol(Signature.SubstituteParameterSymbols(substitutedReturnType, substitutedParameterTypes, refCustomModifiers, paramRefCustomModifiers)); 139result = madeChanges ? new FunctionPointerTypeSymbol(newSignature) : this; 166return new FunctionPointerTypeSymbol(mergedSignature); 177return new FunctionPointerTypeSymbol(substitutedSignature);
225 references to FunctionPointerTypeSymbol
Microsoft.CodeAnalysis.CSharp (101)
Binder\Binder_Conversions.cs (2)
746else if (targetType is FunctionPointerTypeSymbol functionPointerType) 1283FunctionPointerTypeSymbol { Signature: { } signature } => signature,
Binder\Binder_Crefs.cs (1)
561MethodSymbol signature = ((FunctionPointerTypeSymbol)type).Signature;
Binder\Binder_Invocation.cs (3)
2009RoslynDebug.Assert(boundExpression.Type is FunctionPointerTypeSymbol); 2011var funcPtr = (FunctionPointerTypeSymbol)boundExpression.Type;
Binder\Binder_Symbols.cs (1)
458FunctionPointerTypeSymbol.CreateFromSource(
Binder\Semantics\AccessCheck.cs (2)
167var funcPtr = (FunctionPointerTypeSymbol)symbol;
Binder\Semantics\Conversions\Conversions.cs (2)
113public override Conversion GetMethodGroupFunctionPointerConversion(BoundMethodGroup source, FunctionPointerTypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 177if (type is FunctionPointerTypeSymbol { Signature: { } signature })
Binder\Semantics\Conversions\ConversionsBase.cs (4)
68public abstract Conversion GetMethodGroupFunctionPointerConversion(BoundMethodGroup source, FunctionPointerTypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo); 1084case BoundKind.UnconvertedAddressOfOperator when destination is FunctionPointerTypeSymbol funcPtrType: 3149if (!(source is FunctionPointerTypeSymbol { Signature: { } sourceSig }) 3150|| !(destination is FunctionPointerTypeSymbol { Signature: { } destinationSig }))
Binder\Semantics\Conversions\TypeConversions.cs (1)
44public override Conversion GetMethodGroupFunctionPointerConversion(BoundMethodGroup source, FunctionPointerTypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (2)
700if ((object)leftType != null || (object)rightType != null || left.Type is FunctionPointerTypeSymbol || right.Type is FunctionPointerTypeSymbol)
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (9)
534Debug.Assert(delegateOrFunctionPointerType.IsDelegateType() || delegateOrFunctionPointerType is FunctionPointerTypeSymbol); 969FunctionPointerTypeSymbol f => f.Signature, 1350FunctionPointerTypeSymbol f => (f.Signature, true), 1716else if (source.Type is FunctionPointerTypeSymbol { Signature: { ParameterCount: int sourceParameterCount } sourceSignature } && 1717target.Type is FunctionPointerTypeSymbol { Signature: { ParameterCount: int targetParameterCount } targetSignature } && 2205if (source is not FunctionPointerTypeSymbol { Signature: { } sourceSignature } || target is not FunctionPointerTypeSymbol { Signature: { } targetSignature }) 2555if (source is not FunctionPointerTypeSymbol { Signature: { } sourceSignature } || target is not FunctionPointerTypeSymbol { Signature: { } targetSignature })
Binder\Semantics\OverloadResolution\OverloadResolution.cs (1)
497Debug.Assert(unmanagedCallingConventionTypes.All(u => FunctionPointerTypeSymbol.IsCallingConventionModifier((NamedTypeSymbol)u)));
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (2)
528ReportWrongCallingConvention(location, diagnostics, symbols, firstSupported, ((FunctionPointerTypeSymbol)delegateOrFunctionPointerType).Signature); 651else if (delegateOrFunctionPointerType is FunctionPointerTypeSymbol)
BoundTree\BoundFunctionPointerInvocation.cs (3)
12public FunctionPointerTypeSymbol FunctionPointer 16Debug.Assert(InvokedExpression.Type is FunctionPointerTypeSymbol); 17return (FunctionPointerTypeSymbol)InvokedExpression.Type;
CodeGen\CodeGenerator.cs (1)
361private void EmitSignatureToken(FunctionPointerTypeSymbol symbol, SyntaxNode syntaxNode)
Compilation\CSharpCompilation.cs (2)
3786return FunctionPointerTypeSymbol.CreateFromParts( 3803if (!FunctionPointerTypeSymbol.IsCallingConventionModifier(internalType) || @this.Assembly.CorLibrary != internalType.ContainingAssembly)
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (6)
599public override Symbol? VisitFunctionPointerType(FunctionPointerTypeSymbol symbol) 874private bool AreFunctionPointerTypesEqual(FunctionPointerTypeSymbol type, FunctionPointerTypeSymbol other) 963return AreFunctionPointerTypesEqual((FunctionPointerTypeSymbol)type, (FunctionPointerTypeSymbol)other); 1109public override Symbol VisitFunctionPointerType(FunctionPointerTypeSymbol symbol)
Emitter\Model\FunctionPointerTypeSymbolAdapter.cs (2)
124internal FunctionPointerTypeSymbolAdapter(FunctionPointerTypeSymbol underlyingFunctionPointerTypeSymbol) 130internal FunctionPointerTypeSymbol AdaptedFunctionPointerTypeSymbol { get; }
Emitter\Model\PEModuleBuilder.cs (2)
1142return Translate((FunctionPointerTypeSymbol)typeSymbol); 1512internal Cci.IFunctionPointerTypeReference Translate(FunctionPointerTypeSymbol symbol)
FlowAnalysis\NullableWalker.cs (2)
7998FunctionPointerTypeSymbol { Signature: { Parameters: { } parameters } signature } => (signature, parameters), 11186Debug.Assert(ResultType is TypeWithState { Type: FunctionPointerTypeSymbol { }, State: NullableFlowState.NotNull });
Operations\CSharpOperationFactory.cs (1)
1028if (boundConversion.Type is FunctionPointerTypeSymbol)
Symbols\AbstractTypeMap.cs (3)
112result = SubstituteFunctionPointerType((FunctionPointerTypeSymbol)previous); 238private FunctionPointerTypeSymbol SubstituteFunctionPointerType(FunctionPointerTypeSymbol f)
Symbols\Compilation_WellKnownMembers.cs (2)
938handleFunctionPointerType((FunctionPointerTypeSymbol)type, transformFlagsBuilder, addCustomModifierFlags); 966static void handleFunctionPointerType(FunctionPointerTypeSymbol funcPtr, ArrayBuilder<bool> transformFlagsBuilder, bool addCustomModifierFlags)
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (4)
654if (FunctionPointerTypeSymbol.IsCallingConventionModifier(modifier.ModifierSymbol)) 678if (FunctionPointerTypeSymbol.IsCallingConventionModifier(((CSharpCustomModifier)modifier).ModifierSymbol)) 721|| !FunctionPointerTypeSymbol.RefKindEquals(compareKind, RefKind, other.RefKind) 758=> Hash.Combine(ReturnType, Hash.Combine(((int)CallingConvention).GetHashCode(), ((int)FunctionPointerTypeSymbol.GetRefKindForHashCode(RefKind)).GetHashCode()));
Symbols\FunctionPointers\FunctionPointerParameterSymbol.cs (2)
57=> FunctionPointerTypeSymbol.RefKindEquals(compareKind, RefKind, other.RefKind) 68=> Hash.Combine(TypeWithAnnotations.GetHashCode(), ((int)FunctionPointerTypeSymbol.GetRefKindForHashCode(RefKind)).GetHashCode());
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (7)
18public static FunctionPointerTypeSymbol CreateFromSource(FunctionPointerTypeSyntax syntax, Binder typeBinder, BindingDiagnosticBag diagnostics, ConsList<TypeSymbol> basesBeingResolved, bool suppressUseSiteDiagnostics) 31public static FunctionPointerTypeSymbol CreateFromPartsForTests( 45public static FunctionPointerTypeSymbol CreateFromParts( 55public static FunctionPointerTypeSymbol CreateFromMetadata(ModuleSymbol containingModule, Cci.CallingConvention callingConvention, ImmutableArray<ParamInfo<TypeSymbol>> retAndParamTypes) 59public FunctionPointerTypeSymbol SubstituteTypeSymbol( 106if (!(t2 is FunctionPointerTypeSymbol other)) 163var mergedSignature = Signature.MergeEquivalentTypes(((FunctionPointerTypeSymbol)other).Signature, variance);
Symbols\Metadata\PE\DynamicTypeDecoder.cs (3)
170return TransformFunctionPointerType((FunctionPointerTypeSymbol)type); 347private FunctionPointerTypeSymbol? TransformFunctionPointerType(FunctionPointerTypeSymbol type)
Symbols\Metadata\PE\NativeIntegerTypeDecoder.cs (3)
92return TransformFunctionPointerType((FunctionPointerTypeSymbol)type); 174private FunctionPointerTypeSymbol? TransformFunctionPointerType(FunctionPointerTypeSymbol type)
Symbols\Metadata\PE\SymbolFactory.cs (1)
51return FunctionPointerTypeSymbol.CreateFromMetadata(moduleSymbol, callingConvention, retAndParamTypes);
Symbols\Metadata\PE\TupleTypeDecoder.cs (3)
168return DecodeFunctionPointerType((FunctionPointerTypeSymbol)type); 209private FunctionPointerTypeSymbol DecodeFunctionPointerType(FunctionPointerTypeSymbol type)
Symbols\MethodSymbol.cs (1)
1004|| !FunctionPointerTypeSymbol.IsCallingConventionModifier(callConvType))
Symbols\PublicModel\FunctionPointerTypeSymbol.cs (2)
12private readonly Symbols.FunctionPointerTypeSymbol _underlying; 14public FunctionPointerTypeSymbol(Symbols.FunctionPointerTypeSymbol underlying, CodeAnalysis.NullableAnnotation nullableAnnotation)
Symbols\Retargeting\RetargetingSymbolTranslator.cs (3)
759public FunctionPointerTypeSymbol Retarget(FunctionPointerTypeSymbol type) 1381public override Symbol VisitFunctionPointerType(FunctionPointerTypeSymbol symbol, RetargetOptions argument)
Symbols\SymbolExtensions.cs (3)
671internal static IFunctionPointerTypeSymbol? GetPublicSymbol(this FunctionPointerTypeSymbol? symbol) 814internal static FunctionPointerTypeSymbol? GetSymbol(this IFunctionPointerTypeSymbol? symbol) 816return symbol.GetSymbol<FunctionPointerTypeSymbol>();
Symbols\SymbolVisitor.cs (1)
100public virtual void VisitFunctionPointerType(FunctionPointerTypeSymbol symbol)
Symbols\SymbolVisitor`1.cs (1)
100public virtual TResult VisitFunctionPointerType(FunctionPointerTypeSymbol symbol)
Symbols\SymbolVisitor`2.cs (2)
124/// Called when visiting a <see cref="FunctionPointerTypeSymbol"/>; Override this with specific 130public virtual TResult VisitFunctionPointerType(FunctionPointerTypeSymbol symbol, TArgument argument)
Symbols\TypeSymbolExtensions.cs (8)
391return (TypeSymbol?)GetDelegateType(type) ?? type as FunctionPointerTypeSymbol; 521Debug.Assert(type is FunctionPointerTypeSymbol || type.IsDelegateType()); 522if (type is FunctionPointerTypeSymbol { Signature: { Parameters: var functionPointerParameters } }) 843var result = visitFunctionPointerType((FunctionPointerTypeSymbol)current, typeWithAnnotationsPredicate, typePredicate, arg, useDefaultType, canDigThroughNullable, visitCustomModifiers, out next); 864static TypeSymbol? visitFunctionPointerType(FunctionPointerTypeSymbol type, Func<TypeWithAnnotations, T, bool, bool>? typeWithAnnotationsPredicate, Func<TypeSymbol, T, bool, bool>? typePredicate, T arg, bool useDefaultType, bool canDigThroughNullable, bool visitCustomModifiers, out TypeWithAnnotations next) 1852var functionPointerType = (FunctionPointerTypeSymbol)type; 1951private static bool NormalizeTaskTypesInFunctionPointer(CSharpCompilation compilation, ref FunctionPointerTypeSymbol funcPtrType)
Utilities\TypeSymbolExtensions.cs (3)
43return ((FunctionPointerTypeSymbol)type).Signature.CustomModifierCount(); 112var funcPtr = (FunctionPointerTypeSymbol)type;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (37)
CodeGen\CodeGenFunctionPointersTests.cs (37)
124Assert.Equal(CallingConvention.Unmanaged, ((FunctionPointerTypeSymbol)funcPtr).Signature.CallingConvention); 303var signature = ((FunctionPointerTypeSymbol)field.Type).Signature; 379var signature = ((FunctionPointerTypeSymbol)field.Type).Signature; 688var param = (FunctionPointerTypeSymbol)m.Parameters[0].Type; 868var returnTypeWithAnnotations = ((FunctionPointerTypeSymbol)m.ReturnType).Signature.ReturnTypeWithAnnotations; 994var type = (FunctionPointerTypeSymbol)field.Type; 2542var returnType = (FunctionPointerTypeSymbol)m.ReturnType; 5420var type = (FunctionPointerTypeSymbol)c.GetField(fieldName).Type; 5469CommonVerifyFunctionPointer((FunctionPointerTypeSymbol)field.Type); 5555if (f.Type is FunctionPointerTypeSymbol ptrType) 5603CommonVerifyFunctionPointer((FunctionPointerTypeSymbol)param.Type); 5714CommonVerifyFunctionPointer((FunctionPointerTypeSymbol)param.Type); 7046var funcPtr = (FunctionPointerTypeSymbol)m1.Parameters.Single().Type; 7050funcPtr = (FunctionPointerTypeSymbol)m2.ReturnType; 7054funcPtr = (FunctionPointerTypeSymbol)m3.Parameters.Single().Type; 7058funcPtr = (FunctionPointerTypeSymbol)m4.ReturnType; 7659var funcPtr = FunctionPointerTypeSymbol.CreateFromPartsForTests( 7663var funcPtrRef = FunctionPointerTypeSymbol.CreateFromPartsForTests( 7668var funcPtrWithTestOnReturn = FunctionPointerTypeSymbol.CreateFromPartsForTests( 7672var funcPtrWithTestOnRef = FunctionPointerTypeSymbol.CreateFromPartsForTests( 7744var funcPtr = FunctionPointerTypeSymbol.CreateFromPartsForTests( 7748var funcPtrRef = FunctionPointerTypeSymbol.CreateFromPartsForTests( 7753var funcPtrWithTestOnReturn = FunctionPointerTypeSymbol.CreateFromPartsForTests( 7757var funcPtrWithTestOnRef = FunctionPointerTypeSymbol.CreateFromPartsForTests(
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Attributes\AttributeTests_NativeInteger.cs (1)
1591FunctionPointerUtilities.CommonVerifyFunctionPointer((FunctionPointerTypeSymbol)field.Type);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (7)
Semantics\FunctionPointerTests.cs (4)
2104var funcPtrType = (FunctionPointerTypeSymbol)m.ReturnType; 3919var type = (FunctionPointerTypeSymbol)m.Parameters[1].Type;
Semantics\OverloadResolutionTests.cs (1)
888FunctionPointerUtilities.CommonVerifyFunctionPointer((FunctionPointerTypeSymbol)type);
Semantics\RefFieldTests.cs (2)
10772var methods = decls.Select(d => ((FunctionPointerTypeSymbol)model.GetDeclaredSymbol(d).GetSymbol<LocalSymbol>().Type).Signature).ToArray(); 24262((FunctionPointerTypeSymbol)comp.GetMember<FieldSymbol>(qualifiedName).Type).Signature;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (74)
Symbols\FunctionPointerTypeSymbolTests.cs (70)
43var pointerType = (FunctionPointerTypeSymbol)m.Parameters.Single().Type; 173=> Assert.Equal(expected, ((FunctionPointerTypeSymbol)actual.Type).Signature.RefKind); 196var firstSignature = ((FunctionPointerTypeSymbol)m.Parameters[0].Type).Signature; 197var secondSignature = ((FunctionPointerTypeSymbol)m.Parameters[1].Type).Signature; 264var pointerType = (FunctionPointerTypeSymbol)m.Parameters.Single().Type; 326var m1PointerType = (FunctionPointerTypeSymbol)m1.Parameters.Single().Type; 330var m2PointerType = (FunctionPointerTypeSymbol)m2.Parameters.Single().Type; 334var m3PointerType = (FunctionPointerTypeSymbol)m3.Parameters.Single().Type; 399var sixthParamParam = ((FunctionPointerTypeSymbol)sixthParam.Parameters.Single().Type).Signature; 445var type = ((FunctionPointerTypeSymbol)parameterTypes[index].Type); 515var type = ((FunctionPointerTypeSymbol)parameterTypes[index].Type); 657var type = ((FunctionPointerTypeSymbol)parameterTypes[index].Type); 679var signature = ((FunctionPointerTypeSymbol)m.Parameters.Single().Type).Signature; 709AssertEqualityAndHashCode((FunctionPointerTypeSymbol)m.Parameters[0].Type, (FunctionPointerTypeSymbol)m.Parameters[1].Type, returnEquality: Equality.Equal, callingConventionEquality: Equality.Equal); 726AssertEqualityAndHashCode((FunctionPointerTypeSymbol)m.Parameters[0].Type, (FunctionPointerTypeSymbol)m.Parameters[1].Type, 745AssertEqualityAndHashCode((FunctionPointerTypeSymbol)m.Parameters[0].Type, (FunctionPointerTypeSymbol)m.Parameters[1].Type, 763AssertEqualityAndHashCode((FunctionPointerTypeSymbol)m.Parameters[0].Type, (FunctionPointerTypeSymbol)m.Parameters[1].Type, 782AssertEqualityAndHashCode((FunctionPointerTypeSymbol)m.Parameters[0].Type, (FunctionPointerTypeSymbol)m.Parameters[1].Type, 800AssertEqualityAndHashCode((FunctionPointerTypeSymbol)m.Parameters[0].Type, (FunctionPointerTypeSymbol)m.Parameters[1].Type, 818AssertEqualityAndHashCode((FunctionPointerTypeSymbol)m.Parameters[0].Type, (FunctionPointerTypeSymbol)m.Parameters[1].Type, 836AssertEqualityAndHashCode((FunctionPointerTypeSymbol)m.Parameters[0].Type, (FunctionPointerTypeSymbol)m.Parameters[1].Type, 854AssertEqualityAndHashCode((FunctionPointerTypeSymbol)m.Parameters[0].Type, (FunctionPointerTypeSymbol)m.Parameters[1].Type, 872AssertEqualityAndHashCode((FunctionPointerTypeSymbol)m.Parameters[0].Type, (FunctionPointerTypeSymbol)m.Parameters[1].Type, 890AssertEqualityAndHashCode((FunctionPointerTypeSymbol)m.Parameters[0].Type, (FunctionPointerTypeSymbol)m.Parameters[1].Type, 902private void AssertEqualityAndHashCode(FunctionPointerTypeSymbol p1, FunctionPointerTypeSymbol p2, Equality returnEquality, Equality callingConventionEquality, params Equality[] parameterEqualities) 1966Assert.True(FunctionPointerTypeSymbol.IsCallingConventionModifier(testConvention)); 2026static void verifyEquality((FunctionPointerTypeSymbol NoRef, FunctionPointerTypeSymbol ByRef) ptr1, (FunctionPointerTypeSymbol NoRef, FunctionPointerTypeSymbol ByRef) ptr2, bool expectedConventionEquality, bool expectedFullEquality, bool skipGetCallingConventionModifiersCheck = false) 2045(FunctionPointerTypeSymbol NoRef, FunctionPointerTypeSymbol ByRef) createTypeSymbol(ImmutableArray<CustomModifier> customModifiers, CallingConvention callingConvention = CallingConvention.Unmanaged) 2046=> (FunctionPointerTypeSymbol.CreateFromPartsForTests( 2055FunctionPointerTypeSymbol.CreateFromPartsForTests( 2096static void verifyEquality((FunctionPointerTypeSymbol NoRef, FunctionPointerTypeSymbol ByRef) ptr1, (FunctionPointerTypeSymbol NoRef, FunctionPointerTypeSymbol ByRef) ptr2, bool expectedConventionEquality, bool expectedFullEquality) 2112(FunctionPointerTypeSymbol NoRef, FunctionPointerTypeSymbol ByRef) createTypeSymbol(ImmutableArray<CustomModifier> customModifiers, CallingConvention callingConvention = CallingConvention.Unmanaged) 2113=> (FunctionPointerTypeSymbol.CreateFromPartsForTests( 2122FunctionPointerTypeSymbol.CreateFromPartsForTests( 2152static void verifyEquality((FunctionPointerTypeSymbol NoRef, FunctionPointerTypeSymbol ByRef) ptr1, (FunctionPointerTypeSymbol NoRef, FunctionPointerTypeSymbol ByRef) ptr2, bool expectedTypeConventionEquality, bool expectedRefConventionEquality) 2171(FunctionPointerTypeSymbol NoRef, FunctionPointerTypeSymbol ByRef) createTypeSymbol(ImmutableArray<CustomModifier> typeCustomModifiers, ImmutableArray<CustomModifier> refCustomModifiers, CallingConvention callingConvention = CallingConvention.Unmanaged) 2172=> (FunctionPointerTypeSymbol.CreateFromPartsForTests( 2181FunctionPointerTypeSymbol.CreateFromPartsForTests(
Symbols\Retargeting\RetargetingTests.cs (4)
849var ptrOriginal = (FunctionPointerTypeSymbol)mOriginal.ReturnType; 850var ptrRetargeted = (FunctionPointerTypeSymbol)mRetargeted.ReturnType;
Microsoft.CodeAnalysis.CSharp.Test.Utilities (5)
FunctionPointerUtilities.cs (5)
17internal static void CommonVerifyFunctionPointer(FunctionPointerTypeSymbol symbol) 26static void verifyPointerType(FunctionPointerTypeSymbol symbol) 271FunctionPointerTypeSymbol funcPtr = (FunctionPointerTypeSymbol)type; 349=> typeSymbol => VerifyFunctionPointerSymbol((FunctionPointerTypeSymbol)typeSymbol, callingConvention, returnVerifier, argumentVerifiers);