[PATCH] D80547: [clang-format] Fix an ObjC regression introduced with new [[likely]][[unlikely]] support in if/else clauses

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 26 04:50:08 PDT 2020


MyDeveloperDay marked an inline comment as done.
MyDeveloperDay added inline comments.


================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:2348
+// its not then rewind to the original position
+bool UnwrappedLineParser::tryToParseAttribute() {
+  unsigned StoredPosition = Tokens->getPosition();
----------------
MyDeveloperDay wrote:
> This so makes me feel like we need a peekNextToken()
which is like all the time I have to write

```
Tok->Next && Tok->Next->is(tok::XXX)
Tok->Previous && Tok->Previous ->is(tok::XXX)
```

would be so much smaller code if we had

```
Tok->isNext(tok::XXX)
Tok->isPrevious(tok::XXX)
```


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80547/new/

https://reviews.llvm.org/D80547





More information about the cfe-commits mailing list