OSDN Git Service

Refactor and cleanup Assembly Parsing / Lexing
authorNirav Dave <niravd@google.com>
Fri, 17 Jun 2016 16:06:17 +0000 (16:06 +0000)
committerNirav Dave <niravd@google.com>
Fri, 17 Jun 2016 16:06:17 +0000 (16:06 +0000)
commite9d4816026322dea92e02de6ce0d0fe9e540a92d
tree312901309b825b9c8127480e5dafa6326a384a42
parentafaddb4d867c3843e090eec8635168be94f88730
Refactor and cleanup Assembly Parsing / Lexing

Recommiting after fixing non-atomic insert to front of SmallVector in
MCAsmLexer.h

Add explicit Comment Token in Assembly Lexing for future support for
outputting explicit comments from inline assembly. As part of this,
CPPHash Directives are now explicitly distinguished from Hash line
comments in Lexer.

Line comments are recorded as EndOfStatement tokens, not Comment tokens
to simplify compatibility with current TargetParsers. This slightly
complicates comment output.

This remove all lexing tasks out of the parser, does minor cleanup
to remove extraneous newlines Asm Output, and some improvements white
space handling.

Reviewers: rtrieu, dwmw2, rnk

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D20009

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273007 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCParser/AsmLexer.h
include/llvm/MC/MCParser/MCAsmLexer.h
lib/MC/MCParser/AsmLexer.cpp
lib/MC/MCParser/AsmParser.cpp
lib/Target/ARM/AsmParser/ARMAsmParser.cpp
lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp
lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp
lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
test/MC/AsmParser/hash-directive.s [new file with mode: 0644]