[PATCH] [LoopAccesses] Create the analysis pass
Adam Nemet
anemet at apple.com
Mon Feb 16 16:59:18 PST 2015
================
Comment at: include/llvm/Analysis/LoopAccessAnalysis.h:227
@@ +226,3 @@
+ /// the analysis.
+ LoopAccessInfo *getInfo(Loop *L, ValueToValueMap &Strides);
+
----------------
hfinkel wrote:
> anemet wrote:
> > hfinkel wrote:
> > > Returning a pointer seems odd here, who owns it? Should it be const?
> > It's owned by the pass using a unique_ptr. There is no transfer of ownership in getInfo. It simply gives out a pointer with unique_ptr::get(). I can extend the comment to explain the ownership situation.
> >
> > Regarding const, absolutely but right now these interfaces don't use const so the pointer returned won't have access to most things. Would it be OK to fix this in a follow-up patch?
> Why not return a reference?
>
> Fixing const in follow-up is okay.
>
Makes sense. I am still bit confused when to use pointers vs. reference in LLVM...
Thanks.
http://reviews.llvm.org/D7684
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list