[clang-format] support header deletion in cleanupAroundReplacemnts.
authorEric Liu <ioeric@google.com>
Fri, 23 Sep 2016 15:10:56 +0000 (15:10 +0000)
committerEric Liu <ioeric@google.com>
Fri, 23 Sep 2016 15:10:56 +0000 (15:10 +0000)
commitc0d3a801238b1057e2f64218685b0e10607f6296
tree01ef38322aa2e14df44b0b7b43e76f55f7eec40c
parent465c18973d89f3e1b051e49918efa3a49b048443
[clang-format] support header deletion in cleanupAroundReplacemnts.

Summary:
- If a replacement has offset UINT_MAX, length 0, and a replacement text
  that is an #include directive, this will insert the #include into the
  correct block in the \p Code.
- If a replacement has offset UINT_MAX, length 1, and a replacement text
  that is the name of the header to be removed, the header will be removed
  from \p Code if it exists.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 282253
clang/include/clang/Format/Format.h
clang/lib/Format/Format.cpp
clang/unittests/Format/CleanupTest.cpp