[PATCH] D29599: Clang Changes for alloc_align

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 29 18:11:07 PDT 2017


rjmccall added inline comments.


================
Comment at: include/clang/Basic/AttrDocs.td:252
+declaration to specify that the return value of the function (which must be a
+pointer type) is at least as aligned as the value indicated parameter. The 
+parameter is given by its index in the list of formal parameters; the first
----------------
"value *of the* indicated parameter"


================
Comment at: include/clang/Basic/AttrDocs.td:254
+parameter is given by its index in the list of formal parameters; the first
+parameter hs index 1 unless the function is a C++ non-static member function,
+in which case the first parameter has index 2 to account for the implicit ``this``
----------------
"has"


================
Comment at: lib/CodeGen/CGCall.cpp:4363
+    } else if (AllocAlignParam && TargetDecl->hasAttr<AllocAlignAttr>())
+      EmitAlignmentAssumption(Ret.getScalarVal(), AllocAlignParam);
   }
----------------
Your old code was fine, you just needed to get the value with CallArgs[index].second.getScalarVal() instead of IRCallArgs[index].


https://reviews.llvm.org/D29599





More information about the cfe-commits mailing list