[ARMv8] Add an assembler warning for the deprecated 'setend' instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187666 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Joey Gouly 2013-08-02 19:18:12 +00:00
parent f2855f8886
commit 787fdb86a7
2 changed files with 15 additions and 0 deletions

View File

@ -229,6 +229,7 @@ class ARMAsmParser : public MCTargetAsmParser {
SmallVectorImpl<MCParsedAsmOperand*> &Operands);
bool shouldOmitPredicateOperand(StringRef Mnemonic,
SmallVectorImpl<MCParsedAsmOperand*> &Operands);
bool isDeprecated(MCInst &Inst, StringRef &Info);
public:
enum ARMMatchResultTy {
@ -4876,6 +4877,13 @@ bool ARMAsmParser::shouldOmitPredicateOperand(
return false;
}
bool ARMAsmParser::isDeprecated(MCInst &Inst, StringRef &Info) {
if (hasV8Ops() && Inst.getOpcode() == ARM::SETEND) {
Info = "armv8";
return true;
}
}
static bool isDataTypeToken(StringRef Tok) {
return Tok == ".8" || Tok == ".16" || Tok == ".32" || Tok == ".64" ||
Tok == ".i8" || Tok == ".i16" || Tok == ".i32" || Tok == ".i64" ||
@ -5376,6 +5384,10 @@ validateInstruction(MCInst &Inst,
}
}
StringRef DepInfo;
if (isDeprecated(Inst, DepInfo))
Warning(Loc, "deprecated on " + DepInfo);
return false;
}

View File

@ -0,0 +1,3 @@
@ RUN: llvm-mc -triple armv8 -show-encoding < %s 2>&1 | FileCheck %s
setend be
@ CHECK: warning: deprecated on armv8