mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
[ms-inline asm] Add support for using offsetof operator with variables that use
namespace alias qualifiers. Test case coming on clang side shortly. Part of rdar://13499009 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179339 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4df1854f26
commit
5ea1ea8db8
@ -1411,9 +1411,14 @@ X86Operand *X86AsmParser::ParseIntelOffsetOfOperator() {
|
||||
|
||||
const MCExpr *Val;
|
||||
SMLoc Start = Tok.getLoc(), End;
|
||||
StringRef Identifier = Tok.getString();
|
||||
if (getParser().parsePrimaryExpr(Val, End))
|
||||
return ErrorOperand(Start, "Unable to parse expression!");
|
||||
|
||||
const MCExpr *Disp = 0;
|
||||
if (X86Operand *Err = ParseIntelVarWithQualifier(Disp, Identifier))
|
||||
return Err;
|
||||
|
||||
// Don't emit the offset operator.
|
||||
InstInfo->AsmRewrites->push_back(AsmRewrite(AOK_Skip, OffsetOfLoc, 7));
|
||||
|
||||
@ -1421,10 +1426,8 @@ X86Operand *X86AsmParser::ParseIntelOffsetOfOperator() {
|
||||
// register operand to ensure proper matching. Just pick a GPR based on
|
||||
// the size of a pointer.
|
||||
unsigned RegNo = is64BitMode() ? X86::RBX : X86::EBX;
|
||||
unsigned Len = End.getPointer() - Start.getPointer();
|
||||
StringRef SymName(Start.getPointer(), Len);
|
||||
return X86Operand::CreateReg(RegNo, Start, End, /*GetAddress=*/true,
|
||||
OffsetOfLoc, SymName);
|
||||
OffsetOfLoc, Identifier);
|
||||
}
|
||||
|
||||
enum IntelOperatorKind {
|
||||
|
Loading…
Reference in New Issue
Block a user