[PATCH] D27338: [globalisel] Tablegen-erate current Register Bank Information

Diana Picus via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 08:22:09 PST 2016


rovka added a comment.

Thanks, I like the names a lot better now.



================
Comment at: utils/TableGen/RegisterBankEmitter.cpp:233
+    StringRef Enumeration, StringRef EnumeratorPrefix) {
+  OS << "    assert(";
+  for (RegisterBank::PartialMappingsTy::const_iterator I = Begin;
----------------
dsanders wrote:
> rovka wrote:
> > I think it would be cleaner to generate a comment instead of a moot assertion if Begin == End or Begin + 1 == End (and then you can also remove the I != End check in the loop).
> The caller filters out the Begin == End case on line 303 (since Bank.hasPartialMappings() is a test for Begin != End). I think it's good to explicitly assert that here which leads to the same simplification you suggest.
> 
> Is that ok?
Right, good point :)


https://reviews.llvm.org/D27338





More information about the llvm-commits mailing list