Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ module SemanticExprConfig {

newtype TSsaVariable =
TSsaInstruction(IR::Instruction instr) { instr.hasMemoryResult() } or
TSsaOperand(IR::Operand op) { op.isDefinitionInexact() }
TSsaOperand(IR::PhiInputOperand op) { op.isDefinitionInexact() }

class SsaVariable extends TSsaVariable {
string toString() { none() }
Expand All @@ -139,7 +139,7 @@ module SemanticExprConfig {

IR::Instruction asInstruction() { none() }

IR::Operand asOperand() { none() }
IR::PhiInputOperand asOperand() { none() }
}

class SsaInstructionVariable extends SsaVariable, TSsaInstruction {
Expand All @@ -155,15 +155,15 @@ module SemanticExprConfig {
}

class SsaOperand extends SsaVariable, TSsaOperand {
IR::Operand op;
IR::PhiInputOperand op;

SsaOperand() { this = TSsaOperand(op) }

final override string toString() { result = op.toString() }

final override Location getLocation() { result = op.getLocation() }

final override IR::Operand asOperand() { result = op }
final override IR::PhiInputOperand asOperand() { result = op }
}

predicate explicitUpdate(SsaVariable v, Expr sourceExpr) {
Expand All @@ -190,12 +190,14 @@ module SemanticExprConfig {

SemType getSsaVariableType(SsaVariable v) {
result = getSemanticType(v.asInstruction().getResultIRType())
or
result = getSemanticType(v.asOperand().getUse().getResultIRType())
}

BasicBlock getSsaVariableBasicBlock(SsaVariable v) {
result = v.asInstruction().getBlock()
or
result = v.asOperand().getUse().getBlock()
result = v.asOperand().getAnyDef().getBlock()
}

/** Holds if `inp` is an input to the phi node along the edge originating in `bb`. */
Expand Down