diff options
| author | Jonas Hahnfeld <hahnjo@hahnjo.de> | 2019-03-04 08:51:32 +0000 |
|---|---|---|
| committer | Jonas Hahnfeld <hahnjo@hahnjo.de> | 2019-03-04 08:51:32 +0000 |
| commit | 65a401f6a90f8440fed1bcf89b5c3da4d61538a2 (patch) | |
| tree | 1787c153afa321a0cac422616b9b24851658cc7b /llvm/lib | |
| parent | daea28ab64800b242aa20b906794ba8efb0ce39f (diff) | |
| download | bcm5719-llvm-65a401f6a90f8440fed1bcf89b5c3da4d61538a2.tar.gz bcm5719-llvm-65a401f6a90f8440fed1bcf89b5c3da4d61538a2.zip | |
[AArch64/ARM] Fix two compiler warnings in InstructionSelector, NFCI
1) GCC complains that KnownValid is set but not used.
2) In ARMInstructionSelector::selectGlobal() the code is mixing "enumeral
and non-enumeral type in conditional expression". Solve this by casting
to unsigned which is the final type anyway.
Differential Revision: https://reviews.llvm.org/D58834
llvm-svn: 355304
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp | 1 | ||||
| -rw-r--r-- | llvm/lib/Target/ARM/ARMInstructionSelector.cpp | 11 |
2 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp b/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp index 83d61c82cb0..2a5599f665d 100644 --- a/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp +++ b/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp @@ -503,6 +503,7 @@ static bool selectCopy(MachineInstr &I, const TargetInstrInfo &TII, !TargetRegisterInfo::isPhysicalRegister(I.getOperand(1).getReg()))) && "No phys reg on generic operator!"); assert(KnownValid || isValidCopy(I, DstRegBank, MRI, TRI, RBI)); + (void)KnownValid; return true; }; diff --git a/llvm/lib/Target/ARM/ARMInstructionSelector.cpp b/llvm/lib/Target/ARM/ARMInstructionSelector.cpp index d69f3265ec1..a9f1f6bbc22 100644 --- a/llvm/lib/Target/ARM/ARMInstructionSelector.cpp +++ b/llvm/lib/Target/ARM/ARMInstructionSelector.cpp @@ -665,11 +665,12 @@ bool ARMInstructionSelector::selectGlobal(MachineInstrBuilder &MIB, // FIXME: Taking advantage of MOVT for ELF is pretty involved, so we don't // support it yet. See PR28229. - unsigned Opc = UseMovt && !STI.isTargetELF() - ? (UseOpcodeThatLoads ? ARM::MOV_ga_pcrel_ldr - : Opcodes.MOV_ga_pcrel) - : (UseOpcodeThatLoads ? ARM::LDRLIT_ga_pcrel_ldr - : Opcodes.LDRLIT_ga_pcrel); + unsigned Opc = + UseMovt && !STI.isTargetELF() + ? (UseOpcodeThatLoads ? (unsigned)ARM::MOV_ga_pcrel_ldr + : Opcodes.MOV_ga_pcrel) + : (UseOpcodeThatLoads ? (unsigned)ARM::LDRLIT_ga_pcrel_ldr + : Opcodes.LDRLIT_ga_pcrel); MIB->setDesc(TII.get(Opc)); int TargetFlags = ARMII::MO_NO_FLAG; |

