llvm-project/clang
Paul Hoad 603650213b [clang-format] [PR43372] - clang-format shows replacements in DOS files when no replacement is needed
Summary:
This is a patch to fix PR43372 (https://bugs.llvm.org/show_bug.cgi?id=43372) - clang-format can't format file with includes, ( which really keep providing replacements for already sorted headers.)

A similar issue was addressed by @krasimir in {D60199}, however, this seemingly only prevented the issue when the files being formatted did not contain windows line endings (\r\n)

It's possible this is related to https://twitter.com/StephanTLavavej/status/1176722938243895296 given who @STL_MSFT  works for!

As people often used the existence of replacements to determine if a file needs clang-formatting, this is probably pretty important for windows users

There may be a better way of comparing 2 strings and ignoring \r (which appear in both Results and Code), I couldn't choose between this idiom or the copy_if approach, but I'm happy to change it to whatever people consider more performant.

Reviewers: krasimir, klimek, owenpan, ioeric

Reviewed By: krasimir

Subscribers: cfe-commits, STL_MSFT, krasimir

Tags: #clang-format, #clang, #clang-tools-extra

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

llvm-svn: 373388
2019-10-01 20:20:22 +00:00
..
INPUTS
bindings [TestCommit] Trivial change to test commit access. 2019-09-19 09:24:42 +00:00
cmake [CMake][Fuchsia] Enable experimental pass manager by default 2019-08-29 23:12:06 +00:00
docs Decrease the verbosity of the -ftime-trace option 2019-10-01 07:52:42 +00:00
examples Fixup build of clang-interpreter example after change in r370122. 2019-08-28 02:13:24 +00:00
include [Diagnostics] Make -Wenum-compare-conditional off by default 2019-10-01 18:12:13 +00:00
lib [clang-format] [PR43372] - clang-format shows replacements in DOS files when no replacement is needed 2019-10-01 20:20:22 +00:00
runtime [GWP-ASan] Mutex implementation [2]. 2019-05-30 19:45:32 +00:00
test [OPENMP50]Initial codegen for declare variant implementation vendor. 2019-10-01 20:18:32 +00:00
tools [clang][lldb][NFC] Encapsulate ExternalASTMerger::ImporterSource 2019-10-01 09:02:05 +00:00
unittests [clang-format] [PR43372] - clang-format shows replacements in DOS files when no replacement is needed 2019-10-01 20:20:22 +00:00
utils [OpenCL] Add version handling and add vector ld/st builtins 2019-09-19 13:41:51 +00:00
www [cxx_status] Mark P0784R7 as partially complete. 2019-09-29 07:16:13 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt [CMake] Don't set Python_ADDITIONAL_VERSIONS 2019-07-18 15:17:42 +00:00
CODE_OWNERS.TXT
INSTALL.txt
LICENSE.TXT
ModuleInfo.txt
NOTES.txt
README.txt [NFC] Test commit 2019-06-12 07:50:48 +00:00

README.txt

//===----------------------------------------------------------------------===//
// C Language Family Front-end
//===----------------------------------------------------------------------===//

Welcome to Clang.  This is a compiler front-end for the C family of languages
(C, C++, Objective-C, and Objective-C++) which is built as part of the LLVM
compiler infrastructure project.

Unlike many other compiler frontends, Clang is useful for a number of things
beyond just compiling code: we intend for Clang to be host to a number of
different source-level tools.  One example of this is the Clang Static Analyzer.

If you're interested in more (including how to build Clang) it is best to read
the relevant web sites.  Here are some pointers:

Information on Clang:             http://clang.llvm.org/
Building and using Clang:         http://clang.llvm.org/get_started.html
Clang Static Analyzer:            http://clang-analyzer.llvm.org/
Information on the LLVM project:  http://llvm.org/

If you have questions or comments about Clang, a great place to discuss them is
on the Clang development mailing list:
  http://lists.llvm.org/mailman/listinfo/cfe-dev

If you find a bug in Clang, please file it in the LLVM bug tracker:
  http://llvm.org/bugs/