summaryrefslogtreecommitdiffstats
path: root/lib/Format/WhitespaceManager.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-03-28 15:06:01 +0000
committerDaniel Jasper <djasper@google.com>2014-03-28 15:06:01 +0000
commit2c79e2c95bbe3bce5fbe19b1cc76c7dcea4002f8 (patch)
tree8938030dd4a800f53d5960eb45faa8e3f0bb066f /lib/Format/WhitespaceManager.cpp
parent37a9afe9ebdfc7643e4c15e8a7879bd5dec2aeb8 (diff)
clang-format: Fix aligning of comments and escaped newlines in macros.
Before: #define A \ int i; /*a*/ \ int jjj; /*b*/ After: #define A \ int i; /*a*/ \ int jjj; /*b*/ git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205011 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/WhitespaceManager.cpp')
-rw-r--r--lib/Format/WhitespaceManager.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Format/WhitespaceManager.cpp b/lib/Format/WhitespaceManager.cpp
index 26a8d41e87..4c393ed439 100644
--- a/lib/Format/WhitespaceManager.cpp
+++ b/lib/Format/WhitespaceManager.cpp
@@ -193,6 +193,10 @@ void WhitespaceManager::alignTrailingComments(unsigned Start, unsigned End,
if (Changes[i].IsTrailingComment) {
assert(Column >= Changes[i].StartOfTokenColumn);
Changes[i].Spaces += Column - Changes[i].StartOfTokenColumn;
+ if (i + 1 != End) {
+ Changes[i + 1].PreviousEndOfTokenColumn +=
+ Column - Changes[i].StartOfTokenColumn;
+ }
Changes[i].StartOfTokenColumn = Column;
}
}