diff options
author | Chad Rosier <mcrosier@apple.com> | 2013-02-12 19:42:32 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2013-02-12 19:42:32 +0000 |
commit | e1d640312889a9e5ec4fc6cd3d6a1bc74289c8a9 (patch) | |
tree | 6f156b9f7fbd39c1332546667c09ddc18b072a01 | |
parent | ab9d251e8569416e37caf29485ad1dd89f148fac (diff) | |
download | external_llvm-e1d640312889a9e5ec4fc6cd3d6a1bc74289c8a9.zip external_llvm-e1d640312889a9e5ec4fc6cd3d6a1bc74289c8a9.tar.gz external_llvm-e1d640312889a9e5ec4fc6cd3d6a1bc74289c8a9.tar.bz2 |
[ms-inline asm] Pass the length of the IDVal, so we can do a proper AsmRewrite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174999 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/MC/MCParser/AsmParser.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp index a4b4a54..c01ea33 100644 --- a/lib/MC/MCParser/AsmParser.cpp +++ b/lib/MC/MCParser/AsmParser.cpp @@ -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(ParseStatementInfo &Info) { // _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 DirectiveLoc) { 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 IDLoc, ParseStatementInfo &Info) { 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; } |