[llvm] r174999 - [ms-inline asm] Pass the length of the IDVal, so we can do a proper AsmRewrite.

Chad Rosier mcrosier at apple.com
Tue Feb 12 11:42:32 PST 2013


Author: mcrosier
Date: Tue Feb 12 13:42:32 2013
New Revision: 174999

URL: http://llvm.org/viewvc/llvm-project?rev=174999&view=rev
Log:
[ms-inline asm] Pass the length of the IDVal, so we can do a proper AsmRewrite.

Modified:
    llvm/trunk/lib/MC/MCParser/AsmParser.cpp

Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=174999&r1=174998&r2=174999&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Tue Feb 12 13:42:32 2013
@@ -444,7 +444,8 @@ private:
   bool ParseDirectiveEndr(SMLoc DirectiveLoc); // ".endr"
 
   // "_emit"
-  bool ParseDirectiveEmit(SMLoc DirectiveLoc, ParseStatementInfo &Info);
+  bool ParseDirectiveEmit(SMLoc DirectiveLoc, ParseStatementInfo &Info,
+                          size_t len);
 
   void initializeDirectiveKindMap();
 };
@@ -1448,7 +1449,7 @@ bool AsmParser::ParseStatement(ParseStat
 
   // _emit or __emit
   if (ParsingInlineAsm && (IDVal == "_emit" || IDVal == "__emit"))
-    return ParseDirectiveEmit(IDLoc, Info);
+    return ParseDirectiveEmit(IDLoc, Info, IDVal.size());
 
   CheckForValidSection();
 
@@ -3985,7 +3986,7 @@ bool AsmParser::ParseDirectiveEndr(SMLoc
   return false;
 }
 
-bool AsmParser::ParseDirectiveEmit(SMLoc IDLoc, ParseStatementInfo &Info) {
+bool AsmParser::ParseDirectiveEmit(SMLoc IDLoc, ParseStatementInfo &Info, size_t len) {
   const MCExpr *Value;
   SMLoc ExprLoc = getLexer().getLoc();
   if (ParseExpression(Value))
@@ -3997,7 +3998,7 @@ bool AsmParser::ParseDirectiveEmit(SMLoc
   if (!isUIntN(8, IntValue) && !isIntN(8, IntValue))
     return Error(ExprLoc, "literal value out of range for directive");
 
-  Info.AsmRewrites->push_back(AsmRewrite(AOK_Emit, IDLoc, 5));
+  Info.AsmRewrites->push_back(AsmRewrite(AOK_Emit, IDLoc, len));
   return false;
 }
 





More information about the llvm-commits mailing list