Skip to content

Commit 9ab930f

Browse files
committed
C#: Remove marker interfaces from CIL extraction
1 parent df28544 commit 9ab930f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+97
-272
lines changed

csharp/extractor/Semmle.Extraction.CIL/Factories.cs renamed to csharp/extractor/Semmle.Extraction.CIL/Context.Factories.cs

File renamed without changes.

csharp/extractor/Semmle.Extraction.CIL/Context.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public Entities.Type ErrorType
110110
/// </summary>
111111
/// <param name="handle">The handle of the method.</param>
112112
/// <returns>The debugging information, or null if the information could not be located.</returns>
113-
public PDB.IMethod? GetMethodDebugInformation(MethodDefinitionHandle handle)
113+
public PDB.Method? GetMethodDebugInformation(MethodDefinitionHandle handle)
114114
{
115115
return Pdb?.GetMethod(handle.ToDebugInformationHandle());
116116
}

csharp/extractor/Semmle.Extraction.CIL/Entities/ArrayType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Semmle.Extraction.CIL.Entities
77
/// <summary>
88
/// An array type.
99
/// </summary>
10-
internal sealed class ArrayType : Type, IArrayType
10+
internal sealed class ArrayType : Type
1111
{
1212
private readonly Type elementType;
1313
private readonly int rank;

csharp/extractor/Semmle.Extraction.CIL/Entities/Assembly.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Semmle.Extraction.CIL.Entities
1212
/// <summary>
1313
/// An assembly to extract.
1414
/// </summary>
15-
public class Assembly : LabelledEntity, IAssembly
15+
public class Assembly : LabelledEntity, ILocation
1616
{
1717
private readonly File file;
1818
private readonly AssemblyName assemblyName;

csharp/extractor/Semmle.Extraction.CIL/Entities/Attribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Semmle.Extraction.CIL.Entities
77
/// <summary>
88
/// Entity representing a CIL attribute.
99
/// </summary>
10-
internal sealed class Attribute : UnlabelledEntity, IAttribute
10+
internal sealed class Attribute : UnlabelledEntity
1111
{
1212
private readonly CustomAttributeHandle handle;
1313
private readonly CustomAttribute attrib;

csharp/extractor/Semmle.Extraction.CIL/Entities/DefinitionMethod.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ namespace Semmle.Extraction.CIL.Entities
99
/// <summary>
1010
/// A definition method - a method defined in the current assembly.
1111
/// </summary>
12-
internal sealed class DefinitionMethod : Method, IMember
12+
internal sealed class DefinitionMethod : Method
1313
{
1414
private readonly Handle handle;
1515
private readonly MethodDefinition md;
16-
private readonly PDB.IMethod? methodDebugInformation;
16+
private readonly PDB.Method? methodDebugInformation;
1717
private readonly Type declaringType;
1818

1919
private readonly string name;
@@ -120,7 +120,7 @@ public override IEnumerable<IExtractionProduct> Contents
120120
}
121121
}
122122

123-
var jump_table = new Dictionary<int, IInstruction>();
123+
var jump_table = new Dictionary<int, Instruction>();
124124

125125
foreach (var c in Decode(body.GetILBytes(), jump_table))
126126
yield return c;
@@ -178,7 +178,7 @@ public override IEnumerable<IExtractionProduct> Contents
178178
}
179179
}
180180

181-
private IEnumerable<IExtractionProduct> Decode(byte[] ilbytes, Dictionary<int, IInstruction> jump_table)
181+
private IEnumerable<IExtractionProduct> Decode(byte[] ilbytes, Dictionary<int, Instruction> jump_table)
182182
{
183183
// Sequence points are stored in order of offset.
184184
// We use an enumerator to locate the correct sequence point for each instruction.

csharp/extractor/Semmle.Extraction.CIL/Entities/Event.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace Semmle.Extraction.CIL.Entities
77
/// <summary>
88
/// An event entity.
99
/// </summary>
10-
internal sealed class Event : LabelledEntity, IEvent
10+
internal sealed class Event : LabelledEntity
1111
{
1212
private readonly EventDefinitionHandle handle;
1313
private readonly Type parent;

csharp/extractor/Semmle.Extraction.CIL/Entities/ExceptionRegion.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ namespace Semmle.Extraction.CIL.Entities
55
/// <summary>
66
/// An exception region entity.
77
/// </summary>
8-
internal class ExceptionRegion : UnlabelledEntity, IExceptionRegion
8+
internal class ExceptionRegion : UnlabelledEntity
99
{
1010
private readonly GenericContext gc;
1111
private readonly MethodImplementation method;
1212
private readonly int index;
1313
private readonly System.Reflection.Metadata.ExceptionRegion r;
14-
private readonly Dictionary<int, IInstruction> jump_table;
14+
private readonly Dictionary<int, Instruction> jump_table;
1515

16-
public ExceptionRegion(GenericContext gc, MethodImplementation method, int index, System.Reflection.Metadata.ExceptionRegion r, Dictionary<int, IInstruction> jump_table) : base(gc.Cx)
16+
public ExceptionRegion(GenericContext gc, MethodImplementation method, int index, System.Reflection.Metadata.ExceptionRegion r, Dictionary<int, Instruction> jump_table) : base(gc.Cx)
1717
{
1818
this.gc = gc;
1919
this.method = method;

csharp/extractor/Semmle.Extraction.CIL/Entities/Field.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Semmle.Extraction.CIL.Entities
88
/// <summary>
99
/// An entity representing a field.
1010
/// </summary>
11-
internal abstract class Field : GenericContext, IField
11+
internal abstract class Field : GenericContext, IMember
1212
{
1313
protected Field(Context cx) : base(cx)
1414
{

csharp/extractor/Semmle.Extraction.CIL/Entities/File.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Semmle.Extraction.CIL.Entities
55
{
6-
public class File : LabelledEntity, IFile
6+
public class File : LabelledEntity, IFileOrFolder
77
{
88
protected string OriginalPath { get; }
99
protected PathTransformer.ITransformedPath TransformedPath { get; }

0 commit comments

Comments
 (0)