зеркало из https://github.com/github/codeql.git
C#: Rename some methods.
This commit is contained in:
Родитель
58e6d236ff
Коммит
bd1b0018b0
|
@ -384,7 +384,7 @@ namespace Semmle.Extraction.CSharp.Entities
|
|||
Parent = parent;
|
||||
Child = child;
|
||||
TypeInfo = typeInfo;
|
||||
Conversion = cx.Model(node).GetConversion(node);
|
||||
Conversion = cx.GetModel(node).GetConversion(node);
|
||||
}
|
||||
|
||||
public Context Context { get; }
|
||||
|
@ -443,7 +443,7 @@ namespace Semmle.Extraction.CSharp.Entities
|
|||
}
|
||||
}
|
||||
|
||||
public SemanticModel Model => Context.Model(Node);
|
||||
public SemanticModel Model => Context.GetModel(Node);
|
||||
|
||||
public string ExprValue
|
||||
{
|
||||
|
|
|
@ -103,7 +103,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
var child = 0;
|
||||
foreach (var i in Syntax.Expressions)
|
||||
{
|
||||
var collectionInfo = cx.Model(Syntax).GetCollectionInitializerSymbolInfo(i);
|
||||
var collectionInfo = cx.GetModel(Syntax).GetCollectionInitializerSymbolInfo(i);
|
||||
var addMethod = Method.Create(cx, collectionInfo.Symbol as IMethodSymbol);
|
||||
var voidType = Entities.Type.Create(cx, new AnnotatedTypeSymbol(cx.Compilation.GetSpecialType(SpecialType.System_Void), NullableAnnotation.NotApplicable));
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
if (target != null && !target.IsStatic)
|
||||
{
|
||||
// Implicit `this` qualifier; add explicitly
|
||||
var callingMethod = cx.Model(Syntax).GetEnclosingSymbol(Location.symbol.SourceSpan.Start) as IMethodSymbol;
|
||||
var callingMethod = cx.GetModel(Syntax).GetEnclosingSymbol(Location.symbol.SourceSpan.Start) as IMethodSymbol;
|
||||
|
||||
if (callingMethod == null)
|
||||
cx.ModelError(Syntax, "Couldn't determine implicit this type");
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
{
|
||||
if (declPattern.Designation is VariableDesignationSyntax designation)
|
||||
{
|
||||
if (cx.Model(syntax).GetDeclaredSymbol(designation) is ILocalSymbol symbol)
|
||||
if (cx.GetModel(syntax).GetDeclaredSymbol(designation) is ILocalSymbol symbol)
|
||||
{
|
||||
var type = Type.Create(cx, symbol.GetAnnotatedType());
|
||||
return VariableDeclaration.Create(cx, symbol, type, declPattern.Type, cx.Create(syntax.GetLocation()), cx.Create(designation.GetLocation()), false, parent, child);
|
||||
|
@ -43,7 +43,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
case ParenthesizedVariableDesignationSyntax parDesignation:
|
||||
return VariableDeclaration.CreateParenthesized(cx, varPattern, parDesignation, parent, child);
|
||||
case SingleVariableDesignationSyntax varDesignation:
|
||||
if (cx.Model(syntax).GetDeclaredSymbol(varDesignation) is ILocalSymbol symbol)
|
||||
if (cx.GetModel(syntax).GetDeclaredSymbol(varDesignation) is ILocalSymbol symbol)
|
||||
{
|
||||
var type = Type.Create(cx, symbol.GetAnnotatedType());
|
||||
|
||||
|
@ -111,7 +111,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
Expressions.TypeAccess.Create(cx, t, this, 1);
|
||||
|
||||
// Extract the local variable declaration
|
||||
if (syntax.Designation is VariableDesignationSyntax designation && cx.Model(syntax).GetDeclaredSymbol(designation) is ILocalSymbol symbol)
|
||||
if (syntax.Designation is VariableDesignationSyntax designation && cx.GetModel(syntax).GetDeclaredSymbol(designation) is ILocalSymbol symbol)
|
||||
{
|
||||
var type = Entities.Type.Create(cx, symbol.GetAnnotatedType());
|
||||
|
||||
|
@ -139,7 +139,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
private void PopulatePattern(PatternSyntax pattern, TypeSyntax optionalType, SyntaxToken varKeyword, VariableDesignationSyntax designation)
|
||||
{
|
||||
var isVar = optionalType is null;
|
||||
if (!(designation is null) && cx.Model(pattern).GetDeclaredSymbol(designation) is ILocalSymbol symbol)
|
||||
if (!(designation is null) && cx.GetModel(pattern).GetDeclaredSymbol(designation) is ILocalSymbol symbol)
|
||||
{
|
||||
var type = Entities.Type.Create(cx, symbol.GetAnnotatedType());
|
||||
VariableDeclaration.Create(cx, symbol, type, optionalType, cx.Create(pattern.GetLocation()), cx.Create(designation.GetLocation()), isVar, this, 1);
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
|
||||
void VisitParameter(ParameterSyntax p)
|
||||
{
|
||||
var symbol = cx.Model(p).GetDeclaredSymbol(p);
|
||||
var symbol = cx.GetModel(p).GetDeclaredSymbol(p);
|
||||
Parameter.Create(cx, symbol, this);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
|
||||
static ExprKind GetKind(Context cx, ObjectCreationExpressionSyntax node)
|
||||
{
|
||||
var si = cx.Model(node).GetSymbolInfo(node.Type);
|
||||
var si = cx.GetModel(node).GetSymbolInfo(node.Type);
|
||||
return Entities.Type.IsDelegate(si.Symbol as INamedTypeSymbol) ? ExprKind.EXPLICIT_DELEGATE_CREATION : ExprKind.OBJECT_CREATION;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
PopulateArguments(Syntax.ArgumentList, 0);
|
||||
}
|
||||
|
||||
var target = cx.Model(Syntax).GetSymbolInfo(Syntax);
|
||||
var target = cx.GetModel(Syntax).GetSymbolInfo(Syntax);
|
||||
var method = (IMethodSymbol)target.Symbol;
|
||||
|
||||
if (method != null)
|
||||
|
@ -119,7 +119,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
foreach (var init in Syntax.Initializers)
|
||||
{
|
||||
// Create an "assignment"
|
||||
var property = cx.Model(init).GetDeclaredSymbol(init);
|
||||
var property = cx.GetModel(init).GetDeclaredSymbol(init);
|
||||
var propEntity = Property.Create(cx, property);
|
||||
var type = Entities.Type.Create(cx, property.GetAnnotatedType());
|
||||
var loc = cx.Create(init.GetLocation());
|
||||
|
|
|
@ -197,14 +197,14 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
/// <returns>A "syntax tree" of the query.</returns>
|
||||
static Clause ConstructQueryExpression(Context cx, QueryExpressionSyntax node)
|
||||
{
|
||||
var info = cx.Model(node).GetQueryClauseInfo(node.FromClause);
|
||||
var info = cx.GetModel(node).GetQueryClauseInfo(node.FromClause);
|
||||
var method = info.OperationInfo.Symbol as IMethodSymbol;
|
||||
|
||||
Clause clauseExpr = new RangeClause(method, node.FromClause, cx.Model(node).GetDeclaredSymbol(node.FromClause), node.FromClause.Identifier).AddArgument(node.FromClause.Expression);
|
||||
Clause clauseExpr = new RangeClause(method, node.FromClause, cx.GetModel(node).GetDeclaredSymbol(node.FromClause), node.FromClause.Identifier).AddArgument(node.FromClause.Expression);
|
||||
|
||||
foreach (var qc in node.Body.Clauses)
|
||||
{
|
||||
info = cx.Model(node).GetQueryClauseInfo(qc);
|
||||
info = cx.GetModel(node).GetQueryClauseInfo(qc);
|
||||
|
||||
method = info.OperationInfo.Symbol as IMethodSymbol;
|
||||
|
||||
|
@ -214,7 +214,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
var orderByClause = (OrderByClauseSyntax)qc;
|
||||
foreach (var ordering in orderByClause.Orderings)
|
||||
{
|
||||
method = cx.Model(node).GetSymbolInfo(ordering).Symbol as IMethodSymbol;
|
||||
method = cx.GetModel(node).GetSymbolInfo(ordering).Symbol as IMethodSymbol;
|
||||
|
||||
clauseExpr = clauseExpr.WithCallClause(method, orderByClause).AddArgument(ordering.Expression);
|
||||
|
||||
|
@ -229,25 +229,25 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
case SyntaxKind.FromClause:
|
||||
var fromClause = (FromClauseSyntax)qc;
|
||||
clauseExpr = clauseExpr.
|
||||
WithLetClause(method, fromClause, cx.Model(node).GetDeclaredSymbol(fromClause), fromClause.Identifier).
|
||||
WithLetClause(method, fromClause, cx.GetModel(node).GetDeclaredSymbol(fromClause), fromClause.Identifier).
|
||||
AddArgument(fromClause.Expression);
|
||||
break;
|
||||
case SyntaxKind.LetClause:
|
||||
var letClause = (LetClauseSyntax)qc;
|
||||
clauseExpr = clauseExpr.WithLetClause(method, letClause, cx.Model(node).GetDeclaredSymbol(letClause), letClause.Identifier).
|
||||
clauseExpr = clauseExpr.WithLetClause(method, letClause, cx.GetModel(node).GetDeclaredSymbol(letClause), letClause.Identifier).
|
||||
AddArgument(letClause.Expression);
|
||||
break;
|
||||
case SyntaxKind.JoinClause:
|
||||
var joinClause = (JoinClauseSyntax)qc;
|
||||
|
||||
clauseExpr = clauseExpr.WithLetClause(method, joinClause, cx.Model(node).GetDeclaredSymbol(joinClause), joinClause.Identifier).
|
||||
clauseExpr = clauseExpr.WithLetClause(method, joinClause, cx.GetModel(node).GetDeclaredSymbol(joinClause), joinClause.Identifier).
|
||||
AddArgument(joinClause.InExpression).
|
||||
AddArgument(joinClause.LeftExpression).
|
||||
AddArgument(joinClause.RightExpression);
|
||||
|
||||
if (joinClause.Into != null)
|
||||
{
|
||||
var into = cx.Model(node).GetDeclaredSymbol(joinClause.Into);
|
||||
var into = cx.GetModel(node).GetDeclaredSymbol(joinClause.Into);
|
||||
((LetClause)clauseExpr).WithInto(into);
|
||||
}
|
||||
|
||||
|
@ -257,7 +257,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
}
|
||||
}
|
||||
|
||||
method = cx.Model(node).GetSymbolInfo(node.Body.SelectOrGroup).Symbol as IMethodSymbol;
|
||||
method = cx.GetModel(node).GetSymbolInfo(node.Body.SelectOrGroup).Symbol as IMethodSymbol;
|
||||
|
||||
clauseExpr = new CallClause(clauseExpr, method, node.Body.SelectOrGroup);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
{
|
||||
bool isVar = node.Type.IsVar;
|
||||
|
||||
var variableSymbol = cx.Model(designation).GetDeclaredSymbol(designation) as ILocalSymbol;
|
||||
var variableSymbol = cx.GetModel(designation).GetDeclaredSymbol(designation) as ILocalSymbol;
|
||||
if (variableSymbol == null)
|
||||
{
|
||||
cx.ModelError(node, "Failed to determine local variable");
|
||||
|
@ -76,7 +76,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
CreateParenthesized(cx, varPattern, paren, tuple, child0++);
|
||||
break;
|
||||
case SingleVariableDesignationSyntax single:
|
||||
if (cx.Model(variable).GetDeclaredSymbol(single) is ILocalSymbol local)
|
||||
if (cx.GetModel(variable).GetDeclaredSymbol(single) is ILocalSymbol local)
|
||||
{
|
||||
var decl = Create(cx, variable, Entities.Type.Create(cx, local.GetAnnotatedType()), true, tuple, child0++);
|
||||
var id = single.Identifier;
|
||||
|
@ -126,13 +126,13 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
|
||||
public static VariableDeclaration Create(Context cx, CatchDeclarationSyntax d, bool isVar, IExpressionParentEntity parent, int child)
|
||||
{
|
||||
var symbol = cx.Model(d).GetDeclaredSymbol(d);
|
||||
var symbol = cx.GetModel(d).GetDeclaredSymbol(d);
|
||||
var type = Entities.Type.Create(cx, symbol.GetAnnotatedType());
|
||||
var ret = Create(cx, d, type, isVar, parent, child);
|
||||
cx.Try(d, null, () =>
|
||||
{
|
||||
var id = d.Identifier;
|
||||
var declSymbol = cx.Model(d).GetDeclaredSymbol(d);
|
||||
var declSymbol = cx.GetModel(d).GetDeclaredSymbol(d);
|
||||
var location = cx.Create(id.GetLocation());
|
||||
LocalVariable.Create(cx, declSymbol, ret, isVar, location);
|
||||
TypeMention.Create(cx, d.Type, ret, type);
|
||||
|
@ -146,7 +146,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
|
|||
cx.Try(d, null, () =>
|
||||
{
|
||||
var id = d.Identifier;
|
||||
var declSymbol = cx.Model(d).GetDeclaredSymbol(d);
|
||||
var declSymbol = cx.GetModel(d).GetDeclaredSymbol(d);
|
||||
var location = cx.Create(id.GetLocation());
|
||||
var localVar = LocalVariable.Create(cx, declSymbol, ret, isVar, location);
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace Semmle.Extraction.CSharp.Entities
|
|||
public NamespaceDeclaration(Context cx, NamespaceDeclarationSyntax node, NamespaceDeclaration parent)
|
||||
: base(cx)
|
||||
{
|
||||
var ns = Namespace.Create(cx, (INamespaceSymbol)cx.Model(node).GetSymbolInfo(node.Name).Symbol);
|
||||
var ns = Namespace.Create(cx, (INamespaceSymbol)cx.GetModel(node).GetSymbolInfo(node.Name).Symbol);
|
||||
cx.Emit(Tuples.namespace_declarations(this, ns));
|
||||
cx.Emit(Tuples.namespace_declaration_location(this, cx.Create(node.Name.GetLocation())));
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace Semmle.Extraction.CSharp.Entities.Statements
|
|||
{
|
||||
var value = Stmt.Value;
|
||||
Expression.Create(cx, value, this, 0);
|
||||
Switch.LabelForValue(cx.Model(Stmt).GetConstantValue(value).Value);
|
||||
Switch.LabelForValue(cx.GetModel(Stmt).GetConstantValue(value).Value);
|
||||
}
|
||||
|
||||
public static CaseLabel Create(Context cx, CaseSwitchLabelSyntax node, Switch parent, int child)
|
||||
|
@ -73,7 +73,7 @@ namespace Semmle.Extraction.CSharp.Entities.Statements
|
|||
switch (designation)
|
||||
{
|
||||
case SingleVariableDesignationSyntax _:
|
||||
if (cx.Model(pattern).GetDeclaredSymbol(designation) is ILocalSymbol symbol)
|
||||
if (cx.GetModel(pattern).GetDeclaredSymbol(designation) is ILocalSymbol symbol)
|
||||
{
|
||||
var type = Type.Create(cx, symbol.GetAnnotatedType());
|
||||
Expressions.VariableDeclaration.Create(cx, symbol, type, optionalType, cx.Create(pattern.GetLocation()), cx.Create(designation.GetLocation()), isVar, this, 0);
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace Semmle.Extraction.CSharp.Entities.Statements
|
|||
{
|
||||
Expression.Create(cx, Stmt.Expression, this, 1);
|
||||
|
||||
var typeSymbol = cx.Model(Stmt).GetDeclaredSymbol(Stmt);
|
||||
var typeSymbol = cx.GetModel(Stmt).GetDeclaredSymbol(Stmt);
|
||||
var type = Type.Create(cx, typeSymbol.GetAnnotatedType());
|
||||
|
||||
var location = cx.Create(Stmt.Identifier.GetLocation());
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace Semmle.Extraction.CSharp.Entities.Statements
|
|||
break;
|
||||
case StmtKind.GOTO_CASE:
|
||||
Expr = Expression.Create(cx, Stmt.Expression, this, 0);
|
||||
ConstantValue = Switch.LabelForValue(cx.Model(Stmt).GetConstantValue(Stmt.Expression).Value);
|
||||
ConstantValue = Switch.LabelForValue(cx.GetModel(Stmt).GetConstantValue(Stmt.Expression).Value);
|
||||
break;
|
||||
case StmtKind.GOTO_DEFAULT:
|
||||
ConstantValue = Switch.DefaultLabel;
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace Semmle.Extraction.CSharp.Entities.Statements
|
|||
// the right thing but it doesn't exist.
|
||||
// So instead, we have to do the lookup via GetEnclosingSymbol.
|
||||
|
||||
var m = cx.Model(Stmt);
|
||||
var m = cx.GetModel(Stmt);
|
||||
var body = Stmt.Body == null ? Stmt.ExpressionBody : (CSharpSyntaxNode)Stmt.Body;
|
||||
return m.GetEnclosingSymbol(body.GetLocation().SourceSpan.Start) as IMethodSymbol;
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ namespace Semmle.Extraction.CSharp.Entities
|
|||
TypeMention.Create(Context, clause.Name, this, this);
|
||||
foreach (var constraint in clause.Constraints.OfType<TypeConstraintSyntax>())
|
||||
{
|
||||
var ti = Context.Model(constraint).GetTypeInfo(constraint.Type);
|
||||
var ti = Context.GetModel(constraint).GetTypeInfo(constraint.Type);
|
||||
var target = Type.Create(Context, ti.Type);
|
||||
TypeMention.Create(Context, constraint.Type, this, target);
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Semmle.Extraction.CSharp.Entities
|
|||
: base(cx)
|
||||
{
|
||||
node = usingDirective;
|
||||
var info = cx.Model(node).GetSymbolInfo(usingDirective.Name);
|
||||
var info = cx.GetModel(node).GetSymbolInfo(usingDirective.Name);
|
||||
|
||||
if (usingDirective.StaticKeyword.Kind() == SyntaxKind.None)
|
||||
{
|
||||
|
|
|
@ -25,27 +25,27 @@ namespace Semmle.Extraction.CSharp.Populators
|
|||
|
||||
public override void VisitDelegateDeclaration(DelegateDeclarationSyntax node)
|
||||
{
|
||||
Entities.NamedType.Create(cx, cx.Model(node).GetDeclaredSymbol(node)).ExtractRecursive(parent);
|
||||
Entities.NamedType.Create(cx, cx.GetModel(node).GetDeclaredSymbol(node)).ExtractRecursive(parent);
|
||||
}
|
||||
|
||||
public override void VisitClassDeclaration(ClassDeclarationSyntax classDecl)
|
||||
{
|
||||
Entities.Type.Create(cx, cx.Model(classDecl).GetDeclaredSymbol(classDecl)).ExtractRecursive(parent);
|
||||
Entities.Type.Create(cx, cx.GetModel(classDecl).GetDeclaredSymbol(classDecl)).ExtractRecursive(parent);
|
||||
}
|
||||
|
||||
public override void VisitStructDeclaration(StructDeclarationSyntax node)
|
||||
{
|
||||
Entities.Type.Create(cx, cx.Model(node).GetDeclaredSymbol(node)).ExtractRecursive(parent);
|
||||
Entities.Type.Create(cx, cx.GetModel(node).GetDeclaredSymbol(node)).ExtractRecursive(parent);
|
||||
}
|
||||
|
||||
public override void VisitEnumDeclaration(EnumDeclarationSyntax node)
|
||||
{
|
||||
Entities.Type.Create(cx, cx.Model(node).GetDeclaredSymbol(node)).ExtractRecursive(parent);
|
||||
Entities.Type.Create(cx, cx.GetModel(node).GetDeclaredSymbol(node)).ExtractRecursive(parent);
|
||||
}
|
||||
|
||||
public override void VisitInterfaceDeclaration(InterfaceDeclarationSyntax node)
|
||||
{
|
||||
Entities.Type.Create(cx, cx.Model(node).GetDeclaredSymbol(node)).ExtractRecursive(parent);
|
||||
Entities.Type.Create(cx, cx.GetModel(node).GetDeclaredSymbol(node)).ExtractRecursive(parent);
|
||||
}
|
||||
|
||||
public override void VisitAttributeList(AttributeListSyntax node)
|
||||
|
|
|
@ -435,10 +435,10 @@ namespace Semmle.Extraction.CSharp
|
|||
}
|
||||
|
||||
public static TypeInfo GetTypeInfo(this Context cx, Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode node) =>
|
||||
cx.Model(node).GetTypeInfo(node);
|
||||
cx.GetModel(node).GetTypeInfo(node);
|
||||
|
||||
public static SymbolInfo GetSymbolInfo(this Context cx, Microsoft.CodeAnalysis.CSharp.CSharpSyntaxNode node) =>
|
||||
cx.Model(node).GetSymbolInfo(node);
|
||||
cx.GetModel(node).GetSymbolInfo(node);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the symbol for a particular syntax node.
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Semmle.Extraction
|
|||
public class Context
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface to various extraction functions, e.g. logger, trap writer.
|
||||
/// Access various extraction functions, e.g. logger, trap writer.
|
||||
/// </summary>
|
||||
public readonly IExtractor Extractor;
|
||||
|
||||
|
@ -23,7 +23,7 @@ namespace Semmle.Extraction
|
|||
/// The program database provided by Roslyn.
|
||||
/// There's one per syntax tree, which makes things awkward.
|
||||
/// </summary>
|
||||
public SemanticModel Model(SyntaxNode node)
|
||||
public SemanticModel GetModel(SyntaxNode node)
|
||||
{
|
||||
if (cachedModel == null || node.SyntaxTree != cachedModel.SyntaxTree)
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ namespace Semmle.Extraction
|
|||
/// </summary>
|
||||
public readonly TrapWriter TrapWriter;
|
||||
|
||||
int NewId() => TrapWriter.IdCounter++;
|
||||
int GetNewId() => TrapWriter.IdCounter++;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new entity using the factory.
|
||||
|
@ -77,7 +77,7 @@ namespace Semmle.Extraction
|
|||
#if DEBUG_LABELS
|
||||
CheckEntityHasUniqueLabel(id, entity);
|
||||
#endif
|
||||
label = new Label(NewId());
|
||||
label = new Label(GetNewId());
|
||||
entity.Label = label;
|
||||
entityLabelCache[entity] = label;
|
||||
DefineLabel(label, id);
|
||||
|
@ -109,7 +109,7 @@ namespace Semmle.Extraction
|
|||
|
||||
using (StackGuard)
|
||||
{
|
||||
var label = new Label(NewId());
|
||||
var label = new Label(GetNewId());
|
||||
var entity = factory.Create(this, init);
|
||||
entity.Label = label;
|
||||
|
||||
|
@ -158,7 +158,7 @@ namespace Semmle.Extraction
|
|||
/// </summary>
|
||||
public void AddFreshLabel(IEntity entity)
|
||||
{
|
||||
var label = new Label(NewId());
|
||||
var label = new Label(GetNewId());
|
||||
TrapWriter.Emit(new DefineFreshLabelEmitter(label));
|
||||
entity.Label = label;
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ namespace Semmle.Extraction
|
|||
|
||||
public void DefineLabel(IEntity entity)
|
||||
{
|
||||
entity.Label = new Label(NewId());
|
||||
entity.Label = new Label(GetNewId());
|
||||
DefineLabel(entity.Label, entity.Id);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ namespace Semmle.Extraction
|
|||
{
|
||||
/// <summary>
|
||||
/// The label of the entity, as it is in the trap file.
|
||||
/// For example, "#123".
|
||||
/// </summary>
|
||||
Label Label { set; get; }
|
||||
|
||||
|
@ -35,6 +36,9 @@ namespace Semmle.Extraction
|
|||
/// </summary>
|
||||
Location ReportingLocation { get; }
|
||||
|
||||
/// <summary>
|
||||
/// How the entity handles .push and .pop.
|
||||
/// </summary>
|
||||
TrapStackBehaviour TrapStackBehaviour { get; }
|
||||
}
|
||||
|
||||
|
|
|
@ -52,8 +52,7 @@ namespace Semmle.Extraction
|
|||
readonly IdTrapBuilder TrapBuilder;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new key by concatenating the contents of the supplied
|
||||
/// arguments.
|
||||
/// Creates a new key by concatenating the contents of the supplied arguments.
|
||||
/// </summary>
|
||||
public Key(params object[] args)
|
||||
{
|
||||
|
|
|
@ -31,8 +31,8 @@ namespace Semmle.Extraction
|
|||
}
|
||||
|
||||
public Location Location { get; }
|
||||
public string Text;
|
||||
public string EntityText;
|
||||
public string Text { get; }
|
||||
public string EntityText { get; }
|
||||
|
||||
public override string Message => Text;
|
||||
}
|
||||
|
|
|
@ -3,8 +3,7 @@ using System.Linq;
|
|||
namespace Semmle.Extraction
|
||||
{
|
||||
/// <summary>
|
||||
/// A tuple represents a string of the form "a(b,c,d)"
|
||||
/// Its purpose is mainly to make various method calls typesafe.
|
||||
/// A tuple represents a string of the form "a(b,c,d)".
|
||||
/// </summary>
|
||||
public struct Tuple : ITrapEmitter
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче