mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
C#: Merge expr_compiler_generated and compiler_generated and add compiler generated statements.
This commit is contained in:
@@ -54,7 +54,7 @@ namespace Semmle.Extraction.CSharp.Entities
|
||||
}
|
||||
|
||||
if (info.IsCompilerGenerated)
|
||||
trapFile.expr_compiler_generated(this);
|
||||
trapFile.compiler_generated(this);
|
||||
|
||||
if (info.ExprValue is string value)
|
||||
trapFile.expr_value(this, value);
|
||||
|
||||
@@ -9,12 +9,14 @@ namespace Semmle.Extraction.CSharp.Entities
|
||||
{
|
||||
protected readonly TSyntax Stmt;
|
||||
private readonly Location location;
|
||||
private readonly bool isCompilerGenerated;
|
||||
|
||||
protected Statement(Context cx, TSyntax stmt, Kinds.StmtKind kind, IStatementParentEntity parent, int child, Location location, bool isCompilerGenerated = false)
|
||||
: base(cx, kind, parent, child)
|
||||
{
|
||||
Stmt = stmt;
|
||||
this.location = location;
|
||||
this.isCompilerGenerated = isCompilerGenerated;
|
||||
if (!isCompilerGenerated)
|
||||
{
|
||||
cx.BindComments(this, location.Symbol);
|
||||
@@ -29,6 +31,11 @@ namespace Semmle.Extraction.CSharp.Entities
|
||||
base.Populate(trapFile);
|
||||
|
||||
trapFile.stmt_location(this, location);
|
||||
|
||||
if (isCompilerGenerated)
|
||||
{
|
||||
trapFile.compiler_generated(this);
|
||||
}
|
||||
}
|
||||
|
||||
public override Microsoft.CodeAnalysis.Location ReportingLocation => Stmt.GetLocation();
|
||||
|
||||
@@ -164,9 +164,6 @@ namespace Semmle.Extraction.CSharp
|
||||
internal static void expr_call(this TextWriter trapFile, Expression expr, Method target) =>
|
||||
trapFile.WriteTuple("expr_call", expr, target);
|
||||
|
||||
internal static void expr_compiler_generated(this TextWriter trapFile, Expression expr) =>
|
||||
trapFile.WriteTuple("expr_compiler_generated", expr);
|
||||
|
||||
internal static void expr_flowstate(this TextWriter trapFile, Expression expr, int flowState) =>
|
||||
trapFile.WriteTuple("expr_flowstate", expr, flowState);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user