mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-22 10:33:23 +00:00
Recognize a few more documented register name aliases for ARM in the asm lexer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122523 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3c904694fc
commit
940c8e5494
@ -121,6 +121,24 @@ AsmToken ARMBaseAsmLexer::LexTokenUAL() {
|
|||||||
StringRef lowerRef(lowerCase);
|
StringRef lowerRef(lowerCase);
|
||||||
|
|
||||||
unsigned regID = MatchRegisterName(lowerRef);
|
unsigned regID = MatchRegisterName(lowerRef);
|
||||||
|
// Check for register aliases.
|
||||||
|
// r13 -> sp
|
||||||
|
// r14 -> lr
|
||||||
|
// r15 -> pc
|
||||||
|
// ip -> r12
|
||||||
|
// FIXME: Some assemblers support lots of others. Do we want them all?
|
||||||
|
if (!regID) {
|
||||||
|
if (lowerCase.size() == 3 && lowerCase[0] == 'r'
|
||||||
|
&& lowerCase[1] == '1') {
|
||||||
|
switch (lowerCase[2]) {
|
||||||
|
default: break;
|
||||||
|
case '3': regID = ARM::SP;
|
||||||
|
case '4': regID = ARM::LR;
|
||||||
|
case '5': regID = ARM::PC;
|
||||||
|
}
|
||||||
|
} else if (lowerCase == "ip")
|
||||||
|
regID = ARM::R12;
|
||||||
|
}
|
||||||
|
|
||||||
if (regID) {
|
if (regID) {
|
||||||
return AsmToken(AsmToken::Register,
|
return AsmToken(AsmToken::Register,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user