@@ -3299,7 +3299,8 @@ ParseStatus AArch64AsmParser::tryParseAdrpLabel(OperandVector &Operands) {
32993299 if (DarwinSpec == AArch64::S_None && ELFSpec == AArch64::S_INVALID) {
33003300 // No modifier was specified at all; this is the syntax for an ELF basic
33013301 // ADRP relocation (unfortunately).
3302- Expr = MCSpecifierExpr::create (Expr, AArch64::S_ABS_PAGE, getContext ());
3302+ Expr =
3303+ MCSpecifierExpr::create (Expr, AArch64::S_ABS_PAGE, getContext (), S);
33033304 } else if ((DarwinSpec == AArch64::S_MACHO_GOTPAGE ||
33043305 DarwinSpec == AArch64::S_MACHO_TLVPPAGE) &&
33053306 Addend != 0 ) {
@@ -3351,7 +3352,7 @@ ParseStatus AArch64AsmParser::tryParseAdrLabel(OperandVector &Operands) {
33513352 if (DarwinSpec == AArch64::S_None && ELFSpec == AArch64::S_INVALID) {
33523353 // No modifier was specified at all; this is the syntax for an ELF basic
33533354 // ADR relocation (unfortunately).
3354- Expr = MCSpecifierExpr::create (Expr, AArch64::S_ABS, getContext ());
3355+ Expr = MCSpecifierExpr::create (Expr, AArch64::S_ABS, getContext (), S );
33553356 } else if (ELFSpec != AArch64::S_GOT_AUTH_PAGE) {
33563357 // For tiny code model, we use :got_auth: operator to fill 21-bit imm of
33573358 // adr. It's not actually GOT entry page address but the GOT address
@@ -4394,7 +4395,7 @@ bool AArch64AsmParser::parseRegister(OperandVector &Operands) {
43944395bool AArch64AsmParser::parseSymbolicImmVal (const MCExpr *&ImmVal) {
43954396 bool HasELFModifier = false ;
43964397 AArch64::Specifier RefKind;
4397-
4398+ SMLoc Loc = getLexer (). getLoc ();
43984399 if (parseOptionalToken (AsmToken::Colon)) {
43994400 HasELFModifier = true ;
44004401
@@ -4468,7 +4469,7 @@ bool AArch64AsmParser::parseSymbolicImmVal(const MCExpr *&ImmVal) {
44684469 return true ;
44694470
44704471 if (HasELFModifier)
4471- ImmVal = MCSpecifierExpr::create (ImmVal, RefKind, getContext ());
4472+ ImmVal = MCSpecifierExpr::create (ImmVal, RefKind, getContext (), Loc );
44724473
44734474 SMLoc EndLoc;
44744475 if (getContext ().getAsmInfo ()->hasSubsectionsViaSymbols ()) {
@@ -8211,7 +8212,7 @@ bool AArch64AsmParser::parseDataExpr(const MCExpr *&Res) {
82118212 const MCExpr *Term;
82128213 if (getParser ().parsePrimaryExpr (Term, EndLoc, nullptr ))
82138214 return true ;
8214- Res = MCBinaryExpr::create (*Opcode, Res, Term, getContext ());
8215+ Res = MCBinaryExpr::create (*Opcode, Res, Term, getContext (), Res-> getLoc () );
82158216 }
82168217 return false ;
82178218}
0 commit comments