summaryrefslogtreecommitdiff
path: root/lib/MC
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-10-24 17:22:29 +0000
committerChad Rosier <mcrosier@apple.com>2012-10-24 17:22:29 +0000
commitc0a14b86f7ad334c2a557c1ee4fff12e8d396fd0 (patch)
treed24e7e190dedce201e651b1c1e360a2d95b1dd4f /lib/MC
parent2f87640b86315beab8a5671cc23f524e59c58bd3 (diff)
downloadllvm-c0a14b86f7ad334c2a557c1ee4fff12e8d396fd0.tar.gz
llvm-c0a14b86f7ad334c2a557c1ee4fff12e8d396fd0.tar.bz2
llvm-c0a14b86f7ad334c2a557c1ee4fff12e8d396fd0.tar.xz
[ms-inline asm] Create a register operand, rather than a memory operand when we
see the offsetof operator. Previously, we were matching something like MOVrm in the front-end and later matching MOVrr in the back-end. This change makes things more consistent. It also fixes cases where we can't match against a memory operand as the source (test cases coming). Part of rdar://12470317 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166592 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r--lib/MC/MCParser/AsmParser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp
index b87a239a55..5e4447a321 100644
--- a/lib/MC/MCParser/AsmParser.cpp
+++ b/lib/MC/MCParser/AsmParser.cpp
@@ -3665,7 +3665,7 @@ bool AsmParser::ParseMSInlineAsm(void *AsmLoc, std::string &AsmString,
}
// Register operand.
- if (Operand->isReg()) {
+ if (Operand->isReg() && !Operand->isOffsetOf()) {
unsigned NumDefs = Desc.getNumDefs();
// Clobber.
if (NumDefs && Operand->getMCOperandNum() < NumDefs) {
@@ -3683,7 +3683,7 @@ bool AsmParser::ParseMSInlineAsm(void *AsmLoc, std::string &AsmString,
Size);
if (OpDecl) {
bool isOutput = (i == 1) && Desc.mayStore();
- if (Operand->needSizeDirective() && !Operand->isOffsetOf())
+ if (!Operand->isOffsetOf() && Operand->needSizeDirective())
AsmStrRewrites.push_back(AsmRewrite(AOK_SizeDirective,
Operand->getStartLoc(), 0,
Operand->getMemSize()));