[PATCH] D94822: [TableGen] Improve algorithm for inheriting class template arguments and fields

Chris Lattner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 19 09:23:49 PST 2021


lattner accepted this revision.
lattner added a comment.
This revision is now accepted and ready to land.

This looks fine to me in a quick review, but you're the best technical expert here Paul.



================
Comment at: llvm/include/llvm/TableGen/Record.h:2003
+    return It->second.V->isComplete();
+//// return Map[Key].V->isComplete(); }
+  }
----------------
plz remove commented out code.


================
Comment at: llvm/lib/TableGen/TGParser.cpp:2628
+  } else {
+    assert(false && "invalid context for template argument");
   }
----------------
dblaikie wrote:
> craig.topper wrote:
> > llvm_unreachable
> Or possibly drop the prior "if" and change it to an assert there.
> 
> ie change this:
> ```
> ...
> else if (x) {
>   ...
> } else
>   llvm_unreachable(...);
> ```
> 
> to this:
> ```
> else {
>   assert(x);
>   ...
> }
> ```
Yeah I'd recommend dblaikie's pattern so you can use assert.


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

https://reviews.llvm.org/D94822



More information about the llvm-commits mailing list