[PATCH] D140984: [clang] Correct -frewrite-includes generation of line control directives with mixed EOL forms.

Tom Honermann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 4 06:38:50 PST 2023


tahonermann created this revision.
tahonermann added reviewers: rnk, cor3ntin, shafik, erichkeane, aaron.ballman.
Herald added a project: All.
tahonermann requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Previously, if a header file and a source file used different end of line (EOL) forms, preprocessed output generated with the -frewrite-includes option would, in some cases, generate line control directives with the wrong line number due to an error in how source file lines were counted.

Fixes https://github.com/llvm/llvm-project/issues/59736


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140984

Files:
  clang/lib/Frontend/Rewrite/InclusionRewriter.cpp
  clang/test/Frontend/rewrite-includes-mixed-eol-crlf.c
  clang/test/Frontend/rewrite-includes-mixed-eol-crlf.h
  clang/test/Frontend/rewrite-includes-mixed-eol-lf.c
  clang/test/Frontend/rewrite-includes-mixed-eol-lf.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140984.486267.patch
Type: text/x-patch
Size: 3920 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230104/3937069a/attachment-0001.bin>


More information about the cfe-commits mailing list