mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-06 23:32:27 +00:00
Revert my change to the X86 assembler for intel syntax to work with
directional labels. Because it doesn't work for windows :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197731 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
86f49d5c01
commit
ddc2347cc7
@ -1329,37 +1329,12 @@ bool X86AsmParser::ParseIntelExpression(IntelExprStateMachine &SM, SMLoc &End) {
|
|||||||
}
|
}
|
||||||
return Error(Tok.getLoc(), "Unexpected identifier!");
|
return Error(Tok.getLoc(), "Unexpected identifier!");
|
||||||
}
|
}
|
||||||
case AsmToken::Integer: {
|
case AsmToken::Integer:
|
||||||
if (isParsingInlineAsm() && SM.getAddImmPrefix())
|
if (isParsingInlineAsm() && SM.getAddImmPrefix())
|
||||||
InstInfo->AsmRewrites->push_back(AsmRewrite(AOK_ImmPrefix,
|
InstInfo->AsmRewrites->push_back(AsmRewrite(AOK_ImmPrefix,
|
||||||
Tok.getLoc()));
|
Tok.getLoc()));
|
||||||
// Look for 'b' or 'f' following an Integer as a directional label
|
SM.onInteger(Tok.getIntVal());
|
||||||
SMLoc Loc = getTok().getLoc();
|
|
||||||
int64_t IntVal = getTok().getIntVal();
|
|
||||||
End = consumeToken();
|
|
||||||
UpdateLocLex = false;
|
|
||||||
if (getLexer().getKind() == AsmToken::Identifier) {
|
|
||||||
StringRef IDVal = getTok().getString();
|
|
||||||
if (IDVal == "f" || IDVal == "b") {
|
|
||||||
MCSymbol *Sym =
|
|
||||||
getContext().GetDirectionalLocalSymbol(IntVal,
|
|
||||||
IDVal == "f" ? 1 : 0);
|
|
||||||
MCSymbolRefExpr::VariantKind Variant = MCSymbolRefExpr::VK_None;
|
|
||||||
const MCExpr *Val =
|
|
||||||
MCSymbolRefExpr::Create(Sym, Variant, getContext());
|
|
||||||
if (IDVal == "b" && Sym->isUndefined())
|
|
||||||
return Error(Loc, "invalid reference to undefined symbol");
|
|
||||||
StringRef Identifier = Sym->getName();
|
|
||||||
SM.onIdentifierExpr(Val, Identifier);
|
|
||||||
End = consumeToken();
|
|
||||||
} else {
|
|
||||||
SM.onInteger(IntVal);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
SM.onInteger(IntVal);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case AsmToken::Plus: SM.onPlus(); break;
|
case AsmToken::Plus: SM.onPlus(); break;
|
||||||
case AsmToken::Minus: SM.onMinus(); break;
|
case AsmToken::Minus: SM.onMinus(); break;
|
||||||
case AsmToken::Star: SM.onStar(); break;
|
case AsmToken::Star: SM.onStar(); break;
|
||||||
@ -1709,13 +1684,6 @@ X86Operand *X86AsmParser::ParseIntelOperand() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (getLexer().isNot(AsmToken::LBrac)) {
|
if (getLexer().isNot(AsmToken::LBrac)) {
|
||||||
// If a directional label (ie. 1f or 2b) was parsed above from
|
|
||||||
// ParseIntelExpression() then SM.getSym() was set to a pointer to
|
|
||||||
// to the MCExpr with the directional local symbol and this is a
|
|
||||||
// memory operand not an immediate operand.
|
|
||||||
if (SM.getSym())
|
|
||||||
return X86Operand::CreateMem(SM.getSym(), Start, End, Size);
|
|
||||||
|
|
||||||
const MCExpr *ImmExpr = MCConstantExpr::Create(Imm, getContext());
|
const MCExpr *ImmExpr = MCConstantExpr::Create(Imm, getContext());
|
||||||
return X86Operand::CreateImm(ImmExpr, Start, End);
|
return X86Operand::CreateImm(ImmExpr, Start, End);
|
||||||
}
|
}
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
// RUN: llvm-mc -triple x86_64-apple-darwin -x86-asm-syntax=intel %s | FileCheck %s
|
|
||||||
// rdar://14961158
|
|
||||||
.text
|
|
||||||
.align 16
|
|
||||||
.globl FUNCTION_NAME
|
|
||||||
.private_extern FUNCTION_NAME
|
|
||||||
FUNCTION_NAME:
|
|
||||||
.intel_syntax
|
|
||||||
cmp rdi, 1
|
|
||||||
jge 1f
|
|
||||||
// CHECK: jge "L11"
|
|
||||||
add rdi, 2
|
|
||||||
1:
|
|
||||||
// CHECK: "L11":
|
|
||||||
add rdi, 1
|
|
||||||
ret
|
|
Loading…
x
Reference in New Issue
Block a user