[PATCH] D40009: [Lint] Don't warn about passing alloca'd value to tail call if using byval

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 09:26:15 PST 2017


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

lgtm with suggestion



================
Comment at: lib/Analysis/Lint.cpp:293-294
+      unsigned ArgNo = 0;
+      for (CallSite::arg_iterator AI = CS.arg_begin(), AE = CS.arg_end();
+           AI != AE; ++AI) {
+        // Skip ByVal arguments since they will be memcpy'd to the callee's
----------------
You should be able to update this to range-based for like:
  for (const Value *Arg : CS.args()) {
    ...


https://reviews.llvm.org/D40009





More information about the llvm-commits mailing list