diff options
| author | Chad Rosier <mcrosier@apple.com> | 2012-10-26 16:09:20 +0000 |
|---|---|---|
| committer | Chad Rosier <mcrosier@apple.com> | 2012-10-26 16:09:20 +0000 |
| commit | e2f03771c44152083e3958a14ae543b635891a15 (patch) | |
| tree | 41cb2e53ca2da3fd32da793c3f0144d15e066c9b /llvm/lib | |
| parent | 808102685b2f82b07a98912993e74cc97d99f926 (diff) | |
| download | bcm5719-llvm-e2f03771c44152083e3958a14ae543b635891a15.tar.gz bcm5719-llvm-e2f03771c44152083e3958a14ae543b635891a15.zip | |
[ms-inline asm] Have the target AsmParser create the asmrewrite for the offsetof
operator.
llvm-svn: 166779
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/MC/MCParser/AsmParser.cpp | 6 | ||||
| -rw-r--r-- | llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | 5 |
2 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp index b47a6bdb540..0a657205493 100644 --- a/llvm/lib/MC/MCParser/AsmParser.cpp +++ b/llvm/lib/MC/MCParser/AsmParser.cpp @@ -3667,12 +3667,6 @@ bool AsmParser::ParseMSInlineAsm(void *AsmLoc, std::string &AsmString, 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; diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp index 7f47ef4c63e..a3e90af71ad 100644 --- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/llvm/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. |

