Skip to content

Commit a551a55

Browse files
committed
C++: Get rid of a parenthesis pair.
1 parent 3c35e1e commit a551a55

File tree

1 file changed

+58
-62
lines changed

1 file changed

+58
-62
lines changed

cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/gvn/internal/ValueNumberingInternal.qll

Lines changed: 58 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -310,68 +310,64 @@ TValueNumber tvalueNumberOfOperand(Operand op) { result = tvalueNumber(op.getDef
310310
* value number.
311311
*/
312312
private TValueNumber nonUniqueValueNumber(Instruction instr) {
313-
exists(IRFunction irFunc |
314-
irFunc = instr.getEnclosingIRFunction() and
315-
(
316-
exists(Language::AST ast |
317-
variableAddressValueNumber(instr, irFunc, ast) and
318-
result = TVariableAddressValueNumber(irFunc, ast)
319-
)
320-
or
321-
exists(Language::AST var |
322-
initializeParameterValueNumber(instr, irFunc, var) and
323-
result = TInitializeParameterValueNumber(irFunc, var)
324-
)
325-
or
326-
exists(string value, IRType type |
327-
constantValueNumber(instr, irFunc, type, value) and
328-
result = TConstantValueNumber(irFunc, type, value)
329-
)
330-
or
331-
exists(IRType type, string value |
332-
stringConstantValueNumber(instr, irFunc, type, value) and
333-
result = TStringConstantValueNumber(irFunc, type, value)
334-
)
335-
or
336-
exists(Language::Field field, TValueNumber objectAddress |
337-
fieldAddressValueNumber(instr, irFunc, field, objectAddress) and
338-
result = TFieldAddressValueNumber(irFunc, field, objectAddress)
339-
)
340-
or
341-
exists(Opcode opcode, TValueNumber leftOperand, TValueNumber rightOperand |
342-
binaryValueNumber(instr, irFunc, opcode, leftOperand, rightOperand) and
343-
result = TBinaryValueNumber(irFunc, opcode, leftOperand, rightOperand)
344-
)
345-
or
346-
exists(Opcode opcode, TValueNumber operand |
347-
unaryValueNumber(instr, irFunc, opcode, operand) and
348-
result = TUnaryValueNumber(irFunc, opcode, operand)
349-
)
350-
or
351-
exists(
352-
Opcode opcode, Language::Class baseClass, Language::Class derivedClass, TValueNumber operand
353-
|
354-
inheritanceConversionValueNumber(instr, irFunc, opcode, baseClass, derivedClass, operand) and
355-
result = TInheritanceConversionValueNumber(irFunc, opcode, baseClass, derivedClass, operand)
356-
)
357-
or
358-
exists(Opcode opcode, int elementSize, TValueNumber leftOperand, TValueNumber rightOperand |
359-
pointerArithmeticValueNumber(instr, irFunc, opcode, elementSize, leftOperand, rightOperand) and
360-
result =
361-
TPointerArithmeticValueNumber(irFunc, opcode, elementSize, leftOperand, rightOperand)
362-
)
363-
or
364-
exists(IRType type, TValueNumber memOperand, TValueNumber operand |
365-
loadTotalOverlapValueNumber(instr, irFunc, type, memOperand, operand) and
366-
result = TLoadTotalOverlapValueNumber(irFunc, type, memOperand, operand)
367-
)
368-
or
369-
// The value number of a copy is just the value number of its source value.
370-
result = tvalueNumber(instr.(CongruentCopyInstruction).getSourceValue())
371-
or
372-
// The value number of a type-preserving conversion is just the value
373-
// number of the unconverted value.
374-
result = tvalueNumber(instr.(TypePreservingConvertInstruction).getUnary())
313+
exists(IRFunction irFunc | irFunc = instr.getEnclosingIRFunction() |
314+
exists(Language::AST ast |
315+
variableAddressValueNumber(instr, irFunc, ast) and
316+
result = TVariableAddressValueNumber(irFunc, ast)
375317
)
318+
or
319+
exists(Language::AST var |
320+
initializeParameterValueNumber(instr, irFunc, var) and
321+
result = TInitializeParameterValueNumber(irFunc, var)
322+
)
323+
or
324+
exists(string value, IRType type |
325+
constantValueNumber(instr, irFunc, type, value) and
326+
result = TConstantValueNumber(irFunc, type, value)
327+
)
328+
or
329+
exists(IRType type, string value |
330+
stringConstantValueNumber(instr, irFunc, type, value) and
331+
result = TStringConstantValueNumber(irFunc, type, value)
332+
)
333+
or
334+
exists(Language::Field field, TValueNumber objectAddress |
335+
fieldAddressValueNumber(instr, irFunc, field, objectAddress) and
336+
result = TFieldAddressValueNumber(irFunc, field, objectAddress)
337+
)
338+
or
339+
exists(Opcode opcode, TValueNumber leftOperand, TValueNumber rightOperand |
340+
binaryValueNumber(instr, irFunc, opcode, leftOperand, rightOperand) and
341+
result = TBinaryValueNumber(irFunc, opcode, leftOperand, rightOperand)
342+
)
343+
or
344+
exists(Opcode opcode, TValueNumber operand |
345+
unaryValueNumber(instr, irFunc, opcode, operand) and
346+
result = TUnaryValueNumber(irFunc, opcode, operand)
347+
)
348+
or
349+
exists(
350+
Opcode opcode, Language::Class baseClass, Language::Class derivedClass, TValueNumber operand
351+
|
352+
inheritanceConversionValueNumber(instr, irFunc, opcode, baseClass, derivedClass, operand) and
353+
result = TInheritanceConversionValueNumber(irFunc, opcode, baseClass, derivedClass, operand)
354+
)
355+
or
356+
exists(Opcode opcode, int elementSize, TValueNumber leftOperand, TValueNumber rightOperand |
357+
pointerArithmeticValueNumber(instr, irFunc, opcode, elementSize, leftOperand, rightOperand) and
358+
result = TPointerArithmeticValueNumber(irFunc, opcode, elementSize, leftOperand, rightOperand)
359+
)
360+
or
361+
exists(IRType type, TValueNumber memOperand, TValueNumber operand |
362+
loadTotalOverlapValueNumber(instr, irFunc, type, memOperand, operand) and
363+
result = TLoadTotalOverlapValueNumber(irFunc, type, memOperand, operand)
364+
)
365+
or
366+
// The value number of a copy is just the value number of its source value.
367+
result = tvalueNumber(instr.(CongruentCopyInstruction).getSourceValue())
368+
or
369+
// The value number of a type-preserving conversion is just the value
370+
// number of the unconverted value.
371+
result = tvalueNumber(instr.(TypePreservingConvertInstruction).getUnary())
376372
)
377373
}

0 commit comments

Comments
 (0)