aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-10-26 16:09:20 +0000
committerChad Rosier <mcrosier@apple.com>2012-10-26 16:09:20 +0000
commit6e43157b5d39a713d4061f97629bf9107c6d25e0 (patch)
treed3813b668e41cb2898ae640c91d90f347f7fca4f /lib/Target
parente5372d6565839a5ee493d417a45b59cc8fca9028 (diff)
downloadexternal_llvm-6e43157b5d39a713d4061f97629bf9107c6d25e0.zip
external_llvm-6e43157b5d39a713d4061f97629bf9107c6d25e0.tar.gz
external_llvm-6e43157b5d39a713d4061f97629bf9107c6d25e0.tar.bz2
[ms-inline asm] Have the target AsmParser create the asmrewrite for the offsetof
operator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r--lib/Target/X86/AsmParser/X86AsmParser.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Target/X86/AsmParser/X86AsmParser.cpp b/lib/Target/X86/AsmParser/X86AsmParser.cpp
index 7f47ef4..a3e90af 100644
--- a/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -879,13 +879,16 @@ X86Operand *X86AsmParser::ParseIntelOffsetOfOperator(SMLoc Start) {
Start = Parser.getTok().getLoc();
assert (Parser.getTok().is(AsmToken::Identifier) && "Expected an identifier");
- SMLoc End;
+ SMLoc End;
const MCExpr *Val;
if (getParser().ParseExpression(Val, End))
return 0;
End = Parser.getTok().getLoc();
+ // Don't emit the offset operator.
+ InstInfo->AsmRewrites->push_back(AsmRewrite(AOK_Skip, OffsetOfLoc, 7));
+
// The offset operator will have an 'r' constraint, thus we need to create
// register operand to ensure proper matching. Just pick a GPR based on
// the size of a pointer.