]> granicus.if.org Git - clang/commit
Make clang-format remove duplicate headers when sorting #includes.
authorEric Liu <ioeric@google.com>
Wed, 10 Aug 2016 09:32:23 +0000 (09:32 +0000)
committerEric Liu <ioeric@google.com>
Wed, 10 Aug 2016 09:32:23 +0000 (09:32 +0000)
commit832dfc2ae9e3bae085a9ef5c97c9d864139030e6
tree96f0f41cef04c03741aa30174a9e50cac4c2288e
parentafb075bfdb5cafe1edb40a3508f74b56d5b6fc4b
Make clang-format remove duplicate headers when sorting #includes.

Summary: When sorting #includes, #include directives that have the same text will be deduplicated when sorting #includes, and only the first #include in the duplicate #includes remains. If the `Cursor` is provided and put on a deleted #include, it will be put on the remaining #include in the duplicate #includes.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@278206 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/Format.cpp
test/Format/remove-duplicate-includes.cpp [new file with mode: 0644]
tools/clang-format/ClangFormat.cpp
unittests/Format/SortIncludesTest.cpp