Prevent out of order HashDirective lexing in AsmLexer.
authorNirav Dave <niravd@google.com>
Mon, 3 Oct 2016 13:48:27 +0000 (13:48 +0000)
committerNirav Dave <niravd@google.com>
Mon, 3 Oct 2016 13:48:27 +0000 (13:48 +0000)
commit157891c57f013bdbc24feace83d01efdb84cf751
treee766e4f3bed67fe76dbd3f30195137d2061c80d4
parentd98493414bfff91b71a9ab5bbfc84b95e93ed123
Prevent out of order HashDirective lexing in AsmLexer.

Retrying after buildbot reset.

To lex hash directives we peek ahead to find component tokens, create a
unified token, and unlex the peeked tokens so the parser does not need
to parse the tokens then. Make sure we do not to lex another hash
directive during peek operation.

This fixes PR28921.

Reviewers: rnk, loladiro

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D24839

llvm-svn: 283111
llvm/include/llvm/MC/MCParser/AsmLexer.h
llvm/lib/MC/MCParser/AsmLexer.cpp
llvm/test/MC/AsmParser/pr28921.s [new file with mode: 0644]