mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-15 19:24:33 +00:00
[ARM] Warn on deprecated IT blocks in v8 AArch32 assembly.
Patch by Artyom Skrobov. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191885 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "ARMFeatures.h"
|
||||
#include "llvm/MC/MCTargetAsmParser.h"
|
||||
#include "MCTargetDesc/ARMAddressingModes.h"
|
||||
#include "MCTargetDesc/ARMBaseInfo.h"
|
||||
@@ -7622,12 +7623,22 @@ MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
|
||||
return true;
|
||||
}
|
||||
|
||||
// Some instructions need post-processing to, for example, tweak which
|
||||
// encoding is selected. Loop on it while changes happen so the
|
||||
// individual transformations can chain off each other. E.g.,
|
||||
// tPOP(r8)->t2LDMIA_UPD(sp,r8)->t2STR_POST(sp,r8)
|
||||
while (processInstruction(Inst, Operands))
|
||||
;
|
||||
{ // processInstruction() updates inITBlock state, we need to save it away
|
||||
bool wasInITBlock = inITBlock();
|
||||
|
||||
// Some instructions need post-processing to, for example, tweak which
|
||||
// encoding is selected. Loop on it while changes happen so the
|
||||
// individual transformations can chain off each other. E.g.,
|
||||
// tPOP(r8)->t2LDMIA_UPD(sp,r8)->t2STR_POST(sp,r8)
|
||||
while (processInstruction(Inst, Operands))
|
||||
;
|
||||
|
||||
// Only after the instruction is fully processed, we can validate it
|
||||
if (wasInITBlock && hasV8Ops() && isThumb() &&
|
||||
!isV8EligibleForIT(&Inst, 2)) {
|
||||
Warning(IDLoc, "deprecated instruction in IT block");
|
||||
}
|
||||
}
|
||||
|
||||
// Only move forward at the very end so that everything in validate
|
||||
// and process gets a consistent answer about whether we're in an IT
|
||||
|
Reference in New Issue
Block a user