Move location creation to instance method on context

This commit is contained in:
Tamas Vajk
2021-02-10 09:47:02 +01:00
parent 6f07230725
commit 4f693be33b
46 changed files with 85 additions and 95 deletions

View File

@@ -23,7 +23,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
{
public QueryCall(Context cx, IMethodSymbol method, SyntaxNode clause, IExpressionParentEntity parent, int child)
: base(new ExpressionInfo(cx, method?.GetAnnotatedReturnType(),
cx.Create(clause.GetLocation()),
cx.CreateLocation(clause.GetLocation()),
ExprKind.METHOD_INVOCATION, parent, child, false, null))
{
if (method != null)
@@ -89,7 +89,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
variableSymbol,
declType,
declTypeSyntax,
cx.Create(node.GetLocation()),
cx.CreateLocation(node.GetLocation()),
true,
parent,
child
@@ -97,7 +97,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
Expression.Create(cx, Expr, decl, 0);
var nameLoc = cx.Create(name.GetLocation());
var nameLoc = cx.CreateLocation(name.GetLocation());
var access = new Expression(new ExpressionInfo(cx, type, nameLoc, ExprKind.LOCAL_VARIABLE_ACCESS, decl, 1, false, null));
cx.TrapWriter.Writer.expr_access(access, LocalVariable.Create(cx, variableSymbol));