mirror of
https://github.com/github/codeql.git
synced 2026-01-30 14:52:57 +01:00
Merge pull request #507 from owen-mc/cache-tcontrolflownode
Cache TControlFlowNode
This commit is contained in:
@@ -61,6 +61,7 @@ private predicate isCond(Expr e) {
|
||||
* respectively, of the execution of the function and the loading of the file;
|
||||
* - Skip nodes that are semantic no-ops, but make CFG construction easier.
|
||||
*/
|
||||
cached
|
||||
newtype TControlFlowNode =
|
||||
/**
|
||||
* A control-flow node that represents the evaluation of an expression.
|
||||
|
||||
@@ -654,15 +654,15 @@ module IR {
|
||||
}
|
||||
|
||||
/** Holds if this extracts the `idx`th value of the result of `base`. */
|
||||
predicate extractsElement(Instruction base, int idx) { base = getBase() and idx = i }
|
||||
predicate extractsElement(Instruction base, int idx) { base = this.getBase() and idx = i }
|
||||
|
||||
override Type getResultType() {
|
||||
exists(CallExpr c | getBase() = evalExprInstruction(c) |
|
||||
exists(CallExpr c | this.getBase() = evalExprInstruction(c) |
|
||||
result = c.getTarget().getResultType(i)
|
||||
)
|
||||
or
|
||||
exists(TypeAssertExpr tae | getBase() = evalExprInstruction(tae) |
|
||||
result = tae.getType().(TupleType).getComponentType(i)
|
||||
exists(TypeAssertExpr tae | this.getBase() = evalExprInstruction(tae) |
|
||||
result = tae.getType().(TupleType).getComponentType(pragma[only_bind_into](i))
|
||||
)
|
||||
or
|
||||
exists(Type rangeType | rangeType = s.(RangeStmt).getDomain().getType().getUnderlyingType() |
|
||||
|
||||
Reference in New Issue
Block a user