diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-01-17 17:11:55 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-01-17 17:11:55 +0000 |
commit | d23c4359df729f97090c1b05fa4c10888deab21a (patch) | |
tree | 9a1dfaad09117867685f785ed8bd84849fe0677e /contrib/llvm | |
parent | 7e5f6f25883e036b7d857647f0ac23e4ca5c0615 (diff) | |
download | src-d23c4359df729f97090c1b05fa4c10888deab21a.tar.gz src-d23c4359df729f97090c1b05fa4c10888deab21a.zip |
Pull in r322623 from upstream llvm trunk (by Andrew V. Tischenko):
Allow usage of X86-prefixes as separate instrs.
Differential Revision: https://reviews.llvm.org/D42102
This should fix parse errors when x86 prefixes (such as 'lock' and
'rep') are followed by various non-mnemonic tokens, e.g. comments, .byte
directives and labels.
PR: 224669,225054
Notes
Notes:
svn path=/head/; revision=328090
Diffstat (limited to 'contrib/llvm')
-rw-r--r-- | contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp index f1ce430f3323..f2ffba7d5418 100644 --- a/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp +++ b/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp @@ -2375,6 +2375,13 @@ bool X86AsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name, .Cases("repne", "repnz", X86::IP_HAS_REPEAT_NE) .Default(X86::IP_NO_PREFIX); // Invalid prefix (impossible) Flags |= Prefix; + if (getLexer().is(AsmToken::EndOfStatement)) { + // We don't have real instr with the given prefix + // let's use the prefix as the instr. + // TODO: there could be several prefixes one after another + Flags = X86::IP_NO_PREFIX; + break; + } Name = Parser.getTok().getString(); Parser.Lex(); // eat the prefix // Hack: we could have something like "rep # some comment" or |