[PATCH] D56571: [RFC prototype] Implementation of asm-goto support in LLVM

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 11 13:09:15 PST 2019


nickdesaulniers added inline comments.


================
Comment at: lib/Parse/ParseStmtAsm.cpp:830-858
+  if (AteExtraColon || Tok.is(tok::colon)) {
+    if (AteExtraColon)
+      AteExtraColon = false;
+    else
+      ConsumeToken();
+
+    if (!AteExtraColon && Tok.isNot(tok::identifier)) {
----------------
jyu2 wrote:
> nickdesaulniers wrote:
> > ```
> > if (x || y) {
> >   if (x) foo();
> >   else bar();
> >   if (!x && ...) baz();
> >   if (!x && ...) quux();
> > ```
> > is maybe more readable as:
> > ```
> > if (x) foo();
> > else if (y)
> >   bar();
> >   baz();
> >   quux();
> > ```
> This is better?
IIUC, it looks like `ConsumeToken()` modifies `Tok`, so the 2 `isNot` cases should fail as expected when `!AteExtraColon`, so this change LGTM.


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

https://reviews.llvm.org/D56571





More information about the cfe-commits mailing list