[PATCH] D29599: Clang Changes for alloc_align

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 15 14:09:56 PST 2017


erichkeane updated this revision to Diff 88602.
erichkeane added a comment.

I was able to get the templated versions working in response to the discussion with Akira.  Note the added test file which shows off all of the combos I could think of.

It required a little bit of surgery inside the SemaDeclAttr.cpp, since the SemaTemplateInstatiateDecl.cpp no longer has "AttributeList" info anymore, so getting the error messages in the existing functions required a little template-writing of my own!

I decided to explicitly forbid the following case, because I cannot see a valid usecase for this, or for making 'Which' below a dependent value.

  template<int Which>
  void* foo(int a, int b, int c, int d) __attribute__((alloc_align(Which)));


https://reviews.llvm.org/D29599

Files:
  include/clang/Basic/Attr.td
  include/clang/Basic/AttrDocs.td
  include/clang/Sema/Sema.h
  lib/CodeGen/CGCall.cpp
  lib/CodeGen/CodeGenFunction.h
  lib/Sema/SemaDeclAttr.cpp
  lib/Sema/SemaTemplateInstantiateDecl.cpp
  test/CodeGen/alloc-align-attr.c
  test/Sema/alloc-align-attr.c
  test/SemaCXX/alloc-align-attr.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29599.88602.patch
Type: text/x-patch
Size: 22609 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170215/8cefac39/attachment-0001.bin>


More information about the cfe-commits mailing list