mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-28 16:11:29 +00:00
[RISCV][CSKY][Loong] Pass Twine by const reference instead of by value. NFC
I think RISCV was the original here and the CSKY and Loong copied it.
This commit is contained in:
parent
9156559254
commit
7ad4b2622a
@ -61,7 +61,8 @@ class CSKYAsmParser : public MCTargetAsmParser {
|
||||
unsigned Kind) override;
|
||||
|
||||
bool generateImmOutOfRangeError(OperandVector &Operands, uint64_t ErrorInfo,
|
||||
int64_t Lower, int64_t Upper, Twine Msg);
|
||||
int64_t Lower, int64_t Upper,
|
||||
const Twine &Msg);
|
||||
|
||||
SMLoc getLoc() const { return getParser().getTok().getLoc(); }
|
||||
|
||||
@ -650,7 +651,7 @@ static std::string CSKYMnemonicSpellCheck(StringRef S, const FeatureBitset &FBS,
|
||||
|
||||
bool CSKYAsmParser::generateImmOutOfRangeError(
|
||||
OperandVector &Operands, uint64_t ErrorInfo, int64_t Lower, int64_t Upper,
|
||||
Twine Msg = "immediate must be an integer in the range") {
|
||||
const Twine &Msg = "immediate must be an integer in the range") {
|
||||
SMLoc ErrorLoc = ((CSKYOperand &)*Operands[ErrorInfo]).getStartLoc();
|
||||
return Error(ErrorLoc, Msg + " [" + Twine(Lower) + ", " + Twine(Upper) + "]");
|
||||
}
|
||||
|
@ -64,7 +64,8 @@ class LoongArchAsmParser : public MCTargetAsmParser {
|
||||
unsigned Kind) override;
|
||||
|
||||
bool generateImmOutOfRangeError(OperandVector &Operands, uint64_t ErrorInfo,
|
||||
int64_t Lower, int64_t Upper, Twine Msg);
|
||||
int64_t Lower, int64_t Upper,
|
||||
const Twine &Msg);
|
||||
|
||||
/// Helper for processing MC instructions that have been successfully matched
|
||||
/// by MatchAndEmitInstruction.
|
||||
@ -1242,7 +1243,7 @@ LoongArchAsmParser::validateTargetOperandClass(MCParsedAsmOperand &AsmOp,
|
||||
|
||||
bool LoongArchAsmParser::generateImmOutOfRangeError(
|
||||
OperandVector &Operands, uint64_t ErrorInfo, int64_t Lower, int64_t Upper,
|
||||
Twine Msg = "immediate must be an integer in the range") {
|
||||
const Twine &Msg = "immediate must be an integer in the range") {
|
||||
SMLoc ErrorLoc = ((LoongArchOperand &)*Operands[ErrorInfo]).getStartLoc();
|
||||
return Error(ErrorLoc, Msg + " [" + Twine(Lower) + ", " + Twine(Upper) + "]");
|
||||
}
|
||||
|
@ -85,7 +85,8 @@ class RISCVAsmParser : public MCTargetAsmParser {
|
||||
unsigned checkTargetMatchPredicate(MCInst &Inst) override;
|
||||
|
||||
bool generateImmOutOfRangeError(OperandVector &Operands, uint64_t ErrorInfo,
|
||||
int64_t Lower, int64_t Upper, Twine Msg);
|
||||
int64_t Lower, int64_t Upper,
|
||||
const Twine &Msg);
|
||||
|
||||
bool MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
|
||||
OperandVector &Operands, MCStreamer &Out,
|
||||
@ -1168,7 +1169,7 @@ unsigned RISCVAsmParser::checkTargetMatchPredicate(MCInst &Inst) {
|
||||
|
||||
bool RISCVAsmParser::generateImmOutOfRangeError(
|
||||
OperandVector &Operands, uint64_t ErrorInfo, int64_t Lower, int64_t Upper,
|
||||
Twine Msg = "immediate must be an integer in the range") {
|
||||
const Twine &Msg = "immediate must be an integer in the range") {
|
||||
SMLoc ErrorLoc = ((RISCVOperand &)*Operands[ErrorInfo]).getStartLoc();
|
||||
return Error(ErrorLoc, Msg + " [" + Twine(Lower) + ", " + Twine(Upper) + "]");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user