C++: Fix formatting

This commit is contained in:
Dave Bartolomeo
2020-01-07 13:23:36 -07:00
parent 9df37399f8
commit 690d23d15e
7 changed files with 30 additions and 72 deletions

View File

@@ -140,9 +140,7 @@ class Opcode extends TOpcode {
}
abstract class UnaryOpcode extends Opcode {
final override predicate hasOperandInternal(OperandTag tag) {
tag instanceof UnaryOperandTag
}
final override predicate hasOperandInternal(OperandTag tag) { tag instanceof UnaryOperandTag }
}
abstract class BinaryOpcode extends Opcode {
@@ -185,9 +183,7 @@ abstract class ThrowOpcode extends Opcode { }
abstract class CatchOpcode extends Opcode { }
abstract class OpcodeWithCondition extends Opcode {
final override predicate hasOperandInternal(OperandTag tag) {
tag instanceof ConditionOperandTag
}
final override predicate hasOperandInternal(OperandTag tag) { tag instanceof ConditionOperandTag }
}
abstract class BuiltInOperationOpcode extends Opcode { }
@@ -241,6 +237,7 @@ abstract class BufferReadOpcode extends BufferAccessOpcode {
*/
abstract class SizedBufferAccessOpcode extends Opcode {
final override predicate hasAddressOperand() { any() }
final override predicate hasBufferSizeOperand() { any() }
}
@@ -249,7 +246,7 @@ abstract class SizedBufferAccessOpcode extends Opcode {
*/
abstract class SizedBufferWriteOpcode extends SizedBufferAccessOpcode {
final override MemoryAccessKind getWriteMemoryAccess() {
result instanceof BufferMemoryAccess //TODO: SizedBufferMemoryAccess
result instanceof BufferMemoryAccess //TODO: SizedBufferMemoryAccess
}
}
@@ -258,7 +255,7 @@ abstract class SizedBufferWriteOpcode extends SizedBufferAccessOpcode {
*/
abstract class SizedBufferReadOpcode extends SizedBufferAccessOpcode {
final override MemoryAccessKind getReadMemoryAccess() {
result instanceof BufferMemoryAccess //TODO: SizedBufferMemoryAccess
result instanceof BufferMemoryAccess //TODO: SizedBufferMemoryAccess
}
}
@@ -294,9 +291,7 @@ abstract class MayReadOpcode extends Opcode {
* An opcode that reads a value from memory.
*/
abstract class OpcodeWithLoad extends IndirectReadOpcode {
final override predicate hasOperandInternal(OperandTag tag) {
tag instanceof LoadOperandTag
}
final override predicate hasOperandInternal(OperandTag tag) { tag instanceof LoadOperandTag }
}
/**
@@ -573,17 +568,13 @@ module Opcode {
class AliasedDefinition extends Opcode, TAliasedDefinition {
final override string toString() { result = "AliasedDefinition" }
final override MemoryAccessKind getWriteMemoryAccess() {
result instanceof EscapedMemoryAccess
}
final override MemoryAccessKind getWriteMemoryAccess() { result instanceof EscapedMemoryAccess }
}
class AliasedUse extends Opcode, TAliasedUse {
final override string toString() { result = "AliasedUse" }
final override MemoryAccessKind getReadMemoryAccess() {
result instanceof NonLocalMemoryAccess
}
final override MemoryAccessKind getReadMemoryAccess() { result instanceof NonLocalMemoryAccess }
final override predicate hasOperandInternal(OperandTag tag) {
tag instanceof SideEffectOperandTag
@@ -593,9 +584,7 @@ module Opcode {
class Phi extends Opcode, TPhi {
final override string toString() { result = "Phi" }
final override MemoryAccessKind getWriteMemoryAccess() {
result instanceof PhiMemoryAccess
}
final override MemoryAccessKind getWriteMemoryAccess() { result instanceof PhiMemoryAccess }
}
class BuiltIn extends BuiltInOperationOpcode, TBuiltIn {

View File

@@ -170,9 +170,7 @@ class MemoryOperand extends Operand {
/**
* Gets the kind of memory access performed by the operand.
*/
MemoryAccessKind getMemoryAccess() {
result = getUse().getOpcode().getReadMemoryAccess()
}
MemoryAccessKind getMemoryAccess() { result = getUse().getOpcode().getReadMemoryAccess() }
/**
* 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 {
* conservative estimate of the memory that might actually be accessed at runtime (for example,
* the global side effects of a function call).
*/
predicate hasMayReadMemoryAccess() {
getUse().getOpcode().hasMayReadMemoryAccess()
}
predicate hasMayReadMemoryAccess() { getUse().getOpcode().hasMayReadMemoryAccess() }
/**
* Returns the operand that holds the memory address from which the current operand loads its

View File

@@ -170,9 +170,7 @@ class MemoryOperand extends Operand {
/**
* Gets the kind of memory access performed by the operand.
*/
MemoryAccessKind getMemoryAccess() {
result = getUse().getOpcode().getReadMemoryAccess()
}
MemoryAccessKind getMemoryAccess() { result = getUse().getOpcode().getReadMemoryAccess() }
/**
* 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 {
* conservative estimate of the memory that might actually be accessed at runtime (for example,
* the global side effects of a function call).
*/
predicate hasMayReadMemoryAccess() {
getUse().getOpcode().hasMayReadMemoryAccess()
}
predicate hasMayReadMemoryAccess() { getUse().getOpcode().hasMayReadMemoryAccess() }
/**
* Returns the operand that holds the memory address from which the current operand loads its

View File

@@ -170,9 +170,7 @@ class MemoryOperand extends Operand {
/**
* Gets the kind of memory access performed by the operand.
*/
MemoryAccessKind getMemoryAccess() {
result = getUse().getOpcode().getReadMemoryAccess()
}
MemoryAccessKind getMemoryAccess() { result = getUse().getOpcode().getReadMemoryAccess() }
/**
* 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 {
* conservative estimate of the memory that might actually be accessed at runtime (for example,
* the global side effects of a function call).
*/
predicate hasMayReadMemoryAccess() {
getUse().getOpcode().hasMayReadMemoryAccess()
}
predicate hasMayReadMemoryAccess() { getUse().getOpcode().hasMayReadMemoryAccess() }
/**
* Returns the operand that holds the memory address from which the current operand loads its