Skip to content

Commit

Permalink
base interface try
Browse files Browse the repository at this point in the history
  • Loading branch information
bernd5 committed Oct 29, 2021
1 parent 4c6c870 commit 39118dd
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 13 deletions.
26 changes: 20 additions & 6 deletions src/Compilers/Core/Portable/Generated/Operations.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ public interface IEndOperation : IOperation
/// <para>This interface is reserved for implementation by its associated APIs. We reserve the right to
/// change it in the future.</para>
/// </remarks>
public interface IRaiseEventOperation : IOperation
public interface IRaiseEventOperation : IArgumentProvidingOperation
{
/// <summary>
/// Reference to the event to be raised.
Expand All @@ -618,7 +618,7 @@ public interface IRaiseEventOperation : IOperation
/// If the invocation is in its expanded form, then params/ParamArray arguments would be collected into arrays.
/// Default values are supplied for optional arguments missing in source.
/// </remarks>
ImmutableArray<IArgumentOperation> Arguments { get; }
ImmutableArray<IArgumentOperation> IArgumentProvidingOperation.Arguments { get; }
}
/// <summary>
/// Represents a textual literal numeric, string, etc.
Expand Down Expand Up @@ -707,7 +707,7 @@ public interface IConversionOperation : IOperation
/// <para>This interface is reserved for implementation by its associated APIs. We reserve the right to
/// change it in the future.</para>
/// </remarks>
public interface IInvocationOperation : IOperation
public interface IInvocationOperation : IArgumentProvidingOperation
{
/// <summary>
/// Method to be invoked.
Expand Down Expand Up @@ -809,6 +809,20 @@ public interface IParameterReferenceOperation : IOperation
IParameterSymbol Parameter { get; }
}
/// <summary>
/// Common interface to represent operations with arguments
/// </summary>
/// <remarks>
/// <para>This interface is reserved for implementation by its associated APIs. We reserve the right to
/// change it in the future.</para>
/// </remarks>
public interface IArgumentProvidingOperation : IOperation
{
/// <summary>
/// Arguments of the operation.
/// </summary>
ImmutableArray<IArgumentOperation> Arguments { get; }
}
/// <summary>
/// Represents a reference to a member of a class, struct, or interface.
/// <para>
/// Current usage:
Expand Down Expand Up @@ -3331,7 +3345,7 @@ public interface IWithOperation : IOperation
/// <para>This interface is reserved for implementation by its associated APIs. We reserve the right to
/// change it in the future.</para>
/// </remarks>
public interface IFunctionPointerInvocationOperation : IOperation
public interface IFunctionPointerInvocationOperation : IArgumentProvidingOperation
{
/// <summary>
/// Invoked pointer.
Expand Down Expand Up @@ -4154,7 +4168,7 @@ protected override (bool hasNext, int nextSlot, int nextIndex) MoveNext(int prev
public override void Accept(OperationVisitor visitor) => visitor.VisitConversion(this);
public override TResult? Accept<TArgument, TResult>(OperationVisitor<TArgument, TResult> visitor, TArgument argument) where TResult : default => visitor.VisitConversion(this, argument);
}
internal sealed partial class InvocationOperation : Operation, IInvocationOperation
internal sealed partial class InvocationOperation : BaseArgumentProvidingOperation, IInvocationOperation
{
internal InvocationOperation(IMethodSymbol targetMethod, IOperation? instance, bool isVirtual, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit)
: base(semanticModel, syntax, isImplicit)
Expand Down Expand Up @@ -7624,7 +7638,7 @@ protected override (bool hasNext, int nextSlot, int nextIndex) MoveNext(int prev
public override void Accept(OperationVisitor visitor) => visitor.VisitWith(this);
public override TResult? Accept<TArgument, TResult>(OperationVisitor<TArgument, TResult> visitor, TArgument argument) where TResult : default => visitor.VisitWith(this, argument);
}
internal sealed partial class FunctionPointerInvocationOperation : Operation, IFunctionPointerInvocationOperation
internal sealed partial class FunctionPointerInvocationOperation : BaseArgumentProvidingOperation, IFunctionPointerInvocationOperation
{
internal FunctionPointerInvocationOperation(IOperation invokedPointer, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit)
: base(semanticModel, syntax, isImplicit)
Expand Down
18 changes: 15 additions & 3 deletions src/Compilers/Core/Portable/Operations/OperationInterfaces.xml
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@
</summary>
</Comments>
</Node>
<Node Name="IRaiseEventOperation" Base="IOperation" ChildrenOrder="EventReference,Arguments">
<Node Name="IRaiseEventOperation" Base="IArgumentProvidingOperation" ChildrenOrder="EventReference,Arguments">
<Comments>
<summary>
Represents an operation for raising an event.
Expand Down Expand Up @@ -640,7 +640,7 @@
</Comments>
</Property>
</Node>
<Node Name="IInvocationOperation" Base="IOperation" ChildrenOrder="Instance,Arguments" HasType="true">
<Node Name="IInvocationOperation" Base="IArgumentProvidingOperation" ChildrenOrder="Instance,Arguments" HasType="true">
<Comments>
<summary>
Represents an invocation of a method.
Expand Down Expand Up @@ -747,6 +747,18 @@
</Comments>
</Property>
</Node>
<AbstractNode Name="IArgumentProvidingOperation" Base="IOperation" SkipClassGeneration="true" >
<Comments>
<summary>
Common interface to represent operations with arguments
</summary>
</Comments>
<Property Name="Arguments" Type="ImmutableArray&lt;IArgumentOperation&gt;" SkipGeneration="true">
<Comments>
<summary>Arguments of the operation.</summary>
</Comments>
</Property>
</AbstractNode>
<AbstractNode Name="IMemberReferenceOperation" Base="IOperation" >
<Comments>
<summary>
Expand Down Expand Up @@ -3057,7 +3069,7 @@
</Comments>
</Property>
</Node>
<Node Name="IFunctionPointerInvocationOperation" Base="IOperation" ChildrenOrder="InvokedPointer,Arguments" HasType="true">
<Node Name="IFunctionPointerInvocationOperation" Base="IArgumentProvidingOperation" ChildrenOrder="InvokedPointer,Arguments" HasType="true">
<Comments>
<summary>
Represents an invocation of a function pointer.
Expand Down
2 changes: 2 additions & 0 deletions src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ Microsoft.CodeAnalysis.LineMapping.LineMapping() -> void
Microsoft.CodeAnalysis.LineMapping.LineMapping(Microsoft.CodeAnalysis.Text.LinePositionSpan span, int? characterOffset, Microsoft.CodeAnalysis.FileLinePositionSpan mappedSpan) -> void
Microsoft.CodeAnalysis.LineMapping.MappedSpan.get -> Microsoft.CodeAnalysis.FileLinePositionSpan
Microsoft.CodeAnalysis.LineMapping.Span.get -> Microsoft.CodeAnalysis.Text.LinePositionSpan
Microsoft.CodeAnalysis.Operations.IArgumentProvidingOperation
Microsoft.CodeAnalysis.Operations.IArgumentProvidingOperation.Arguments.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Operations.IArgumentOperation!>
Microsoft.CodeAnalysis.Operations.IFunctionPointerInvocationOperation
Microsoft.CodeAnalysis.Operations.IFunctionPointerInvocationOperation.Arguments.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Operations.IArgumentOperation!>
Microsoft.CodeAnalysis.Operations.IFunctionPointerInvocationOperation.InvokedPointer.get -> Microsoft.CodeAnalysis.IOperation!
Expand Down
8 changes: 4 additions & 4 deletions src/Tools/Source/CompilerGeneratorTools/CompilerTools.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29323.36
# Visual Studio Version 17
VisualStudioVersion = 17.0.31815.197
MinimumVisualStudioVersion = 10.0.40219.1
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "VisualBasicSyntaxGenerator", "Source\VisualBasicSyntaxGenerator\VisualBasicSyntaxGenerator.vbproj", "{6AA96934-D6B7-4CC8-990D-DB6B9DD56E34}"
EndProject
Expand All @@ -25,8 +25,8 @@ Global
{6AA96934-D6B7-4CC8-990D-DB6B9DD56E34}.Debug|Any CPU.Build.0 = Debug|x64
{6AA96934-D6B7-4CC8-990D-DB6B9DD56E34}.Release|Any CPU.ActiveCfg = Release|x64
{6AA96934-D6B7-4CC8-990D-DB6B9DD56E34}.Release|Any CPU.Build.0 = Release|x64
{288089C5-8721-458E-BE3E-78990DAB5E2D}.Debug|Any CPU.ActiveCfg = Debug|x64
{288089C5-8721-458E-BE3E-78990DAB5E2D}.Debug|Any CPU.Build.0 = Debug|x64
{288089C5-8721-458E-BE3E-78990DAB5E2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{288089C5-8721-458E-BE3E-78990DAB5E2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{288089C5-8721-458E-BE3E-78990DAB5E2D}.Release|Any CPU.ActiveCfg = Release|x64
{288089C5-8721-458E-BE3E-78990DAB5E2D}.Release|Any CPU.Build.0 = Release|x64
{02459936-CD2C-4F61-B671-5C518F2A3DDC}.Debug|Any CPU.ActiveCfg = Debug|x64
Expand Down

0 comments on commit 39118dd

Please sign in to comment.