Issue 86827
Summary llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.cpp:1097: faulty compare ?
Labels new issue
Assignees
Reporter dcb314
    Static analyser cppcheck says:

llvm/utils/TableGen/Common/GlobalISel/GlobalISelMatchTable.cpp:1097:30: style: Comparison of a variable having boolean value using relational (<, >, <= or >=) operator. [comparisonOfBoolWithBoolError]

Source code is

  bool AIsConstantInsn = AOM && AOM->getInsnMatcher().isConstantInstruction();
  bool BIsConstantInsn = BOM && BOM->getInsnMatcher().isConstantInstruction();

  if (AOM && BOM) {
    // The relative priorities between a G_CONSTANT and any other instruction
    // don't actually matter but this code is needed to ensure a strict weak
    // ordering. This is particularly important on Windows where the rules will
    // be incorrectly sorted without it.
    if (AIsConstantInsn != BIsConstantInsn)
      return AIsConstantInsn < BIsConstantInsn;

I am not aware of any ordering that can be applied to bool values. Suggest code rework.

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to