HomePhabricator

Remove use of lookahead from _Pragma handling and from all other

Description

Remove use of lookahead from _Pragma handling and from all other
internal lexing steps in the preprocessor.

It is not safe to use the preprocessor's token lookahead except when
operating on the final sequence of tokens that would be produced by
phase 4 of translation. Doing so corrupts the token lookahead cache used
by the parser. (See added testcase for an example.) Lookahead should
instead be viewed as a layer on top of the normal lexer.

Added assertions to catch any further incorrect uses of lookahead within
lexing actions.

Details

Committed
rsmithApr 11 2019, 2:18 PM
Parents
rL358229: [CVP] Generate full test checks for overflows.ll; NFC
Branches
Unknown
Tags
Unknown