Skip to content

Commit 690d23d

Browse files
author
Dave Bartolomeo
committed
C++: Fix formatting
1 parent 9df3739 commit 690d23d

File tree

7 files changed

+30
-72
lines changed

7 files changed

+30
-72
lines changed

cpp/ql/src/semmle/code/cpp/ir/implementation/Opcode.qll

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,7 @@ class Opcode extends TOpcode {
140140
}
141141

142142
abstract class UnaryOpcode extends Opcode {
143-
final override predicate hasOperandInternal(OperandTag tag) {
144-
tag instanceof UnaryOperandTag
145-
}
143+
final override predicate hasOperandInternal(OperandTag tag) { tag instanceof UnaryOperandTag }
146144
}
147145

148146
abstract class BinaryOpcode extends Opcode {
@@ -185,9 +183,7 @@ abstract class ThrowOpcode extends Opcode { }
185183
abstract class CatchOpcode extends Opcode { }
186184

187185
abstract class OpcodeWithCondition extends Opcode {
188-
final override predicate hasOperandInternal(OperandTag tag) {
189-
tag instanceof ConditionOperandTag
190-
}
186+
final override predicate hasOperandInternal(OperandTag tag) { tag instanceof ConditionOperandTag }
191187
}
192188

193189
abstract class BuiltInOperationOpcode extends Opcode { }
@@ -241,6 +237,7 @@ abstract class BufferReadOpcode extends BufferAccessOpcode {
241237
*/
242238
abstract class SizedBufferAccessOpcode extends Opcode {
243239
final override predicate hasAddressOperand() { any() }
240+
244241
final override predicate hasBufferSizeOperand() { any() }
245242
}
246243

@@ -249,7 +246,7 @@ abstract class SizedBufferAccessOpcode extends Opcode {
249246
*/
250247
abstract class SizedBufferWriteOpcode extends SizedBufferAccessOpcode {
251248
final override MemoryAccessKind getWriteMemoryAccess() {
252-
result instanceof BufferMemoryAccess //TODO: SizedBufferMemoryAccess
249+
result instanceof BufferMemoryAccess //TODO: SizedBufferMemoryAccess
253250
}
254251
}
255252

@@ -258,7 +255,7 @@ abstract class SizedBufferWriteOpcode extends SizedBufferAccessOpcode {
258255
*/
259256
abstract class SizedBufferReadOpcode extends SizedBufferAccessOpcode {
260257
final override MemoryAccessKind getReadMemoryAccess() {
261-
result instanceof BufferMemoryAccess //TODO: SizedBufferMemoryAccess
258+
result instanceof BufferMemoryAccess //TODO: SizedBufferMemoryAccess
262259
}
263260
}
264261

@@ -294,9 +291,7 @@ abstract class MayReadOpcode extends Opcode {
294291
* An opcode that reads a value from memory.
295292
*/
296293
abstract class OpcodeWithLoad extends IndirectReadOpcode {
297-
final override predicate hasOperandInternal(OperandTag tag) {
298-
tag instanceof LoadOperandTag
299-
}
294+
final override predicate hasOperandInternal(OperandTag tag) { tag instanceof LoadOperandTag }
300295
}
301296

302297
/**
@@ -573,17 +568,13 @@ module Opcode {
573568
class AliasedDefinition extends Opcode, TAliasedDefinition {
574569
final override string toString() { result = "AliasedDefinition" }
575570

576-
final override MemoryAccessKind getWriteMemoryAccess() {
577-
result instanceof EscapedMemoryAccess
578-
}
571+
final override MemoryAccessKind getWriteMemoryAccess() { result instanceof EscapedMemoryAccess }
579572
}
580573

581574
class AliasedUse extends Opcode, TAliasedUse {
582575
final override string toString() { result = "AliasedUse" }
583-
584-
final override MemoryAccessKind getReadMemoryAccess() {
585-
result instanceof NonLocalMemoryAccess
586-
}
576+
577+
final override MemoryAccessKind getReadMemoryAccess() { result instanceof NonLocalMemoryAccess }
587578

588579
final override predicate hasOperandInternal(OperandTag tag) {
589580
tag instanceof SideEffectOperandTag
@@ -593,9 +584,7 @@ module Opcode {
593584
class Phi extends Opcode, TPhi {
594585
final override string toString() { result = "Phi" }
595586

596-
final override MemoryAccessKind getWriteMemoryAccess() {
597-
result instanceof PhiMemoryAccess
598-
}
587+
final override MemoryAccessKind getWriteMemoryAccess() { result instanceof PhiMemoryAccess }
599588
}
600589

601590
class BuiltIn extends BuiltInOperationOpcode, TBuiltIn {

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ class MemoryOperand extends Operand {
170170
/**
171171
* Gets the kind of memory access performed by the operand.
172172
*/
173-
MemoryAccessKind getMemoryAccess() {
174-
result = getUse().getOpcode().getReadMemoryAccess()
175-
}
173+
MemoryAccessKind getMemoryAccess() { result = getUse().getOpcode().getReadMemoryAccess() }
176174

177175
/**
178176
* Holds if the memory access performed by this operand will not always read from every bit in the
@@ -182,9 +180,7 @@ class MemoryOperand extends Operand {
182180
* conservative estimate of the memory that might actually be accessed at runtime (for example,
183181
* the global side effects of a function call).
184182
*/
185-
predicate hasMayReadMemoryAccess() {
186-
getUse().getOpcode().hasMayReadMemoryAccess()
187-
}
183+
predicate hasMayReadMemoryAccess() { getUse().getOpcode().hasMayReadMemoryAccess() }
188184

189185
/**
190186
* Returns the operand that holds the memory address from which the current operand loads its

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ class MemoryOperand extends Operand {
170170
/**
171171
* Gets the kind of memory access performed by the operand.
172172
*/
173-
MemoryAccessKind getMemoryAccess() {
174-
result = getUse().getOpcode().getReadMemoryAccess()
175-
}
173+
MemoryAccessKind getMemoryAccess() { result = getUse().getOpcode().getReadMemoryAccess() }
176174

177175
/**
178176
* Holds if the memory access performed by this operand will not always read from every bit in the
@@ -182,9 +180,7 @@ class MemoryOperand extends Operand {
182180
* conservative estimate of the memory that might actually be accessed at runtime (for example,
183181
* the global side effects of a function call).
184182
*/
185-
predicate hasMayReadMemoryAccess() {
186-
getUse().getOpcode().hasMayReadMemoryAccess()
187-
}
183+
predicate hasMayReadMemoryAccess() { getUse().getOpcode().hasMayReadMemoryAccess() }
188184

189185
/**
190186
* Returns the operand that holds the memory address from which the current operand loads its

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ class MemoryOperand extends Operand {
170170
/**
171171
* Gets the kind of memory access performed by the operand.
172172
*/
173-
MemoryAccessKind getMemoryAccess() {
174-
result = getUse().getOpcode().getReadMemoryAccess()
175-
}
173+
MemoryAccessKind getMemoryAccess() { result = getUse().getOpcode().getReadMemoryAccess() }
176174

177175
/**
178176
* Holds if the memory access performed by this operand will not always read from every bit in the
@@ -182,9 +180,7 @@ class MemoryOperand extends Operand {
182180
* conservative estimate of the memory that might actually be accessed at runtime (for example,
183181
* the global side effects of a function call).
184182
*/
185-
predicate hasMayReadMemoryAccess() {
186-
getUse().getOpcode().hasMayReadMemoryAccess()
187-
}
183+
predicate hasMayReadMemoryAccess() { getUse().getOpcode().hasMayReadMemoryAccess() }
188184

189185
/**
190186
* Returns the operand that holds the memory address from which the current operand loads its

csharp/ql/src/semmle/code/csharp/ir/implementation/Opcode.qll

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,7 @@ class Opcode extends TOpcode {
140140
}
141141

142142
abstract class UnaryOpcode extends Opcode {
143-
final override predicate hasOperandInternal(OperandTag tag) {
144-
tag instanceof UnaryOperandTag
145-
}
143+
final override predicate hasOperandInternal(OperandTag tag) { tag instanceof UnaryOperandTag }
146144
}
147145

148146
abstract class BinaryOpcode extends Opcode {
@@ -185,9 +183,7 @@ abstract class ThrowOpcode extends Opcode { }
185183
abstract class CatchOpcode extends Opcode { }
186184

187185
abstract class OpcodeWithCondition extends Opcode {
188-
final override predicate hasOperandInternal(OperandTag tag) {
189-
tag instanceof ConditionOperandTag
190-
}
186+
final override predicate hasOperandInternal(OperandTag tag) { tag instanceof ConditionOperandTag }
191187
}
192188

193189
abstract class BuiltInOperationOpcode extends Opcode { }
@@ -241,6 +237,7 @@ abstract class BufferReadOpcode extends BufferAccessOpcode {
241237
*/
242238
abstract class SizedBufferAccessOpcode extends Opcode {
243239
final override predicate hasAddressOperand() { any() }
240+
244241
final override predicate hasBufferSizeOperand() { any() }
245242
}
246243

@@ -249,7 +246,7 @@ abstract class SizedBufferAccessOpcode extends Opcode {
249246
*/
250247
abstract class SizedBufferWriteOpcode extends SizedBufferAccessOpcode {
251248
final override MemoryAccessKind getWriteMemoryAccess() {
252-
result instanceof BufferMemoryAccess //TODO: SizedBufferMemoryAccess
249+
result instanceof BufferMemoryAccess //TODO: SizedBufferMemoryAccess
253250
}
254251
}
255252

@@ -258,7 +255,7 @@ abstract class SizedBufferWriteOpcode extends SizedBufferAccessOpcode {
258255
*/
259256
abstract class SizedBufferReadOpcode extends SizedBufferAccessOpcode {
260257
final override MemoryAccessKind getReadMemoryAccess() {
261-
result instanceof BufferMemoryAccess //TODO: SizedBufferMemoryAccess
258+
result instanceof BufferMemoryAccess //TODO: SizedBufferMemoryAccess
262259
}
263260
}
264261

@@ -294,9 +291,7 @@ abstract class MayReadOpcode extends Opcode {
294291
* An opcode that reads a value from memory.
295292
*/
296293
abstract class OpcodeWithLoad extends IndirectReadOpcode {
297-
final override predicate hasOperandInternal(OperandTag tag) {
298-
tag instanceof LoadOperandTag
299-
}
294+
final override predicate hasOperandInternal(OperandTag tag) { tag instanceof LoadOperandTag }
300295
}
301296

302297
/**
@@ -573,17 +568,13 @@ module Opcode {
573568
class AliasedDefinition extends Opcode, TAliasedDefinition {
574569
final override string toString() { result = "AliasedDefinition" }
575570

576-
final override MemoryAccessKind getWriteMemoryAccess() {
577-
result instanceof EscapedMemoryAccess
578-
}
571+
final override MemoryAccessKind getWriteMemoryAccess() { result instanceof EscapedMemoryAccess }
579572
}
580573

581574
class AliasedUse extends Opcode, TAliasedUse {
582575
final override string toString() { result = "AliasedUse" }
583-
584-
final override MemoryAccessKind getReadMemoryAccess() {
585-
result instanceof NonLocalMemoryAccess
586-
}
576+
577+
final override MemoryAccessKind getReadMemoryAccess() { result instanceof NonLocalMemoryAccess }
587578

588579
final override predicate hasOperandInternal(OperandTag tag) {
589580
tag instanceof SideEffectOperandTag
@@ -593,9 +584,7 @@ module Opcode {
593584
class Phi extends Opcode, TPhi {
594585
final override string toString() { result = "Phi" }
595586

596-
final override MemoryAccessKind getWriteMemoryAccess() {
597-
result instanceof PhiMemoryAccess
598-
}
587+
final override MemoryAccessKind getWriteMemoryAccess() { result instanceof PhiMemoryAccess }
599588
}
600589

601590
class BuiltIn extends BuiltInOperationOpcode, TBuiltIn {

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ class MemoryOperand extends Operand {
170170
/**
171171
* Gets the kind of memory access performed by the operand.
172172
*/
173-
MemoryAccessKind getMemoryAccess() {
174-
result = getUse().getOpcode().getReadMemoryAccess()
175-
}
173+
MemoryAccessKind getMemoryAccess() { result = getUse().getOpcode().getReadMemoryAccess() }
176174

177175
/**
178176
* Holds if the memory access performed by this operand will not always read from every bit in the
@@ -182,9 +180,7 @@ class MemoryOperand extends Operand {
182180
* conservative estimate of the memory that might actually be accessed at runtime (for example,
183181
* the global side effects of a function call).
184182
*/
185-
predicate hasMayReadMemoryAccess() {
186-
getUse().getOpcode().hasMayReadMemoryAccess()
187-
}
183+
predicate hasMayReadMemoryAccess() { getUse().getOpcode().hasMayReadMemoryAccess() }
188184

189185
/**
190186
* Returns the operand that holds the memory address from which the current operand loads its

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ class MemoryOperand extends Operand {
170170
/**
171171
* Gets the kind of memory access performed by the operand.
172172
*/
173-
MemoryAccessKind getMemoryAccess() {
174-
result = getUse().getOpcode().getReadMemoryAccess()
175-
}
173+
MemoryAccessKind getMemoryAccess() { result = getUse().getOpcode().getReadMemoryAccess() }
176174

177175
/**
178176
* Holds if the memory access performed by this operand will not always read from every bit in the
@@ -182,9 +180,7 @@ class MemoryOperand extends Operand {
182180
* conservative estimate of the memory that might actually be accessed at runtime (for example,
183181
* the global side effects of a function call).
184182
*/
185-
predicate hasMayReadMemoryAccess() {
186-
getUse().getOpcode().hasMayReadMemoryAccess()
187-
}
183+
predicate hasMayReadMemoryAccess() { getUse().getOpcode().hasMayReadMemoryAccess() }
188184

189185
/**
190186
* Returns the operand that holds the memory address from which the current operand loads its

0 commit comments

Comments
 (0)