[PATCH] [LoopAccesses] Create the analysis pass

hfinkel at anl.gov hfinkel at anl.gov
Mon Feb 16 16:53:42 PST 2015


================
Comment at: include/llvm/Analysis/LoopAccessAnalysis.h:227
@@ +226,3 @@
+  /// the analysis.
+  LoopAccessInfo *getInfo(Loop *L, ValueToValueMap &Strides);
+
----------------
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.

http://reviews.llvm.org/D7684

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list