Skip to content

Commit 6f555f3

Browse files
committed
Merge branch 'main' into rust-improve-cfg
2 parents db351bd + 24a1012 commit 6f555f3

File tree

1,546 files changed

+10717
-9981
lines changed

Some content is hidden

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

1,546 files changed

+10717
-9981
lines changed

csharp/downgrades/a2bda57dbc6eea94c50128522aae536e8edd5a3c/old.dbscheme

Lines changed: 1459 additions & 0 deletions
Large diffs are not rendered by default.

csharp/downgrades/a2bda57dbc6eea94c50128522aae536e8edd5a3c/semmlecode.csharp.dbscheme

Lines changed: 2099 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
description: Add `cil` and `dotnet` related relations and types.
2+
compatibility: backwards

csharp/extractor/Semmle.Extraction.CSharp/Entities/CachedSymbol.cs

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -144,50 +144,5 @@ public ExpressionSyntax? ExpressionBody
144144
public override bool NeedsPopulation => Context.Defines(Symbol);
145145

146146
public Extraction.Entities.Location Location => Context.CreateLocation(ReportingLocation);
147-
148-
protected void PopulateMetadataHandle(TextWriter trapFile)
149-
{
150-
var handle = MetadataHandle;
151-
152-
if (handle.HasValue)
153-
trapFile.metadata_handle(this, Location, MetadataTokens.GetToken(handle.Value));
154-
}
155-
156-
private static System.Reflection.PropertyInfo? GetPropertyInfo(object o, string name)
157-
{
158-
return o.GetType().GetProperty(name, System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.GetProperty);
159-
}
160-
161-
public Handle? MetadataHandle
162-
{
163-
get
164-
{
165-
var handleProp = GetPropertyInfo(Symbol, "Handle");
166-
object handleObj = Symbol;
167-
168-
if (handleProp is null)
169-
{
170-
var underlyingSymbolProp = GetPropertyInfo(Symbol, "UnderlyingSymbol");
171-
if (underlyingSymbolProp?.GetValue(Symbol) is object underlying)
172-
{
173-
handleProp = GetPropertyInfo(underlying, "Handle");
174-
handleObj = underlying;
175-
}
176-
}
177-
178-
if (handleProp is not null)
179-
{
180-
switch (handleProp.GetValue(handleObj))
181-
{
182-
case MethodDefinitionHandle md: return md;
183-
case TypeDefinitionHandle td: return td;
184-
case PropertyDefinitionHandle pd: return pd;
185-
case FieldDefinitionHandle fd: return fd;
186-
}
187-
}
188-
189-
return null;
190-
}
191-
}
192147
}
193148
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ private Field(Context cx, IFieldSymbol init)
2626

2727
public override void Populate(TextWriter trapFile)
2828
{
29-
PopulateMetadataHandle(trapFile);
3029
PopulateAttributes();
3130
ContainingType!.PopulateGenerics();
3231
PopulateNullability(trapFile, Symbol.GetAnnotatedType());

csharp/extractor/Semmle.Extraction.CSharp/Entities/Method.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ protected void PopulateMethod(TextWriter trapFile)
360360
PopulateParameters();
361361
PopulateMethodBody(trapFile);
362362
PopulateGenerics(trapFile);
363-
PopulateMetadataHandle(trapFile);
364363
PopulateNullability(trapFile, Symbol.GetAnnotatedReturnType());
365364
}
366365

csharp/extractor/Semmle.Extraction.CSharp/Entities/Property.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ public override void WriteId(EscapingTextWriter trapFile)
3434

3535
public override void Populate(TextWriter trapFile)
3636
{
37-
PopulateMetadataHandle(trapFile);
3837
PopulateAttributes();
3938
PopulateModifiers(trapFile);
4039
BindComments();

csharp/extractor/Semmle.Extraction.CSharp/Entities/Types/Type.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ public Kinds.TypeKind GetTypeKind(Context cx, bool constructUnderlyingTupleType)
7777

7878
protected void PopulateType(TextWriter trapFile, bool constructUnderlyingTupleType = false)
7979
{
80-
PopulateMetadataHandle(trapFile);
8180
PopulateAttributes();
8281

8382
trapFile.Write("types(");

csharp/extractor/Semmle.Extraction.CSharp/Tuples.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,6 @@ internal static void localvar_location(this TextWriter trapFile, LocalVariable v
233233
internal static void localvars(this TextWriter trapFile, LocalVariable key, VariableKind kind, string name, int @var, Type type, Expression expr) =>
234234
trapFile.WriteTuple("localvars", key, (int)kind, name, @var, type, expr);
235235

236-
public static void metadata_handle(this TextWriter trapFile, IEntity entity, Location assembly, int handleValue) =>
237-
trapFile.WriteTuple("metadata_handle", entity, assembly, handleValue);
238-
239236
internal static void method_location(this TextWriter trapFile, Method method, Location location) =>
240237
trapFile.WriteTuple("method_location", method, location);
241238

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: breaking
3+
---
4+
* C#: Remove all CIL tables and related QL library functionality.

0 commit comments

Comments
 (0)