forked from OSchip/llvm-project
[CSKY] Fix some Clang warnings. NFC
Reviewed By: zixuan-wu Differential Revision: https://reviews.llvm.org/D122872
This commit is contained in:
parent
f2796a5d44
commit
ef437a7d3f
|
@ -905,8 +905,7 @@ static inline unsigned getUnconditionalBrDisp(int Opc) {
|
||||||
Scale = 2;
|
Scale = 2;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
llvm_unreachable("");
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned MaxOffs = ((1 << (Bits - 1)) - 1) * Scale;
|
unsigned MaxOffs = ((1 << (Bits - 1)) - 1) * Scale;
|
||||||
|
|
|
@ -655,7 +655,7 @@ class R_Z_1<bits<6> sop, bits<5> pcode, string op>
|
||||||
|
|
||||||
// Format< OP[6] | RZ[5] | 00000[5] | SOP[6] | PCODE[5] | 00000[5] >
|
// Format< OP[6] | RZ[5] | 00000[5] | SOP[6] | PCODE[5] | 00000[5] >
|
||||||
// Instructions:(2) clrf32, clrt32
|
// Instructions:(2) clrf32, clrt32
|
||||||
class R_Z_2<bits<6> sop, bits<5> pcode, string op, list<dag> pattern>
|
class R_Z_2<bits<6> sop, bits<5> pcode, string op>
|
||||||
: CSKY32Inst<AddrModeNone, 0x31, (outs GPR:$rz),
|
: CSKY32Inst<AddrModeNone, 0x31, (outs GPR:$rz),
|
||||||
(ins CARRY:$ca, GPR:$false), !strconcat(op, "\t$rz"), []> {
|
(ins CARRY:$ca, GPR:$false), !strconcat(op, "\t$rz"), []> {
|
||||||
bits<5> rz;
|
bits<5> rz;
|
||||||
|
|
|
@ -476,9 +476,6 @@ void CSKYInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
|
||||||
MachineBasicBlock::iterator I,
|
MachineBasicBlock::iterator I,
|
||||||
const DebugLoc &DL, MCRegister DestReg,
|
const DebugLoc &DL, MCRegister DestReg,
|
||||||
MCRegister SrcReg, bool KillSrc) const {
|
MCRegister SrcReg, bool KillSrc) const {
|
||||||
|
|
||||||
MachineRegisterInfo &MRI = MBB.getParent()->getRegInfo();
|
|
||||||
|
|
||||||
if (CSKY::GPRRegClass.contains(SrcReg) &&
|
if (CSKY::GPRRegClass.contains(SrcReg) &&
|
||||||
CSKY::CARRYRegClass.contains(DestReg)) {
|
CSKY::CARRYRegClass.contains(DestReg)) {
|
||||||
if (STI.hasE2()) {
|
if (STI.hasE2()) {
|
||||||
|
|
|
@ -734,8 +734,8 @@ let Predicates= [iHasE2] in {
|
||||||
|
|
||||||
let Predicates = [iHas2E3] in {
|
let Predicates = [iHas2E3] in {
|
||||||
def MVCV32 : R_Z_1<0x1, 0x10, "mvcv32">;
|
def MVCV32 : R_Z_1<0x1, 0x10, "mvcv32">;
|
||||||
def CLRF32 : R_Z_2<0xB, 0x1, "clrf32", []>;
|
def CLRF32 : R_Z_2<0xB, 0x1, "clrf32">;
|
||||||
def CLRT32 : R_Z_2<0xB, 0x2, "clrt32", []>;
|
def CLRT32 : R_Z_2<0xB, 0x2, "clrt32">;
|
||||||
}
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
|
@ -1363,4 +1363,4 @@ def CONSTPOOL_ENTRY : CSKYPseudo<(outs),
|
||||||
include "CSKYInstrInfo16Instr.td"
|
include "CSKYInstrInfo16Instr.td"
|
||||||
include "CSKYInstrInfoF1.td"
|
include "CSKYInstrInfoF1.td"
|
||||||
include "CSKYInstrInfoF2.td"
|
include "CSKYInstrInfoF2.td"
|
||||||
include "CSKYInstrAlias.td"
|
include "CSKYInstrAlias.td"
|
||||||
|
|
|
@ -18,8 +18,6 @@
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
class CSKYMachineFunctionInfo : public MachineFunctionInfo {
|
class CSKYMachineFunctionInfo : public MachineFunctionInfo {
|
||||||
MachineFunction &MF;
|
|
||||||
|
|
||||||
Register GlobalBaseReg = 0;
|
Register GlobalBaseReg = 0;
|
||||||
bool SpillsCR = false;
|
bool SpillsCR = false;
|
||||||
|
|
||||||
|
@ -33,7 +31,7 @@ class CSKYMachineFunctionInfo : public MachineFunctionInfo {
|
||||||
unsigned PICLabelUId = 0;
|
unsigned PICLabelUId = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CSKYMachineFunctionInfo(MachineFunction &MF) : MF(MF) {}
|
CSKYMachineFunctionInfo(MachineFunction &) {}
|
||||||
|
|
||||||
Register getGlobalBaseReg() const { return GlobalBaseReg; }
|
Register getGlobalBaseReg() const { return GlobalBaseReg; }
|
||||||
void setGlobalBaseReg(Register Reg) { GlobalBaseReg = Reg; }
|
void setGlobalBaseReg(Register Reg) { GlobalBaseReg = Reg; }
|
||||||
|
|
|
@ -33,7 +33,6 @@ typedef MCDisassembler::DecodeStatus DecodeStatus;
|
||||||
namespace {
|
namespace {
|
||||||
class CSKYDisassembler : public MCDisassembler {
|
class CSKYDisassembler : public MCDisassembler {
|
||||||
std::unique_ptr<MCInstrInfo const> const MCII;
|
std::unique_ptr<MCInstrInfo const> const MCII;
|
||||||
mutable bool inDataRegion = false;
|
|
||||||
mutable StringRef symbolName;
|
mutable StringRef symbolName;
|
||||||
|
|
||||||
DecodeStatus handleCROperand(MCInst &Instr) const;
|
DecodeStatus handleCROperand(MCInst &Instr) const;
|
||||||
|
@ -166,6 +165,8 @@ static DecodeStatus DecodeFPR64RegisterClass(MCInst &Inst, uint64_t RegNo,
|
||||||
return MCDisassembler::Success;
|
return MCDisassembler::Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
LLVM_ATTRIBUTE_UNUSED
|
||||||
static DecodeStatus DecodesFPR128RegisterClass(MCInst &Inst, uint64_t RegNo,
|
static DecodeStatus DecodesFPR128RegisterClass(MCInst &Inst, uint64_t RegNo,
|
||||||
uint64_t Address,
|
uint64_t Address,
|
||||||
const MCDisassembler *Decoder) {
|
const MCDisassembler *Decoder) {
|
||||||
|
@ -196,6 +197,8 @@ static DecodeStatus DecodemGPRRegisterClass(MCInst &Inst, uint64_t RegNo,
|
||||||
return MCDisassembler::Success;
|
return MCDisassembler::Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
LLVM_ATTRIBUTE_UNUSED
|
||||||
static DecodeStatus DecodeGPRSPRegisterClass(MCInst &Inst, uint64_t RegNo,
|
static DecodeStatus DecodeGPRSPRegisterClass(MCInst &Inst, uint64_t RegNo,
|
||||||
uint64_t Address,
|
uint64_t Address,
|
||||||
const MCDisassembler *Decoder) {
|
const MCDisassembler *Decoder) {
|
||||||
|
|
|
@ -121,6 +121,7 @@ unsigned CSKYELFObjectWriter::getRelocType(MCContext &Ctx,
|
||||||
return ELF::R_CKCORE_ADDR32;
|
return ELF::R_CKCORE_ADDR32;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return ELF::R_CKCORE_NONE;
|
||||||
case FK_Data_8:
|
case FK_Data_8:
|
||||||
Ctx.reportError(Fixup.getLoc(), "8-byte data relocations not supported");
|
Ctx.reportError(Fixup.getLoc(), "8-byte data relocations not supported");
|
||||||
return ELF::R_CKCORE_NONE;
|
return ELF::R_CKCORE_NONE;
|
||||||
|
|
|
@ -137,7 +137,7 @@ public:
|
||||||
EmitMappingSymbol("$d");
|
EmitMappingSymbol("$d");
|
||||||
MCELFStreamer::emitValueImpl(Value, Size, Loc);
|
MCELFStreamer::emitValueImpl(Value, Size, Loc);
|
||||||
}
|
}
|
||||||
void reset() {
|
void reset() override {
|
||||||
MappingSymbolCounter = 0;
|
MappingSymbolCounter = 0;
|
||||||
State = EMS_None;
|
State = EMS_None;
|
||||||
MCELFStreamer::reset();
|
MCELFStreamer::reset();
|
||||||
|
|
Loading…
Reference in New Issue