[all-commits] [llvm/llvm-project] 0e2586: [Preprocessor] Ensure newline after #pragma introd...

Michael Kruse via All-commits all-commits at lists.llvm.org
Sun Aug 1 17:09:53 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0e2586779ca6606a3df085f253a31b89b8ad8508
      https://github.com/llvm/llvm-project/commit/0e2586779ca6606a3df085f253a31b89b8ad8508
  Author: Michael Kruse <llvm-project at meinersbur.de>
  Date:   2021-08-01 (Sun, 01 Aug 2021)

  Changed paths:
    M clang/lib/Frontend/PrintPreprocessedOutput.cpp
    A clang/test/Preprocessor/whitespace-ms-extensions.c

  Log Message:
  -----------
  [Preprocessor] Ensure newline after #pragma introduced by -fms-extensions.

The -fms-extensions converts __pragma (and _Pragma) into a #pragma that
has to occur at the beginning of a line and end with a newline. This
patch ensures that the newline after the #pragma is added even if
Token::isAtStartOfLine() indicated that we should not start a newline.

Committing relying post-commit review since the change is small, some
downstream uses might be blocked without this fix, and to make clear the
decision of the new -fminimize-whitespace feature (fix on main, revert
on clang-13.x branch) suggested by @aaron.ballman in D104601.

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




More information about the All-commits mailing list