diff --git a/llvm/lib/Target/CSKY/CSKYConstantIslandPass.cpp b/llvm/lib/Target/CSKY/CSKYConstantIslandPass.cpp --- a/llvm/lib/Target/CSKY/CSKYConstantIslandPass.cpp +++ b/llvm/lib/Target/CSKY/CSKYConstantIslandPass.cpp @@ -905,8 +905,7 @@ Scale = 2; break; default: - assert(0); - break; + llvm_unreachable(""); } unsigned MaxOffs = ((1 << (Bits - 1)) - 1) * Scale; diff --git a/llvm/lib/Target/CSKY/CSKYInstrInfo.cpp b/llvm/lib/Target/CSKY/CSKYInstrInfo.cpp --- a/llvm/lib/Target/CSKY/CSKYInstrInfo.cpp +++ b/llvm/lib/Target/CSKY/CSKYInstrInfo.cpp @@ -476,9 +476,6 @@ MachineBasicBlock::iterator I, const DebugLoc &DL, MCRegister DestReg, MCRegister SrcReg, bool KillSrc) const { - - MachineRegisterInfo &MRI = MBB.getParent()->getRegInfo(); - if (CSKY::GPRRegClass.contains(SrcReg) && CSKY::CARRYRegClass.contains(DestReg)) { if (STI.hasE2()) { diff --git a/llvm/lib/Target/CSKY/CSKYMachineFunctionInfo.h b/llvm/lib/Target/CSKY/CSKYMachineFunctionInfo.h --- a/llvm/lib/Target/CSKY/CSKYMachineFunctionInfo.h +++ b/llvm/lib/Target/CSKY/CSKYMachineFunctionInfo.h @@ -18,8 +18,6 @@ namespace llvm { class CSKYMachineFunctionInfo : public MachineFunctionInfo { - MachineFunction &MF; - Register GlobalBaseReg = 0; bool SpillsCR = false; @@ -33,7 +31,7 @@ unsigned PICLabelUId = 0; public: - CSKYMachineFunctionInfo(MachineFunction &MF) : MF(MF) {} + CSKYMachineFunctionInfo(MachineFunction &) {} Register getGlobalBaseReg() const { return GlobalBaseReg; } void setGlobalBaseReg(Register Reg) { GlobalBaseReg = Reg; } diff --git a/llvm/lib/Target/CSKY/Disassembler/CSKYDisassembler.cpp b/llvm/lib/Target/CSKY/Disassembler/CSKYDisassembler.cpp --- a/llvm/lib/Target/CSKY/Disassembler/CSKYDisassembler.cpp +++ b/llvm/lib/Target/CSKY/Disassembler/CSKYDisassembler.cpp @@ -33,7 +33,6 @@ namespace { class CSKYDisassembler : public MCDisassembler { std::unique_ptr const MCII; - mutable bool inDataRegion = false; mutable StringRef symbolName; DecodeStatus handleCROperand(MCInst &Instr) const; @@ -166,6 +165,8 @@ return MCDisassembler::Success; } +// TODO +LLVM_ATTRIBUTE_UNUSED static DecodeStatus DecodesFPR128RegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder) { @@ -196,6 +197,8 @@ return MCDisassembler::Success; } +// TODO +LLVM_ATTRIBUTE_UNUSED static DecodeStatus DecodeGPRSPRegisterClass(MCInst &Inst, uint64_t RegNo, uint64_t Address, const MCDisassembler *Decoder) { diff --git a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFObjectWriter.cpp b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFObjectWriter.cpp --- a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFObjectWriter.cpp +++ b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFObjectWriter.cpp @@ -121,6 +121,7 @@ return ELF::R_CKCORE_ADDR32; } } + return ELF::R_CKCORE_NONE; case FK_Data_8: Ctx.reportError(Fixup.getLoc(), "8-byte data relocations not supported"); return ELF::R_CKCORE_NONE; diff --git a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFStreamer.h b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFStreamer.h --- a/llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFStreamer.h +++ b/llvm/lib/Target/CSKY/MCTargetDesc/CSKYELFStreamer.h @@ -137,7 +137,7 @@ EmitMappingSymbol("$d"); MCELFStreamer::emitValueImpl(Value, Size, Loc); } - void reset() { + void reset() override { MappingSymbolCounter = 0; State = EMS_None; MCELFStreamer::reset();