aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2012-10-26 18:04:20 +0000
committerChad Rosier <mcrosier@apple.com>2012-10-26 18:04:20 +0000
commitefcb3d9c1cd9410949b4005fbe6f2817f8dfe395 (patch)
tree9ff085ed699810537a23ae7271fb0fbf501f9a5e /lib/MC
parent8999f4777b920ab144a15a6f54a865a07f9c4a7f (diff)
downloadexternal_llvm-efcb3d9c1cd9410949b4005fbe6f2817f8dfe395.zip
external_llvm-efcb3d9c1cd9410949b4005fbe6f2817f8dfe395.tar.gz
external_llvm-efcb3d9c1cd9410949b4005fbe6f2817f8dfe395.tar.bz2
[ms-inline asm] Add support for the TYPE operator.
Part of rdar://12576868 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166790 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r--lib/MC/MCParser/AsmParser.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp
index 0a65720..e8a87b0 100644
--- a/lib/MC/MCParser/AsmParser.cpp
+++ b/lib/MC/MCParser/AsmParser.cpp
@@ -3638,9 +3638,9 @@ bool AsmParser::ParseMSInlineAsm(void *AsmLoc, std::string &AsmString,
// Immediate.
if (Operand->isImm()) {
- AsmStrRewrites.push_back(AsmRewrite(AOK_Imm,
- Operand->getStartLoc(),
- Operand->getNameLen()));
+ if (Operand->needAsmRewrite())
+ AsmStrRewrites.push_back(AsmRewrite(AOK_ImmPrefix,
+ Operand->getStartLoc()));
continue;
}
@@ -3665,7 +3665,8 @@ bool AsmParser::ParseMSInlineAsm(void *AsmLoc, std::string &AsmString,
bool isOutput = (i == 1) && Desc.mayStore();
if (!Operand->isOffsetOf() && Operand->needSizeDirective())
AsmStrRewrites.push_back(AsmRewrite(AOK_SizeDirective,
- Operand->getStartLoc(), 0,
+ Operand->getStartLoc(),
+ /*Len*/0,
Operand->getMemSize()));
if (isOutput) {
std::string Constraint = "=";
@@ -3743,7 +3744,11 @@ bool AsmParser::ParseMSInlineAsm(void *AsmLoc, std::string &AsmString,
switch (Kind) {
default: break;
case AOK_Imm:
- OS << Twine("$$") + StringRef(Loc, (*I).Len);
+ OS << Twine("$$");
+ OS << (*I).Val;
+ break;
+ case AOK_ImmPrefix:
+ OS << Twine("$$");
break;
case AOK_Input:
OS << '$';