[PATCH] D30345: [CodeGen][Blocks] Refactor capture handling in code that generates block copy/destroy routines

Vedant Kumar via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 24 14:15:56 PST 2017


vsk added a comment.

Looks NFC to me.



================
Comment at: lib/CodeGen/CGBlocks.cpp:1414
+
+} // end anonymous namespace
+
----------------
I don't see the need for two GenericInfo types (although it's plausible it'll make sense with your upcoming changes!). I had in mind a single 'enum BlockCaptureOperationType' with 8 entries, and a 'struct BlockCaptureOperation'.


================
Comment at: lib/CodeGen/CGBlocks.cpp:1478
+  }
+}
+
----------------
Ditto (re: removing continue statements where possible).


================
Comment at: lib/CodeGen/CGBlocks.cpp:1666
+  }
+}
+
----------------
It looks like there are 4 paths which prep some part of a DestroyInfo and then fall through to the emplace_back. I think this logic would be easier to follow if the emplace_backs occurred right after the DestroyInfo is prepped (i.e, have 4 emplace_backs, and none at the end of the for loop). That should let you get rid of 3 continue statements (imo those were hard to follow).


Repository:
  rL LLVM

https://reviews.llvm.org/D30345





More information about the cfe-commits mailing list