summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorToma Tabacu <toma.tabacu@imgtec.com>2015-05-14 14:51:32 +0000
committerToma Tabacu <toma.tabacu@imgtec.com>2015-05-14 14:51:32 +0000
commite625b5fc020315705f9b8f8c4c85036e4956b529 (patch)
tree7d4c4dd94cd8398760a5f7dd55a0a32b32e4d03e /llvm/lib
parent9376e9998e554dbe171eba409eabdc2dddae16f0 (diff)
downloadbcm5719-llvm-e625b5fc020315705f9b8f8c4c85036e4956b529.tar.gz
bcm5719-llvm-e625b5fc020315705f9b8f8c4c85036e4956b529.zip
[mips] [IAS] Enforce .set nomacro.
Summary: When used, ".set nomacro" causes warning messages to be reported when we expand pseudo-instructions to multiple machine instructions. Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9564 llvm-svn: 237366
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
index c503083028a..6a006caffd8 100644
--- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -1759,6 +1759,9 @@ bool MipsAsmParser::loadImmediate(int64_t ImmValue, unsigned DstReg,
tmpInst.addOperand(MCOperand::createImm(ImmValue));
Instructions.push_back(tmpInst);
} else if ((ImmValue & 0xffffffff) == ImmValue) {
+ if (!AssemblerOptions.back()->isMacro())
+ Warning(IDLoc, "macro instruction expanded into multiple instructions");
+
// For all other values which are representable as a 32-bit integer:
// li d,j => lui d,hi16(j)
// ori d,d,lo16(j)
@@ -1779,6 +1782,8 @@ bool MipsAsmParser::loadImmediate(int64_t ImmValue, unsigned DstReg,
Error(IDLoc, "instruction requires a 32-bit immediate");
return true;
}
+ if (!AssemblerOptions.back()->isMacro())
+ Warning(IDLoc, "macro instruction expanded into multiple instructions");
// <------- lo32 ------>
// <------- hi32 ------>
@@ -1812,6 +1817,8 @@ bool MipsAsmParser::loadImmediate(int64_t ImmValue, unsigned DstReg,
Error(IDLoc, "instruction requires a 32-bit immediate");
return true;
}
+ if (!AssemblerOptions.back()->isMacro())
+ Warning(IDLoc, "macro instruction expanded into multiple instructions");
// <------- hi32 ------> <------- lo32 ------>
// <- hi16 -> <- lo16 ->
@@ -1914,6 +1921,9 @@ MipsAsmParser::expandLoadAddressImm(MCInst &Inst, bool Is32BitImm, SMLoc IDLoc,
void MipsAsmParser::expandLoadAddressSym(
const MCOperand &DstRegOp, const MCOperand &SymOp, bool Is32BitSym,
SMLoc IDLoc, SmallVectorImpl<MCInst> &Instructions) {
+ if (!AssemblerOptions.back()->isMacro())
+ Warning(IDLoc, "macro instruction expanded into multiple instructions");
+
if (Is32BitSym && isABI_N64())
Warning(IDLoc, "instruction loads the 32-bit address of a 64-bit symbol");
OpenPOWER on IntegriCloud