C++: autoformat Operand.qll

This commit is contained in:
Robert Marsh
2021-03-01 11:13:04 -08:00
parent 290b1c624e
commit 2b382d588a
5 changed files with 50 additions and 25 deletions

View File

@@ -25,7 +25,8 @@ private class TStageOperand =
* (the defining instruction) in another instruction (the use instruction)
*/
class Operand extends TStageOperand {
cached Operand() {
cached
Operand() {
// Ensure that the operand does not refer to instructions from earlier stages that are unreachable here
exists(Instruction use, Instruction def | this = registerOperand(use, _, def)) or
exists(Instruction use | this = nonSSAMemoryOperand(use, _)) or
@@ -190,7 +191,8 @@ class Operand extends TStageOperand {
* An operand that consumes a memory result (e.g. the `LoadOperand` on a `Load` instruction).
*/
class MemoryOperand extends Operand {
cached MemoryOperand() {
cached
MemoryOperand() {
this instanceof TNonSSAMemoryOperand or
this instanceof TPhiOperand or
this instanceof TChiOperand
@@ -256,7 +258,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
override RegisterOperandTag tag;
Instruction defInstr;
cached RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
cached
RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
final override string toString() { result = tag.toString() }
@@ -274,7 +277,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOperand {
override MemoryOperandTag tag;
cached NonPhiMemoryOperand() {
cached
NonPhiMemoryOperand() {
this = nonSSAMemoryOperand(useInstr, tag)
or
this = chiOperand(useInstr, tag)
@@ -426,7 +430,8 @@ class PhiInputOperand extends MemoryOperand, TPhiOperand {
IRBlock predecessorBlock;
Overlap overlap;
cached PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
cached
PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
override string toString() { result = "Phi" }

View File

@@ -25,7 +25,8 @@ private class TStageOperand =
* (the defining instruction) in another instruction (the use instruction)
*/
class Operand extends TStageOperand {
cached Operand() {
cached
Operand() {
// Ensure that the operand does not refer to instructions from earlier stages that are unreachable here
exists(Instruction use, Instruction def | this = registerOperand(use, _, def)) or
exists(Instruction use | this = nonSSAMemoryOperand(use, _)) or
@@ -190,7 +191,8 @@ class Operand extends TStageOperand {
* An operand that consumes a memory result (e.g. the `LoadOperand` on a `Load` instruction).
*/
class MemoryOperand extends Operand {
cached MemoryOperand() {
cached
MemoryOperand() {
this instanceof TNonSSAMemoryOperand or
this instanceof TPhiOperand or
this instanceof TChiOperand
@@ -256,7 +258,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
override RegisterOperandTag tag;
Instruction defInstr;
cached RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
cached
RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
final override string toString() { result = tag.toString() }
@@ -274,7 +277,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOperand {
override MemoryOperandTag tag;
cached NonPhiMemoryOperand() {
cached
NonPhiMemoryOperand() {
this = nonSSAMemoryOperand(useInstr, tag)
or
this = chiOperand(useInstr, tag)
@@ -426,7 +430,8 @@ class PhiInputOperand extends MemoryOperand, TPhiOperand {
IRBlock predecessorBlock;
Overlap overlap;
cached PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
cached
PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
override string toString() { result = "Phi" }

View File

@@ -25,7 +25,8 @@ private class TStageOperand =
* (the defining instruction) in another instruction (the use instruction)
*/
class Operand extends TStageOperand {
cached Operand() {
cached
Operand() {
// Ensure that the operand does not refer to instructions from earlier stages that are unreachable here
exists(Instruction use, Instruction def | this = registerOperand(use, _, def)) or
exists(Instruction use | this = nonSSAMemoryOperand(use, _)) or
@@ -190,7 +191,8 @@ class Operand extends TStageOperand {
* An operand that consumes a memory result (e.g. the `LoadOperand` on a `Load` instruction).
*/
class MemoryOperand extends Operand {
cached MemoryOperand() {
cached
MemoryOperand() {
this instanceof TNonSSAMemoryOperand or
this instanceof TPhiOperand or
this instanceof TChiOperand
@@ -256,7 +258,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
override RegisterOperandTag tag;
Instruction defInstr;
cached RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
cached
RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
final override string toString() { result = tag.toString() }
@@ -274,7 +277,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOperand {
override MemoryOperandTag tag;
cached NonPhiMemoryOperand() {
cached
NonPhiMemoryOperand() {
this = nonSSAMemoryOperand(useInstr, tag)
or
this = chiOperand(useInstr, tag)
@@ -426,7 +430,8 @@ class PhiInputOperand extends MemoryOperand, TPhiOperand {
IRBlock predecessorBlock;
Overlap overlap;
cached PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
cached
PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
override string toString() { result = "Phi" }

View File

@@ -25,7 +25,8 @@ private class TStageOperand =
* (the defining instruction) in another instruction (the use instruction)
*/
class Operand extends TStageOperand {
cached Operand() {
cached
Operand() {
// Ensure that the operand does not refer to instructions from earlier stages that are unreachable here
exists(Instruction use, Instruction def | this = registerOperand(use, _, def)) or
exists(Instruction use | this = nonSSAMemoryOperand(use, _)) or
@@ -190,7 +191,8 @@ class Operand extends TStageOperand {
* An operand that consumes a memory result (e.g. the `LoadOperand` on a `Load` instruction).
*/
class MemoryOperand extends Operand {
cached MemoryOperand() {
cached
MemoryOperand() {
this instanceof TNonSSAMemoryOperand or
this instanceof TPhiOperand or
this instanceof TChiOperand
@@ -256,7 +258,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
override RegisterOperandTag tag;
Instruction defInstr;
cached RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
cached
RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
final override string toString() { result = tag.toString() }
@@ -274,7 +277,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOperand {
override MemoryOperandTag tag;
cached NonPhiMemoryOperand() {
cached
NonPhiMemoryOperand() {
this = nonSSAMemoryOperand(useInstr, tag)
or
this = chiOperand(useInstr, tag)
@@ -426,7 +430,8 @@ class PhiInputOperand extends MemoryOperand, TPhiOperand {
IRBlock predecessorBlock;
Overlap overlap;
cached PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
cached
PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
override string toString() { result = "Phi" }

View File

@@ -25,7 +25,8 @@ private class TStageOperand =
* (the defining instruction) in another instruction (the use instruction)
*/
class Operand extends TStageOperand {
cached Operand() {
cached
Operand() {
// Ensure that the operand does not refer to instructions from earlier stages that are unreachable here
exists(Instruction use, Instruction def | this = registerOperand(use, _, def)) or
exists(Instruction use | this = nonSSAMemoryOperand(use, _)) or
@@ -190,7 +191,8 @@ class Operand extends TStageOperand {
* An operand that consumes a memory result (e.g. the `LoadOperand` on a `Load` instruction).
*/
class MemoryOperand extends Operand {
cached MemoryOperand() {
cached
MemoryOperand() {
this instanceof TNonSSAMemoryOperand or
this instanceof TPhiOperand or
this instanceof TChiOperand
@@ -256,7 +258,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
override RegisterOperandTag tag;
Instruction defInstr;
cached RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
cached
RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
final override string toString() { result = tag.toString() }
@@ -274,7 +277,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOperand {
override MemoryOperandTag tag;
cached NonPhiMemoryOperand() {
cached
NonPhiMemoryOperand() {
this = nonSSAMemoryOperand(useInstr, tag)
or
this = chiOperand(useInstr, tag)
@@ -426,7 +430,8 @@ class PhiInputOperand extends MemoryOperand, TPhiOperand {
IRBlock predecessorBlock;
Overlap overlap;
cached PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
cached
PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
override string toString() { result = "Phi" }