ahatanak added inline comments.

================
Comment at: lib/CodeGen/CGCall.cpp:2096
+    if (FI.getExtParameterInfo(ArgNo).isNoEscape())
+      Attrs.addAttribute(llvm::Attribute::NoCapture);
+
----------------
rjmccall wrote:
> ahatanak wrote:
> > rjmccall wrote:
> > > You should make sure that building a CGFunctionInfo with an 
> > > ObjCMethodDecl* collects this from the parameters.  (And add tests!)
> > > 
> > > For blocks, at least, the ObjC method case is arguably more important 
> > > than the C function case.
> > Should we issue a warning when a parameter of an ObjC method is annotated 
> > with noescape and the corresponding parameter of the overriding method in a 
> > derived class isn't? Also, should we warn about inconsistent C++ virtual 
> > functions too?
> Mmm.  Probably yes in both cases, although we could alternatively just 
> silently propagate the attribute InheritableParamAttr-style.
In the new patch, I chose to print diagnostics when the overriding method is 
missing noescape on its parameters lest users unintentionally let pointers 
escape.  


https://reviews.llvm.org/D32210



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

Reply via email to