1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00

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

llvm-svn: 174999
This commit is contained in:
Chad Rosier 2013-02-12 19:42:32 +00:00
parent 24b5149dc9
commit 3eb029b4c7

View File

@ -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;
}