summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorToma Tabacu <toma.tabacu@imgtec.com>2014-11-06 10:02:45 +0000
committerToma Tabacu <toma.tabacu@imgtec.com>2014-11-06 10:02:45 +0000
commitdde4c464dd8c8d6abe6be7ce7c1eaf307309197f (patch)
tree508f65aee405144fb5eab3bae428cdcbf00535e9 /llvm/lib/Target
parent66e799ff1b5b31300fbe06185fac81c4402fe18a (diff)
downloadbcm5719-llvm-dde4c464dd8c8d6abe6be7ce7c1eaf307309197f.tar.gz
bcm5719-llvm-dde4c464dd8c8d6abe6be7ce7c1eaf307309197f.zip
[mips] Improve error/warning messages and testing for the .cpload assembler directive.
Summary: Improved warning message when using .cpload inside a reorder section and added an error message for using .cpload with Mips16 enabled. Modified the tests to fit with the changes mentioned above, added a test-case for the N32 ABI in cpload.s and did some reformatting to make the tests easier to read. Reviewers: dsanders Reviewed By: dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5465 llvm-svn: 221447
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
index f78eec5fdaa..bf28368a7f5 100644
--- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
+++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp
@@ -3030,9 +3030,12 @@ bool MipsAsmParser::eatComma(StringRef ErrorStr) {
bool MipsAsmParser::parseDirectiveCpLoad(SMLoc Loc) {
if (AssemblerOptions.back()->isReorder())
- Warning(Loc, ".cpload in reorder section");
+ Warning(Loc, ".cpload should be inside a noreorder section");
- // FIXME: Warn if cpload is used in Mips16 mode.
+ if (inMips16Mode()) {
+ reportParseError(".cpload is not supported in Mips16 mode");
+ return false;
+ }
SmallVector<std::unique_ptr<MCParsedAsmOperand>, 1> Reg;
OperandMatchResultTy ResTy = parseAnyRegister(Reg);
@@ -3047,6 +3050,12 @@ bool MipsAsmParser::parseDirectiveCpLoad(SMLoc Loc) {
return false;
}
+ // If this is not the end of the statement, report an error.
+ if (getLexer().isNot(AsmToken::EndOfStatement)) {
+ reportParseError("unexpected token, expected end of statement");
+ return false;
+ }
+
getTargetStreamer().emitDirectiveCpLoad(RegOpnd.getGPR32Reg());
return false;
}
OpenPOWER on IntegriCloud