From 787fdb86a71c5108c231b3bbbb7d3fea3ce4bb8c Mon Sep 17 00:00:00 2001 From: Joey Gouly Date: Fri, 2 Aug 2013 19:18:12 +0000 Subject: [PATCH] [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 --- lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 12 ++++++++++++ test/MC/ARM/deprecated-v8.s | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 test/MC/ARM/deprecated-v8.s diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 8e56a1ab942..862e1166027 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -229,6 +229,7 @@ class ARMAsmParser : public MCTargetAsmParser { SmallVectorImpl &Operands); bool shouldOmitPredicateOperand(StringRef Mnemonic, SmallVectorImpl &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; } diff --git a/test/MC/ARM/deprecated-v8.s b/test/MC/ARM/deprecated-v8.s new file mode 100644 index 00000000000..e509a35a94a --- /dev/null +++ b/test/MC/ARM/deprecated-v8.s @@ -0,0 +1,3 @@ +@ RUN: llvm-mc -triple armv8 -show-encoding < %s 2>&1 | FileCheck %s +setend be +@ CHECK: warning: deprecated on armv8 -- 2.34.1