summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC
diff options
context:
space:
mode:
authorEric Astor <epastor@google.com>2019-12-22 00:09:37 -0500
committerEric Astor <epastor@google.com>2019-12-22 09:16:34 -0500
commitdc5b614fa9a1c83e8275fcb9c3f78444d0a30514 (patch)
tree38cc0f3cbaf41050d00d06e2f277fba322979f43 /llvm/lib/MC
parent0b38af89e2c0adc13a6efb1dd04485229ef0d1c6 (diff)
downloadbcm5719-llvm-dc5b614fa9a1c83e8275fcb9c3f78444d0a30514.tar.gz
bcm5719-llvm-dc5b614fa9a1c83e8275fcb9c3f78444d0a30514.zip
[ms] [X86] Use "P" modifier on operands to call instructions in inline X86 assembly.
Summary: This is documented as the appropriate template modifier for call operands. Fixes PR44272, and adds a regression test. Also adds support for operand modifiers in Intel-style inline assembly. Reviewers: rnk Reviewed By: rnk Subscribers: merge_guards_bot, hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D71677
Diffstat (limited to 'llvm/lib/MC')
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index 9350e7cb47f..7bbd94d0709 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -5839,7 +5839,10 @@ bool AsmParser::parseMSInlineAsm(
InputDecls.push_back(OpDecl);
InputDeclsAddressOf.push_back(Operand.needAddressOf());
InputConstraints.push_back(Operand.getConstraint().str());
- AsmStrRewrites.emplace_back(AOK_Input, Start, SymName.size());
+ if (Operand.isCallOperand())
+ AsmStrRewrites.emplace_back(AOK_CallInput, Start, SymName.size());
+ else
+ AsmStrRewrites.emplace_back(AOK_Input, Start, SymName.size());
}
}
@@ -5929,6 +5932,9 @@ bool AsmParser::parseMSInlineAsm(
case AOK_Input:
OS << '$' << InputIdx++;
break;
+ case AOK_CallInput:
+ OS << "${" << InputIdx++ << ":P}";
+ break;
case AOK_Output:
OS << '$' << OutputIdx++;
break;
OpenPOWER on IntegriCloud