[all-commits] [llvm/llvm-project] 3e596e: [X86] Fix -Wc++11-narrowing in X86ISelLowering.cpp...

Jie Fu via All-commits all-commits at lists.llvm.org
Fri Aug 11 02:18:35 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3e596ed20cf66818ee6c71ed32c9f56bf0b7584d
      https://github.com/llvm/llvm-project/commit/3e596ed20cf66818ee6c71ed32c9f56bf0b7584d
  Author: Jie Fu <jiefu at tencent.com>
  Date:   2023-08-11 (Fri, 11 Aug 2023)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp

  Log Message:
  -----------
  [X86] Fix -Wc++11-narrowing in X86ISelLowering.cpp (NFC)

/Users/jiefu/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp:54604:26: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'int' in initializer list [-Wc++11-narrowing]
          int Mask[4] = {(Imm0 & 0x03), ((Imm0 >> 4) & 0x3), (Imm1 & 0x03),
                         ^~~~~~~~~~~~~
/Users/jiefu/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp:54604:26: note: insert an explicit cast to silence this issue
          int Mask[4] = {(Imm0 & 0x03), ((Imm0 >> 4) & 0x3), (Imm1 & 0x03),
                         ^~~~~~~~~~~~~
                         static_cast<int>( )
/Users/jiefu/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp:54604:41: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'int' in initializer list [-Wc++11-narrowing]
          int Mask[4] = {(Imm0 & 0x03), ((Imm0 >> 4) & 0x3), (Imm1 & 0x03),
                                        ^~~~~~~~~~~~~~~~~~~
/Users/jiefu/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp:54604:41: note: insert an explicit cast to silence this issue
          int Mask[4] = {(Imm0 & 0x03), ((Imm0 >> 4) & 0x3), (Imm1 & 0x03),
                                        ^~~~~~~~~~~~~~~~~~~
                                        static_cast<int>(  )
/Users/jiefu/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp:54604:62: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'int' in initializer list [-Wc++11-narrowing]
          int Mask[4] = {(Imm0 & 0x03), ((Imm0 >> 4) & 0x3), (Imm1 & 0x03),
                                                             ^~~~~~~~~~~~~
/Users/jiefu/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp:54604:62: note: insert an explicit cast to silence this issue
          int Mask[4] = {(Imm0 & 0x03), ((Imm0 >> 4) & 0x3), (Imm1 & 0x03),
                                                             ^~~~~~~~~~~~~
                                                             static_cast<int>( )
/Users/jiefu/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp:54605:26: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'int' in initializer list [-Wc++11-narrowing]
                         ((Imm1 >> 4) & 0x3)};
                         ^~~~~~~~~~~~~~~~~~~
/Users/jiefu/llvm-project/llvm/lib/Target/X86/X86ISelLowering.cpp:54605:26: note: insert an explicit cast to silence this issue
                         ((Imm1 >> 4) & 0x3)};
                         ^~~~~~~~~~~~~~~~~~~
                         static_cast<int>(  )
4 errors generated.




More information about the All-commits mailing list