Skip to content
Snippets Groups Projects
Commit 7cd8b602 authored by Krasimir Georgiev's avatar Krasimir Georgiev
Browse files

[clang-format] Move OriginalPrefix from base to subclass.

Summary:
OriginalPrefix is only needed for line comment sections. Moved from the base class to the child class.
No functional changes.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@294457 91177308-0d34-0410-b5e6-96231b3b80d8
parent 1eed05ab
No related branches found
No related tags found
No related merge requests found
...@@ -282,10 +282,6 @@ protected: ...@@ -282,10 +282,6 @@ protected:
// line. // line.
bool FirstInLine; bool FirstInLine;
// In case of line comments, holds the original prefix, including trailing
// whitespace.
SmallVector<StringRef, 16> OriginalPrefix;
// The prefix to use in front a line that has been reflown up. // The prefix to use in front a line that has been reflown up.
// For example, when reflowing the second line after the first here: // For example, when reflowing the second line after the first here:
// // comment 1 // // comment 1
...@@ -394,6 +390,14 @@ private: ...@@ -394,6 +390,14 @@ private:
unsigned getContentStartColumn(unsigned LineIndex, unsigned getContentStartColumn(unsigned LineIndex,
unsigned TailOffset) const override; unsigned TailOffset) const override;
// OriginalPrefix[i] contains the original prefix of line i, including
// trailing whitespace before the start of the content. The indentation
// preceding the prefix is not included.
// For example, if the line is:
// // content
// then the original prefix is "// ".
SmallVector<StringRef, 16> OriginalPrefix;
// Prefix[i] contains the intended leading "//" with trailing spaces to // Prefix[i] contains the intended leading "//" with trailing spaces to
// account for the indentation of content within the comment at line i after // account for the indentation of content within the comment at line i after
// formatting. It can be different than the original prefix when the original // formatting. It can be different than the original prefix when the original
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment