[all-commits] [llvm/llvm-project] 981a38: [AArch64AsmParser] Fix type-limits warning for Vec...

sdesmalen-arm via All-commits all-commits at lists.llvm.org
Mon Feb 8 07:36:43 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 981a38baf43929c52829aa0e635710645a31b41d
      https://github.com/llvm/llvm-project/commit/981a38baf43929c52829aa0e635710645a31b41d
  Author: Sander de Smalen <sander.desmalen at arm.com>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp

  Log Message:
  -----------
  [AArch64AsmParser] Fix type-limits warning for VectorIndex.

Making VectorIndex an `int` instead of `unsigned`, silences the warning:
  comparison of unsigned expression in ‘>= 0’ is always true

in:
  template <int Min, int Max>
  DiagnosticPredicate isVectorIndex() const {
    ...
    if (VectorIndex.Val >= Min && VectorIndex.Val <= Max)
      return DiagnosticPredicateTy::Match;
    ...
  }

when Min is 0.




More information about the All-commits mailing list