mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
[mips] [IAS] Factor out .set nomacro warning. NFC.
Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9772 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237780 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -448,6 +448,8 @@ public:
|
|||||||
|
|
||||||
/// Warn if RegIndex is the same as the current AT.
|
/// Warn if RegIndex is the same as the current AT.
|
||||||
void warnIfRegIndexIsAT(unsigned RegIndex, SMLoc Loc);
|
void warnIfRegIndexIsAT(unsigned RegIndex, SMLoc Loc);
|
||||||
|
|
||||||
|
void warnIfNoMacro(SMLoc Loc);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1759,8 +1761,7 @@ bool MipsAsmParser::loadImmediate(int64_t ImmValue, unsigned DstReg,
|
|||||||
tmpInst.addOperand(MCOperand::createImm(ImmValue));
|
tmpInst.addOperand(MCOperand::createImm(ImmValue));
|
||||||
Instructions.push_back(tmpInst);
|
Instructions.push_back(tmpInst);
|
||||||
} else if (isInt<32>(ImmValue) || isUInt<32>(ImmValue)) {
|
} else if (isInt<32>(ImmValue) || isUInt<32>(ImmValue)) {
|
||||||
if (!AssemblerOptions.back()->isMacro())
|
warnIfNoMacro(IDLoc);
|
||||||
Warning(IDLoc, "macro instruction expanded into multiple instructions");
|
|
||||||
|
|
||||||
// For all other values which are representable as a 32-bit integer:
|
// For all other values which are representable as a 32-bit integer:
|
||||||
// li d,j => lui d,hi16(j)
|
// li d,j => lui d,hi16(j)
|
||||||
@ -1795,8 +1796,7 @@ bool MipsAsmParser::loadImmediate(int64_t ImmValue, unsigned DstReg,
|
|||||||
Error(IDLoc, "instruction requires a 32-bit immediate");
|
Error(IDLoc, "instruction requires a 32-bit immediate");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!AssemblerOptions.back()->isMacro())
|
warnIfNoMacro(IDLoc);
|
||||||
Warning(IDLoc, "macro instruction expanded into multiple instructions");
|
|
||||||
|
|
||||||
// <------- lo32 ------>
|
// <------- lo32 ------>
|
||||||
// <------- hi32 ------>
|
// <------- hi32 ------>
|
||||||
@ -1830,8 +1830,7 @@ bool MipsAsmParser::loadImmediate(int64_t ImmValue, unsigned DstReg,
|
|||||||
Error(IDLoc, "instruction requires a 32-bit immediate");
|
Error(IDLoc, "instruction requires a 32-bit immediate");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!AssemblerOptions.back()->isMacro())
|
warnIfNoMacro(IDLoc);
|
||||||
Warning(IDLoc, "macro instruction expanded into multiple instructions");
|
|
||||||
|
|
||||||
// <------- hi32 ------> <------- lo32 ------>
|
// <------- hi32 ------> <------- lo32 ------>
|
||||||
// <- hi16 -> <- lo16 ->
|
// <- hi16 -> <- lo16 ->
|
||||||
@ -1934,8 +1933,7 @@ MipsAsmParser::expandLoadAddressImm(MCInst &Inst, bool Is32BitImm, SMLoc IDLoc,
|
|||||||
void MipsAsmParser::expandLoadAddressSym(
|
void MipsAsmParser::expandLoadAddressSym(
|
||||||
const MCOperand &DstRegOp, const MCOperand &SymOp, bool Is32BitSym,
|
const MCOperand &DstRegOp, const MCOperand &SymOp, bool Is32BitSym,
|
||||||
SMLoc IDLoc, SmallVectorImpl<MCInst> &Instructions) {
|
SMLoc IDLoc, SmallVectorImpl<MCInst> &Instructions) {
|
||||||
if (!AssemblerOptions.back()->isMacro())
|
warnIfNoMacro(IDLoc);
|
||||||
Warning(IDLoc, "macro instruction expanded into multiple instructions");
|
|
||||||
|
|
||||||
if (Is32BitSym && isABI_N64())
|
if (Is32BitSym && isABI_N64())
|
||||||
Warning(IDLoc, "instruction loads the 32-bit address of a 64-bit symbol");
|
Warning(IDLoc, "instruction loads the 32-bit address of a 64-bit symbol");
|
||||||
@ -2256,6 +2254,11 @@ void MipsAsmParser::warnIfRegIndexIsAT(unsigned RegIndex, SMLoc Loc) {
|
|||||||
") without \".set noat\"");
|
") without \".set noat\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MipsAsmParser::warnIfNoMacro(SMLoc Loc) {
|
||||||
|
if (!AssemblerOptions.back()->isMacro())
|
||||||
|
Warning(Loc, "macro instruction expanded into multiple instructions");
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
MipsAsmParser::printWarningWithFixIt(const Twine &Msg, const Twine &FixMsg,
|
MipsAsmParser::printWarningWithFixIt(const Twine &Msg, const Twine &FixMsg,
|
||||||
SMRange Range, bool ShowColors) {
|
SMRange Range, bool ShowColors) {
|
||||||
|
Reference in New Issue
Block a user