[all-commits] [llvm/llvm-project] 0d7fd9: [GlobalISel] Fix Wint-in-bool-context warning (NFC)

nullptr-cpp via All-commits all-commits at lists.llvm.org
Tue Mar 30 19:00:29 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0d7fd9f0d09812c6344a7df6498ce504c8d646d1
      https://github.com/llvm/llvm-project/commit/0d7fd9f0d09812c6344a7df6498ce504c8d646d1
  Author: Yang Fan <nullptr.cpp at gmail.com>
  Date:   2021-03-31 (Wed, 31 Mar 2021)

  Changed paths:
    M llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp

  Log Message:
  -----------
  [GlobalISel] Fix Wint-in-bool-context warning (NFC)

GCC warning:
```
/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp: In member function ‘bool llvm::CombinerHelper::matchFunnelShiftToRotate(llvm::MachineInstr&)’:
/llvm-project/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:3882:35: warning: ?: using integer constants in boolean context, the expression will always evaluate to ‘true’ [-Wint-in-bool-context]
 3882 |       Opc == TargetOpcode::G_FSHL ? TargetOpcode::G_ROTL : TargetOpcode::G_ROTR;
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```




More information about the All-commits mailing list