Skip to content

Commit 2b382d5

Browse files
committed
C++: autoformat Operand.qll
1 parent 290b1c6 commit 2b382d5

File tree

5 files changed

+50
-25
lines changed

5 files changed

+50
-25
lines changed

cpp/ql/src/semmle/code/cpp/ir/implementation/aliased_ssa/Operand.qll

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ private class TStageOperand =
2525
* (the defining instruction) in another instruction (the use instruction)
2626
*/
2727
class Operand extends TStageOperand {
28-
cached Operand() {
28+
cached
29+
Operand() {
2930
// Ensure that the operand does not refer to instructions from earlier stages that are unreachable here
3031
exists(Instruction use, Instruction def | this = registerOperand(use, _, def)) or
3132
exists(Instruction use | this = nonSSAMemoryOperand(use, _)) or
@@ -190,7 +191,8 @@ class Operand extends TStageOperand {
190191
* An operand that consumes a memory result (e.g. the `LoadOperand` on a `Load` instruction).
191192
*/
192193
class MemoryOperand extends Operand {
193-
cached MemoryOperand() {
194+
cached
195+
MemoryOperand() {
194196
this instanceof TNonSSAMemoryOperand or
195197
this instanceof TPhiOperand or
196198
this instanceof TChiOperand
@@ -256,7 +258,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
256258
override RegisterOperandTag tag;
257259
Instruction defInstr;
258260

259-
cached RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
261+
cached
262+
RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
260263

261264
final override string toString() { result = tag.toString() }
262265

@@ -274,7 +277,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
274277
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOperand {
275278
override MemoryOperandTag tag;
276279

277-
cached NonPhiMemoryOperand() {
280+
cached
281+
NonPhiMemoryOperand() {
278282
this = nonSSAMemoryOperand(useInstr, tag)
279283
or
280284
this = chiOperand(useInstr, tag)
@@ -426,7 +430,8 @@ class PhiInputOperand extends MemoryOperand, TPhiOperand {
426430
IRBlock predecessorBlock;
427431
Overlap overlap;
428432

429-
cached PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
433+
cached
434+
PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
430435

431436
override string toString() { result = "Phi" }
432437

cpp/ql/src/semmle/code/cpp/ir/implementation/raw/Operand.qll

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ private class TStageOperand =
2525
* (the defining instruction) in another instruction (the use instruction)
2626
*/
2727
class Operand extends TStageOperand {
28-
cached Operand() {
28+
cached
29+
Operand() {
2930
// Ensure that the operand does not refer to instructions from earlier stages that are unreachable here
3031
exists(Instruction use, Instruction def | this = registerOperand(use, _, def)) or
3132
exists(Instruction use | this = nonSSAMemoryOperand(use, _)) or
@@ -190,7 +191,8 @@ class Operand extends TStageOperand {
190191
* An operand that consumes a memory result (e.g. the `LoadOperand` on a `Load` instruction).
191192
*/
192193
class MemoryOperand extends Operand {
193-
cached MemoryOperand() {
194+
cached
195+
MemoryOperand() {
194196
this instanceof TNonSSAMemoryOperand or
195197
this instanceof TPhiOperand or
196198
this instanceof TChiOperand
@@ -256,7 +258,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
256258
override RegisterOperandTag tag;
257259
Instruction defInstr;
258260

259-
cached RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
261+
cached
262+
RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
260263

261264
final override string toString() { result = tag.toString() }
262265

@@ -274,7 +277,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
274277
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOperand {
275278
override MemoryOperandTag tag;
276279

277-
cached NonPhiMemoryOperand() {
280+
cached
281+
NonPhiMemoryOperand() {
278282
this = nonSSAMemoryOperand(useInstr, tag)
279283
or
280284
this = chiOperand(useInstr, tag)
@@ -426,7 +430,8 @@ class PhiInputOperand extends MemoryOperand, TPhiOperand {
426430
IRBlock predecessorBlock;
427431
Overlap overlap;
428432

429-
cached PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
433+
cached
434+
PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
430435

431436
override string toString() { result = "Phi" }
432437

cpp/ql/src/semmle/code/cpp/ir/implementation/unaliased_ssa/Operand.qll

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ private class TStageOperand =
2525
* (the defining instruction) in another instruction (the use instruction)
2626
*/
2727
class Operand extends TStageOperand {
28-
cached Operand() {
28+
cached
29+
Operand() {
2930
// Ensure that the operand does not refer to instructions from earlier stages that are unreachable here
3031
exists(Instruction use, Instruction def | this = registerOperand(use, _, def)) or
3132
exists(Instruction use | this = nonSSAMemoryOperand(use, _)) or
@@ -190,7 +191,8 @@ class Operand extends TStageOperand {
190191
* An operand that consumes a memory result (e.g. the `LoadOperand` on a `Load` instruction).
191192
*/
192193
class MemoryOperand extends Operand {
193-
cached MemoryOperand() {
194+
cached
195+
MemoryOperand() {
194196
this instanceof TNonSSAMemoryOperand or
195197
this instanceof TPhiOperand or
196198
this instanceof TChiOperand
@@ -256,7 +258,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
256258
override RegisterOperandTag tag;
257259
Instruction defInstr;
258260

259-
cached RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
261+
cached
262+
RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
260263

261264
final override string toString() { result = tag.toString() }
262265

@@ -274,7 +277,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
274277
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOperand {
275278
override MemoryOperandTag tag;
276279

277-
cached NonPhiMemoryOperand() {
280+
cached
281+
NonPhiMemoryOperand() {
278282
this = nonSSAMemoryOperand(useInstr, tag)
279283
or
280284
this = chiOperand(useInstr, tag)
@@ -426,7 +430,8 @@ class PhiInputOperand extends MemoryOperand, TPhiOperand {
426430
IRBlock predecessorBlock;
427431
Overlap overlap;
428432

429-
cached PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
433+
cached
434+
PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
430435

431436
override string toString() { result = "Phi" }
432437

csharp/ql/src/experimental/ir/implementation/raw/Operand.qll

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ private class TStageOperand =
2525
* (the defining instruction) in another instruction (the use instruction)
2626
*/
2727
class Operand extends TStageOperand {
28-
cached Operand() {
28+
cached
29+
Operand() {
2930
// Ensure that the operand does not refer to instructions from earlier stages that are unreachable here
3031
exists(Instruction use, Instruction def | this = registerOperand(use, _, def)) or
3132
exists(Instruction use | this = nonSSAMemoryOperand(use, _)) or
@@ -190,7 +191,8 @@ class Operand extends TStageOperand {
190191
* An operand that consumes a memory result (e.g. the `LoadOperand` on a `Load` instruction).
191192
*/
192193
class MemoryOperand extends Operand {
193-
cached MemoryOperand() {
194+
cached
195+
MemoryOperand() {
194196
this instanceof TNonSSAMemoryOperand or
195197
this instanceof TPhiOperand or
196198
this instanceof TChiOperand
@@ -256,7 +258,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
256258
override RegisterOperandTag tag;
257259
Instruction defInstr;
258260

259-
cached RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
261+
cached
262+
RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
260263

261264
final override string toString() { result = tag.toString() }
262265

@@ -274,7 +277,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
274277
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOperand {
275278
override MemoryOperandTag tag;
276279

277-
cached NonPhiMemoryOperand() {
280+
cached
281+
NonPhiMemoryOperand() {
278282
this = nonSSAMemoryOperand(useInstr, tag)
279283
or
280284
this = chiOperand(useInstr, tag)
@@ -426,7 +430,8 @@ class PhiInputOperand extends MemoryOperand, TPhiOperand {
426430
IRBlock predecessorBlock;
427431
Overlap overlap;
428432

429-
cached PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
433+
cached
434+
PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
430435

431436
override string toString() { result = "Phi" }
432437

csharp/ql/src/experimental/ir/implementation/unaliased_ssa/Operand.qll

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ private class TStageOperand =
2525
* (the defining instruction) in another instruction (the use instruction)
2626
*/
2727
class Operand extends TStageOperand {
28-
cached Operand() {
28+
cached
29+
Operand() {
2930
// Ensure that the operand does not refer to instructions from earlier stages that are unreachable here
3031
exists(Instruction use, Instruction def | this = registerOperand(use, _, def)) or
3132
exists(Instruction use | this = nonSSAMemoryOperand(use, _)) or
@@ -190,7 +191,8 @@ class Operand extends TStageOperand {
190191
* An operand that consumes a memory result (e.g. the `LoadOperand` on a `Load` instruction).
191192
*/
192193
class MemoryOperand extends Operand {
193-
cached MemoryOperand() {
194+
cached
195+
MemoryOperand() {
194196
this instanceof TNonSSAMemoryOperand or
195197
this instanceof TPhiOperand or
196198
this instanceof TChiOperand
@@ -256,7 +258,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
256258
override RegisterOperandTag tag;
257259
Instruction defInstr;
258260

259-
cached RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
261+
cached
262+
RegisterOperand() { this = registerOperand(useInstr, tag, defInstr) }
260263

261264
final override string toString() { result = tag.toString() }
262265

@@ -274,7 +277,8 @@ class RegisterOperand extends NonPhiOperand, TRegisterOperand {
274277
class NonPhiMemoryOperand extends NonPhiOperand, MemoryOperand, TNonPhiMemoryOperand {
275278
override MemoryOperandTag tag;
276279

277-
cached NonPhiMemoryOperand() {
280+
cached
281+
NonPhiMemoryOperand() {
278282
this = nonSSAMemoryOperand(useInstr, tag)
279283
or
280284
this = chiOperand(useInstr, tag)
@@ -426,7 +430,8 @@ class PhiInputOperand extends MemoryOperand, TPhiOperand {
426430
IRBlock predecessorBlock;
427431
Overlap overlap;
428432

429-
cached PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
433+
cached
434+
PhiInputOperand() { this = phiOperand(useInstr, defInstr, predecessorBlock, overlap) }
430435

431436
override string toString() { result = "Phi" }
432437

0 commit comments

Comments
 (0)