From 023c8802203d7f3b433d93233ccee6f8cce9ca5d Mon Sep 17 00:00:00 2001 From: Chad Rosier Date: Tue, 19 Mar 2013 17:32:17 +0000 Subject: [ms-inline asm] Move the size directive asm rewrite into the target specific logic as a QOI cleanup. rdar://13445327 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177413 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/MC/MCParser/AsmParser.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'lib/MC/MCParser/AsmParser.cpp') diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp index 9d523774e4..8f754a4be9 100644 --- a/lib/MC/MCParser/AsmParser.cpp +++ b/lib/MC/MCParser/AsmParser.cpp @@ -4131,11 +4131,6 @@ AsmParser::parseMSInlineAsm(void *AsmLoc, std::string &AsmString, continue; bool isOutput = (i == 1) && Desc.mayStore(); - if (Operand->isMem() && Operand->needSizeDirective()) - AsmStrRewrites.push_back(AsmRewrite(AOK_SizeDirective, - Operand->getStartLoc(), /*Len*/0, - Operand->getMemSize())); - if (isOutput) { ++InputIdx; OutputDecls.push_back(OpDecl); @@ -4192,15 +4187,13 @@ AsmParser::parseMSInlineAsm(void *AsmLoc, std::string &AsmString, E = AsmStrRewrites.end(); I != E; ++I) { const char *Loc = (*I).Loc.getPointer(); - assert(Loc >= Start && "Expected Loc to be after Start!"); + assert(Loc >= Start && "Expected Loc to be at or after Start!"); unsigned AdditionalSkip = 0; AsmRewriteKind Kind = (*I).Kind; - // Emit everything up to the immediate/expression. If the previous rewrite - // was a size directive, then this has already been done. - if (PrevKind != AOK_SizeDirective) - OS << StringRef(Start, Loc - Start); + // Emit everything up to the immediate/expression. + OS << StringRef(Start, Loc - Start); PrevKind = Kind; // Skip the original expression. @@ -4254,8 +4247,7 @@ AsmParser::parseMSInlineAsm(void *AsmLoc, std::string &AsmString, } // Skip the original expression. - if (Kind != AOK_SizeDirective) - Start = Loc + (*I).Len + AdditionalSkip; + Start = Loc + (*I).Len + AdditionalSkip; } // Emit the remainder of the asm string. -- cgit v1.2.3-18-g5258