[llvm] d0f55a0 - [ARM] Fix gcc warning about mix of enumeral and non-enumeral types

Mikael Holmen via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 9 01:35:42 PST 2021


Author: Mikael Holmen
Date: 2021-12-09T10:31:56+01:00
New Revision: d0f55a0d8052229882644e07c78064bca99e06c0

URL: https://github.com/llvm/llvm-project/commit/d0f55a0d8052229882644e07c78064bca99e06c0
DIFF: https://github.com/llvm/llvm-project/commit/d0f55a0d8052229882644e07c78064bca99e06c0.diff

LOG: [ARM] Fix gcc warning about mix of enumeral and non-enumeral types

gcc warned with
../lib/Target/ARM/ARMFrameLowering.cpp:797:31: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
  797 |               Reg == ARM::R12 ? ARM::RA_AUTH_CODE : Reg, true);
      |               ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~

Added: 
    

Modified: 
    llvm/lib/Target/ARM/ARMFrameLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
index 73456b22e2868..4b59f9cb94ceb 100644
--- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp
@@ -794,7 +794,7 @@ void ARMFrameLowering::emitPrologue(MachineFunction &MF,
       case ARM::R12:
         if (STI.splitFramePushPop(MF)) {
           unsigned DwarfReg = MRI->getDwarfRegNum(
-              Reg == ARM::R12 ? ARM::RA_AUTH_CODE : Reg, true);
+              Reg == ARM::R12 ? (unsigned)ARM::RA_AUTH_CODE : Reg, true);
           unsigned Offset = MFI.getObjectOffset(FI);
           unsigned CFIIndex = MF.addFrameInst(
               MCCFIInstruction::createOffset(nullptr, DwarfReg, Offset));


        


More information about the llvm-commits mailing list