rnk added a comment.

I can't say I'm familiar with ARC, but this seems right to me.


================
Comment at: llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp:767
+    const ColorVector &CV = BlockColors.find(BB)->second;
+    assert(CV.size() == 1 && "non-unique color for block!");
+    BasicBlock *EHPadBB = CV.front();
----------------
I don't think the verifier changes you made guarantee this. I would consider 
strengthening this to `report_fatal_error`, since valid IR transforms can 
probably reach this code.


================
Comment at: llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp:2040-2041
+  DenseMap<BasicBlock *, ColorVector> BlockColors;
+  if (F.hasPersonalityFn() &&
+      isScopedEHPersonality(classifyEHPersonality(F.getPersonalityFn())))
+    BlockColors = colorEHFunclets(F);
----------------
I think this code snippet probably deserves a Function helper, 
`F->hasScopedEHPersonality()`. Another part of me thinks we should cache the 
personality enum similar to the way we cache intrinsic ids, but I wouldn't want 
to increase Function memory usage, so that seems premature. "No action 
required", I guess.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137944

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to