HomePhabricator

[Preprocessor] Fix newline before/after _Pragma.

Authored by Meinersbur on Thu, Nov 4, 10:03 PM.

Description

[Preprocessor] Fix newline before/after _Pragma.

The PragmaAssumeNonNullHandler (and maybe others) passes an invalid
SourceLocation to its callback, hence PrintPreprocessedOutput does not
know how many lines to insert between the previous token and the
pragma and does nothing.

With this patch we instead assume that the unknown token is on the same
line as the previous such that we can call the procedure that also emits
semantically significant whitespace.

Fixes bug reported here: https://reviews.llvm.org/D104601#3105044

Details

Committed
MeinersburThu, Nov 4, 10:43 PM
Parents
rG8f099d17a1be: [Preprocessor] Fix warning: left and right subexpressions are identical. NFCI.
Branches
Unknown
Tags
Unknown