This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1995d4424505: [clang-format] Enable FormatTokenSource to
insert tokens. (authored by klimek).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE L
klimek added inline comments.
Comment at: clang/lib/Format/UnwrappedLineParser.h:287
// owned outside of and handed into the UnwrappedLineParser.
+ // FIXME: The above fixme doesn't work if we need to create tokens while
+ // parsing.
sammccall wrote:
> I'm
klimek updated this revision to Diff 497637.
klimek marked an inline comment as done.
klimek added a comment.
Address review comments.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143070/new/
https://reviews.llvm.org/D143070
Files:
clang/lib/Fo
sammccall accepted this revision.
sammccall added inline comments.
This revision is now accepted and ready to land.
Comment at: clang/lib/Format/FormatTokenSource.h:74
public:
- IndexedTokenSource(ArrayRef Tokens)
+ IndexedTokenSource(SmallVectorImpl &Tokens)
: Tokens(T
klimek updated this revision to Diff 497416.
klimek added a comment.
Undo changes to ownership of initial set of FormatTokens.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143070/new/
https://reviews.llvm.org/D143070
Files:
clang/lib/Format/For
klimek added inline comments.
Comment at: clang/lib/Format/FormatTokenSource.h:74
public:
- IndexedTokenSource(ArrayRef Tokens)
+ IndexedTokenSource(SmallVectorImpl &Tokens)
: Tokens(Tokens), Position(-1) {}
sammccall wrote:
> As I understand it, this p
klimek updated this revision to Diff 497415.
klimek marked 3 inline comments as done.
klimek added a comment.
Address reviewer comments.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143070/new/
https://reviews.llvm.org/D143070
Files:
clang/lib/
sammccall added a comment.
Only serious concern is `getPreviousToken()`.
Comment at: clang/lib/Format/FormatTokenSource.h:74
public:
- IndexedTokenSource(ArrayRef Tokens)
+ IndexedTokenSource(SmallVectorImpl &Tokens)
: Tokens(Tokens), Position(-1) {}
klimek created this revision.
klimek added a reviewer: sammccall.
Herald added a project: All.
klimek requested review of this revision.
Herald added a project: clang.
In preparation for configured macro replacements in formatting,
add the ability to insert tokens to FormatTokenSource, and impleme