[PATCH] D65764: Add TinyPtrVector support for general pointer-like things.

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 19 09:21:24 PDT 2019


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

LGTM, with a minor suggestion inline.



================
Comment at: llvm/include/llvm/ADT/TinyPtrVector.h:347-348
       Val = new VecTy();
-    } else if (EltTy V = Val.template dyn_cast<EltTy>()) {
-      Val = new VecTy();
-      Val.template get<VecTy*>()->push_back(V);
+    } else {
+      if (Val.template is<EltTy>()) {
+        EltTy V = Val.template get<EltTy>();
----------------
I think this can still be `else if`; no need for the extra nesting.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D65764





More information about the llvm-commits mailing list