[llvm] r333161 - [mips] Cleanup the code a bit. NFC
Simon Atanasyan via llvm-commits
llvm-commits at lists.llvm.org
Thu May 24 00:36:00 PDT 2018
Author: atanasyan
Date: Thu May 24 00:36:00 2018
New Revision: 333161
URL: http://llvm.org/viewvc/llvm-project?rev=333161&view=rev
Log:
[mips] Cleanup the code a bit. NFC
Modified:
llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
Modified: llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp?rev=333161&r1=333160&r2=333161&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/Mips/AsmParser/MipsAsmParser.cpp Thu May 24 00:36:00 2018
@@ -1356,9 +1356,11 @@ public:
template <unsigned Bits, unsigned ShiftLeftAmount>
bool isScaledSImm() const {
- if (isConstantImm() && isShiftedInt<Bits, ShiftLeftAmount>(getConstantImm()))
+ if (isConstantImm() &&
+ isShiftedInt<Bits, ShiftLeftAmount>(getConstantImm()))
return true;
- // Operand can also be a symbol or symbol plus offset in case of relocations.
+ // Operand can also be a symbol or symbol plus
+ // offset in case of relocations.
if (Kind != k_Immediate)
return false;
MCValue Res;
@@ -2064,7 +2066,8 @@ bool MipsAsmParser::processInstruction(M
// FIXME: Add support for forward-declared local symbols.
// FIXME: Add expansion for when the LargeGOT option is enabled.
if (JalSym->isInSection() || JalSym->isTemporary() ||
- (JalSym->isELF() && cast<MCSymbolELF>(JalSym)->getBinding() == ELF::STB_LOCAL)) {
+ (JalSym->isELF() &&
+ cast<MCSymbolELF>(JalSym)->getBinding() == ELF::STB_LOCAL)) {
if (isABI_O32()) {
// If it's a local symbol and the O32 ABI is being used, we expand to:
// lw $25, 0($gp)
@@ -3554,11 +3557,10 @@ bool MipsAsmParser::expandBranchImm(MCIn
void MipsAsmParser::expandMemInst(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out,
const MCSubtargetInfo *STI, bool IsLoad,
bool IsImmOpnd) {
- if (IsLoad) {
+ if (IsLoad)
expandLoadInst(Inst, IDLoc, Out, STI, IsImmOpnd);
- return;
- }
- expandStoreInst(Inst, IDLoc, Out, STI, IsImmOpnd);
+ else
+ expandStoreInst(Inst, IDLoc, Out, STI, IsImmOpnd);
}
void MipsAsmParser::expandLoadInst(MCInst &Inst, SMLoc IDLoc, MCStreamer &Out,
@@ -3764,7 +3766,8 @@ bool MipsAsmParser::expandCondBranches(M
case Mips::BLTUL:
AcceptsEquality = false;
ReverseOrderSLT = false;
- IsUnsigned = ((PseudoOpcode == Mips::BLTU) || (PseudoOpcode == Mips::BLTUL));
+ IsUnsigned =
+ ((PseudoOpcode == Mips::BLTU) || (PseudoOpcode == Mips::BLTUL));
IsLikely = ((PseudoOpcode == Mips::BLTL) || (PseudoOpcode == Mips::BLTUL));
ZeroSrcOpcode = Mips::BGTZ;
ZeroTrgOpcode = Mips::BLTZ;
@@ -3775,7 +3778,8 @@ bool MipsAsmParser::expandCondBranches(M
case Mips::BLEUL:
AcceptsEquality = true;
ReverseOrderSLT = true;
- IsUnsigned = ((PseudoOpcode == Mips::BLEU) || (PseudoOpcode == Mips::BLEUL));
+ IsUnsigned =
+ ((PseudoOpcode == Mips::BLEU) || (PseudoOpcode == Mips::BLEUL));
IsLikely = ((PseudoOpcode == Mips::BLEL) || (PseudoOpcode == Mips::BLEUL));
ZeroSrcOpcode = Mips::BGEZ;
ZeroTrgOpcode = Mips::BLEZ;
@@ -3786,7 +3790,8 @@ bool MipsAsmParser::expandCondBranches(M
case Mips::BGEUL:
AcceptsEquality = true;
ReverseOrderSLT = false;
- IsUnsigned = ((PseudoOpcode == Mips::BGEU) || (PseudoOpcode == Mips::BGEUL));
+ IsUnsigned =
+ ((PseudoOpcode == Mips::BGEU) || (PseudoOpcode == Mips::BGEUL));
IsLikely = ((PseudoOpcode == Mips::BGEL) || (PseudoOpcode == Mips::BGEUL));
ZeroSrcOpcode = Mips::BLEZ;
ZeroTrgOpcode = Mips::BGEZ;
@@ -3797,7 +3802,8 @@ bool MipsAsmParser::expandCondBranches(M
case Mips::BGTUL:
AcceptsEquality = false;
ReverseOrderSLT = true;
- IsUnsigned = ((PseudoOpcode == Mips::BGTU) || (PseudoOpcode == Mips::BGTUL));
+ IsUnsigned =
+ ((PseudoOpcode == Mips::BGTU) || (PseudoOpcode == Mips::BGTUL));
IsLikely = ((PseudoOpcode == Mips::BGTL) || (PseudoOpcode == Mips::BGTUL));
ZeroSrcOpcode = Mips::BLTZ;
ZeroTrgOpcode = Mips::BGTZ;
@@ -4317,7 +4323,8 @@ bool MipsAsmParser::expandAliasImmediate
DstReg = ATReg;
}
- if (!loadImmediate(ImmValue, DstReg, Mips::NoRegister, Is32Bit, false, Inst.getLoc(), Out, STI)) {
+ if (!loadImmediate(ImmValue, DstReg, Mips::NoRegister, Is32Bit, false,
+ Inst.getLoc(), Out, STI)) {
switch (FinalOpcode) {
default:
llvm_unreachable("unimplemented expansion");
@@ -4705,7 +4712,8 @@ bool MipsAsmParser::expandMulImm(MCInst
if (!ATReg)
return true;
- loadImmediate(ImmValue, ATReg, Mips::NoRegister, true, false, IDLoc, Out, STI);
+ loadImmediate(ImmValue, ATReg, Mips::NoRegister, true, false, IDLoc, Out,
+ STI);
TOut.emitRR(Inst.getOpcode() == Mips::MULImmMacro ? Mips::MULT : Mips::DMULT,
SrcReg, ATReg, IDLoc, STI);
@@ -5335,7 +5343,8 @@ bool MipsAsmParser::MatchAndEmitInstruct
return Error(ErrorLoc, "invalid operand for instruction");
}
case Match_NonZeroOperandForSync:
- return Error(IDLoc, "s-type must be zero or unspecified for pre-MIPS32 ISAs");
+ return Error(IDLoc,
+ "s-type must be zero or unspecified for pre-MIPS32 ISAs");
case Match_NonZeroOperandForMTCX:
return Error(IDLoc, "selector must be zero for pre-MIPS32 ISAs");
case Match_MnemonicFail:
@@ -7241,7 +7250,8 @@ bool MipsAsmParser::parseDirectiveSet()
return false;
} else if (Tok.getString() == "micromips") {
if (hasMips64r6()) {
- Error(Tok.getLoc(), ".set micromips directive is not supported with MIPS64R6");
+ Error(Tok.getLoc(),
+ ".set micromips directive is not supported with MIPS64R6");
return false;
}
return parseSetFeature(Mips::FeatureMicroMips);
More information about the llvm-commits
mailing list