[PATCH] Convert some signatures of SelectionDAG::getNode() to use ArrayRef instead of Ops/NumOps

Reid Kleckner rnk at google.com
Fri Apr 18 11:39:24 PDT 2014


Cool!  I think you can drop a lot of explicit conversions of C arrays,
since ArrayRef has this ctor:
    template <size_t N>
    /*implicit*/ LLVM_CONSTEXPR ArrayRef(const T (&Arr)[N])
      : Data(Arr), Length(N) {}

Right?  If not, what's breaking?


On Fri, Apr 18, 2014 at 9:01 AM, Craig Topper <craig.topper at gmail.com>wrote:

> Several of the signatures of getNode take an SDValue* and a NumOps
> argument. This results in most callers having to explicitly call .size() or
> hardcoding the size of a statically sized array. This patch converts the
> methods to take an ArrayRef so this will now happen automatically. I
> explicitly created ArrayRefs for the cases where this wouldn't work or
> wasn't obvious to me that it would.
>
> Submitting to the list before I commit since this touches a many files and
> locations within them and I've already had to merge a couple times.
>
> --
> ~Craig
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140418/fadfb6ed/attachment.html>


More information about the llvm-commits mailing list