summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCParser/AsmParser.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-02-12 19:42:32 +0000
committerChad Rosier <mcrosier@apple.com>2013-02-12 19:42:32 +0000
commit5f6b4d3fc5b3d3d2888cc24061165cd0441c5a14 (patch)
tree2a0720da843fada2ce10d1aff9eb2d1c2fc664c3 /llvm/lib/MC/MCParser/AsmParser.cpp
parent93d629fdb888233b2ca3c320723cba960482e444 (diff)
downloadbcm5719-llvm-5f6b4d3fc5b3d3d2888cc24061165cd0441c5a14.tar.gz
bcm5719-llvm-5f6b4d3fc5b3d3d2888cc24061165cd0441c5a14.zip
[ms-inline asm] Pass the length of the IDVal, so we can do a proper AsmRewrite.
llvm-svn: 174999
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmParser.cpp')
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index a4b4a549579..c01ea33f647 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud