@@ -25,16 +25,16 @@ internal sealed class DefinitionMethod : Method
2525
2626 public DefinitionMethod ( IGenericContext gc , MethodDefinitionHandle handle ) : base ( gc )
2727 {
28- md = Cx . MdReader . GetMethodDefinition ( handle ) ;
28+ md = Context . MdReader . GetMethodDefinition ( handle ) ;
2929 this . gc = gc ;
3030 this . handle = handle ;
31- name = Cx . GetString ( md . Name ) ;
31+ name = Context . GetString ( md . Name ) ;
3232
33- declaringType = ( Type ) Cx . CreateGeneric ( this , md . GetDeclaringType ( ) ) ;
33+ declaringType = ( Type ) Context . CreateGeneric ( this , md . GetDeclaringType ( ) ) ;
3434
3535 signature = md . DecodeSignature ( new SignatureDecoder ( ) , this ) ;
3636
37- methodDebugInformation = Cx . GetMethodDebugInformation ( handle ) ;
37+ methodDebugInformation = Context . GetMethodDebugInformation ( handle ) ;
3838 }
3939
4040 public override bool Equals ( object ? obj )
@@ -48,7 +48,7 @@ public override bool Equals(object? obj)
4848
4949 public override Type DeclaringType => declaringType ;
5050
51- public override string Name => Cx . ShortName ( md . Name ) ;
51+ public override string Name => Context . ShortName ( md . Name ) ;
5252
5353 public override string NameLabel => name ;
5454
@@ -67,14 +67,14 @@ public override IEnumerable<IExtractionProduct> Contents
6767 // depend on other type parameters (as a constraint).
6868 genericParams = new MethodTypeParameter [ md . GetGenericParameters ( ) . Count ] ;
6969 for ( var i = 0 ; i < genericParams . Length ; ++ i )
70- genericParams [ i ] = Cx . Populate ( new MethodTypeParameter ( this , this , i ) ) ;
70+ genericParams [ i ] = Context . Populate ( new MethodTypeParameter ( this , this , i ) ) ;
7171 for ( var i = 0 ; i < genericParams . Length ; ++ i )
7272 genericParams [ i ] . PopulateHandle ( md . GetGenericParameters ( ) [ i ] ) ;
7373 foreach ( var p in genericParams )
7474 yield return p ;
7575 }
7676
77- var typeSignature = md . DecodeSignature ( Cx . TypeSignatureDecoder , this ) ;
77+ var typeSignature = md . DecodeSignature ( Context . TypeSignatureDecoder , this ) ;
7878
7979 var parameters = GetParameterExtractionProducts ( typeSignature . ParameterTypes ) . ToArray ( ) ;
8080 Parameters = parameters . OfType < Parameter > ( ) . ToArray ( ) ;
@@ -85,37 +85,37 @@ public override IEnumerable<IExtractionProduct> Contents
8585 foreach ( var c in PopulateFlags )
8686 yield return c ;
8787
88- foreach ( var p in md . GetParameters ( ) . Select ( h => Cx . MdReader . GetParameter ( h ) ) . Where ( p => p . SequenceNumber > 0 ) )
88+ foreach ( var p in md . GetParameters ( ) . Select ( h => Context . MdReader . GetParameter ( h ) ) . Where ( p => p . SequenceNumber > 0 ) )
8989 {
9090 var pe = Parameters [ IsStatic ? p . SequenceNumber - 1 : p . SequenceNumber ] ;
9191 if ( p . Attributes . HasFlag ( ParameterAttributes . Out ) )
9292 yield return Tuples . cil_parameter_out ( pe ) ;
9393 if ( p . Attributes . HasFlag ( ParameterAttributes . In ) )
9494 yield return Tuples . cil_parameter_in ( pe ) ;
95- Attribute . Populate ( Cx , pe , p . GetCustomAttributes ( ) ) ;
95+ Attribute . Populate ( Context , pe , p . GetCustomAttributes ( ) ) ;
9696 }
9797
98- yield return Tuples . metadata_handle ( this , Cx . Assembly , MetadataTokens . GetToken ( handle ) ) ;
98+ yield return Tuples . metadata_handle ( this , Context . Assembly , MetadataTokens . GetToken ( handle ) ) ;
9999
100100 foreach ( var m in GetMethodExtractionProducts ( Name , declaringType , typeSignature . ReturnType ) )
101101 {
102102 yield return m ;
103103 }
104104
105105 yield return Tuples . cil_method_source_declaration ( this , this ) ;
106- yield return Tuples . cil_method_location ( this , Cx . Assembly ) ;
106+ yield return Tuples . cil_method_location ( this , Context . Assembly ) ;
107107
108108 if ( HasBytecode )
109109 {
110110 Implementation = new MethodImplementation ( this ) ;
111111 yield return Implementation ;
112112
113- var body = Cx . PeReader . GetMethodBody ( md . RelativeVirtualAddress ) ;
113+ var body = Context . PeReader . GetMethodBody ( md . RelativeVirtualAddress ) ;
114114
115115 if ( ! body . LocalSignature . IsNil )
116116 {
117- var locals = Cx . MdReader . GetStandaloneSignature ( body . LocalSignature ) ;
118- var localVariableTypes = locals . DecodeLocalSignature ( Cx . TypeSignatureDecoder , this ) ;
117+ var locals = Context . MdReader . GetStandaloneSignature ( body . LocalSignature ) ;
118+ var localVariableTypes = locals . DecodeLocalSignature ( Context . TypeSignatureDecoder , this ) ;
119119
120120 this . locals = new LocalVariable [ localVariableTypes . Length ] ;
121121
@@ -125,13 +125,13 @@ public override IEnumerable<IExtractionProduct> Contents
125125 if ( t is ByRefType brt )
126126 {
127127 t = brt . ElementType ;
128- this . locals [ l ] = Cx . Populate ( new LocalVariable ( Cx , Implementation , l , t ) ) ;
128+ this . locals [ l ] = Context . Populate ( new LocalVariable ( Context , Implementation , l , t ) ) ;
129129 yield return this . locals [ l ] ;
130130 yield return Tuples . cil_type_annotation ( this . locals [ l ] , TypeAnnotation . Ref ) ;
131131 }
132132 else
133133 {
134- this . locals [ l ] = Cx . Populate ( new LocalVariable ( Cx , Implementation , l , t ) ) ;
134+ this . locals [ l ] = Context . Populate ( new LocalVariable ( Context , Implementation , l , t ) ) ;
135135 yield return this . locals [ l ] ;
136136 }
137137 }
@@ -152,7 +152,7 @@ public override IEnumerable<IExtractionProduct> Contents
152152
153153 if ( methodDebugInformation != null )
154154 {
155- var sourceLocation = Cx . CreateSourceLocation ( methodDebugInformation . Location ) ;
155+ var sourceLocation = Context . CreateSourceLocation ( methodDebugInformation . Location ) ;
156156 yield return sourceLocation ;
157157 yield return Tuples . cil_method_location ( this , sourceLocation ) ;
158158 }
@@ -191,7 +191,7 @@ public override IEnumerable<IExtractionProduct> Contents
191191 yield return Tuples . cil_newslot ( this ) ;
192192
193193 // Populate attributes
194- Attribute . Populate ( Cx , this , md . GetCustomAttributes ( ) ) ;
194+ Attribute . Populate ( Context , this , md . GetCustomAttributes ( ) ) ;
195195 }
196196 }
197197
@@ -210,7 +210,7 @@ private IEnumerable<IExtractionProduct> Decode(byte[]? ilbytes, Dictionary<int,
210210 nextSequencePoint = methodDebugInformation . SequencePoints . GetEnumerator ( ) ;
211211 if ( nextSequencePoint . MoveNext ( ) )
212212 {
213- instructionLocation = Cx . CreateSourceLocation ( nextSequencePoint . Current . Location ) ;
213+ instructionLocation = Context . CreateSourceLocation ( nextSequencePoint . Current . Location ) ;
214214 yield return instructionLocation ;
215215 }
216216 else
@@ -222,12 +222,12 @@ private IEnumerable<IExtractionProduct> Decode(byte[]? ilbytes, Dictionary<int,
222222 var child = 0 ;
223223 for ( var offset = 0 ; offset < ( ilbytes ? . Length ?? 0 ) ; )
224224 {
225- var instruction = new Instruction ( Cx , this , ilbytes ! , offset , child ++ ) ;
225+ var instruction = new Instruction ( Context , this , ilbytes ! , offset , child ++ ) ;
226226 yield return instruction ;
227227
228228 if ( nextSequencePoint != null && offset >= nextSequencePoint . Current . Offset )
229229 {
230- instructionLocation = Cx . CreateSourceLocation ( nextSequencePoint . Current . Location ) ;
230+ instructionLocation = Context . CreateSourceLocation ( nextSequencePoint . Current . Location ) ;
231231 yield return instructionLocation ;
232232 if ( ! nextSequencePoint . MoveNext ( ) )
233233 nextSequencePoint = null ;
@@ -257,7 +257,7 @@ public IEnumerable<Instruction> DebugInstructions
257257 {
258258 if ( md . ImplAttributes == MethodImplAttributes . IL && md . RelativeVirtualAddress != 0 )
259259 {
260- var body = Cx . PeReader . GetMethodBody ( md . RelativeVirtualAddress ) ;
260+ var body = Context . PeReader . GetMethodBody ( md . RelativeVirtualAddress ) ;
261261
262262 var ilbytes = body . GetILBytes ( ) ;
263263
@@ -267,7 +267,7 @@ public IEnumerable<Instruction> DebugInstructions
267267 Instruction decoded ;
268268 try
269269 {
270- decoded = new Instruction ( Cx , this , ilbytes ! , offset , child ++ ) ;
270+ decoded = new Instruction ( Context , this , ilbytes ! , offset , child ++ ) ;
271271 offset += decoded . Width ;
272272 }
273273 catch // lgtm[cs/catch-of-all-exceptions]
0 commit comments