C#: Add nomagic pragmas to fix performance issues

This commit is contained in:
Tamas Vajk
2020-11-26 10:15:18 +01:00
committed by Tom Hvitved
parent b20a08dbac
commit cf76d31161
3 changed files with 3 additions and 1 deletions

View File

@@ -237,6 +237,7 @@ class Parameter extends DotNet::Parameter, LocalScopeVariable, Attributable, Top
* The assigned arguments to `x` are `1` and `4`, the assigned argument to * The assigned arguments to `x` are `1` and `4`, the assigned argument to
* `y` is `5`, and the assigned arguments to `z` are `3` and `6`, respectively. * `y` is `5`, and the assigned arguments to `z` are `3` and `6`, respectively.
*/ */
pragma[nomagic]
Expr getAnAssignedArgument() { result = getCallable().getACall().getArgumentForParameter(this) } Expr getAnAssignedArgument() { result = getCallable().getACall().getArgumentForParameter(this) }
/** Holds if this parameter is potentially overwritten in the body of its callable. */ /** Holds if this parameter is potentially overwritten in the body of its callable. */

View File

@@ -77,7 +77,7 @@ abstract class StructuralComparisonConfiguration extends string {
private predicate sameByValue(Expr x, Expr y) { sameByValueAux(x, y, y.getValue()) } private predicate sameByValue(Expr x, Expr y) { sameByValueAux(x, y, y.getValue()) }
pragma[noinline] pragma[nomagic]
private predicate sameByValueAux(Expr x, Expr y, string value) { private predicate sameByValueAux(Expr x, Expr y, string value) {
candidateInternal(x, y) and candidateInternal(x, y) and
value = x.getValue() value = x.getValue()

View File

@@ -1248,6 +1248,7 @@ module Internal {
) )
} }
pragma[nomagic]
private Expr getAnEqualityCheckVal(Expr e, AbstractValue v, AbstractValue vExpr) { private Expr getAnEqualityCheckVal(Expr e, AbstractValue v, AbstractValue vExpr) {
result = getAnEqualityCheck(e, v, vExpr.getAnExpr()) result = getAnEqualityCheck(e, v, vExpr.getAnExpr())
} }