[llvm-commits] [llvm] r166779 - in /llvm/trunk/lib: MC/MCParser/AsmParser.cpp Target/X86/AsmParser/X86AsmParser.cpp
Chad Rosier
mcrosier at apple.com
Fri Oct 26 09:09:20 PDT 2012
Author: mcrosier
Date: Fri Oct 26 11:09:20 2012
New Revision: 166779
URL: http://llvm.org/viewvc/llvm-project?rev=166779&view=rev
Log:
[ms-inline asm] Have the target AsmParser create the asmrewrite for the offsetof
operator.
Modified:
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=166779&r1=166778&r2=166779&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Fri Oct 26 11:09:20 2012
@@ -3667,12 +3667,6 @@
AsmStrRewrites.push_back(AsmRewrite(AOK_SizeDirective,
Operand->getStartLoc(), 0,
Operand->getMemSize()));
-
- // Don't emit the offset directive.
- if (Operand->isOffsetOf())
- AsmStrRewrites.push_back(AsmRewrite(AOK_Skip,
- Operand->getOffsetOfLoc(), 7));
-
if (isOutput) {
std::string Constraint = "=";
++InputIdx;
Modified: llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp?rev=166779&r1=166778&r2=166779&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp (original)
+++ llvm/trunk/lib/Target/X86/AsmParser/X86AsmParser.cpp Fri Oct 26 11:09:20 2012
@@ -879,13 +879,16 @@
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.
More information about the llvm-commits
mailing list