forked from OSchip/llvm-project
[ARMv8] Add an assembler warning for the deprecated 'setend' instruction.
llvm-svn: 187666
This commit is contained in:
parent
8e091352c9
commit
5d0564d2e6
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
@ RUN: llvm-mc -triple armv8 -show-encoding < %s 2>&1 | FileCheck %s
|
||||
setend be
|
||||
@ CHECK: warning: deprecated on armv8
|
Loading…
Reference in New Issue