[PATCH] D55212: Handle alloc_size attribute on function pointers

2021-04-09 Thread Alexander Richardson via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGdc4abca7662b: Handle alloc_size attribute on function pointers (authored by arichardson). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D55212?vs=177519=336519#toc

[PATCH] D55212: Handle alloc_size attribute on function pointers

2021-03-22 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. In D55212#2641402 , @erik.pilkington wrote: > In D55212#2641301 , @aaron.ballman > wrote: > >> I think folks will have a chance to react if we

[PATCH] D55212: Handle alloc_size attribute on function pointers

2021-03-22 Thread Erik Pilkington via Phabricator via cfe-commits
erik.pilkington accepted this revision. erik.pilkington added a comment. In D55212#2641301 , @aaron.ballman wrote: > I think folks will have a chance to react if we apply it to trunk now, but I > am wondering if anyone's had a chance to investigate

[PATCH] D55212: Handle alloc_size attribute on function pointers

2021-03-22 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D55212#2640260 , @arichardson wrote: > I completely forgot about this patch. @aaron.ballman are you still happy for > me to commit this? I think where we left off is that this causes a slight regression in behavior

[PATCH] D55212: Handle alloc_size attribute on function pointers

2021-03-21 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson added a comment. Herald added a subscriber: jdoerfert. I completely forgot about this patch. @aaron.ballman are you still happy for me to commit this? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55212/new/ https://reviews.llvm.org/D55212

[PATCH] D55212: Handle alloc_size attribute on function pointers

2019-01-07 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added reviewers: erik.pilkington, dexonsmith. aaron.ballman added a comment. In D55212#1347994 , @arichardson wrote: > I don't see an easy way of fixing the pragma clang attribute support for > this. > Would it be okay to commit this

[PATCH] D55212: Handle alloc_size attribute on function pointers

2019-01-07 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson added a comment. I don't see an easy way of fixing the pragma clang attribute support for this. Would it be okay to commit this change anyway? Since `alloc_size` is only used for very few functions I'd be very surprised if there's any existing code that relies on using `#pragma

[PATCH] D55212: Handle alloc_size attribute on function pointers

2018-12-10 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson marked an inline comment as done. arichardson added inline comments. Comment at: test/Misc/pragma-attribute-supported-attributes-list.test:15 +// FIXME: After changing the subject from Function to HasFunctionProto, AllocSize is no longer listed (similar to Format,

[PATCH] D55212: Handle alloc_size attribute on function pointers

2018-12-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: test/Misc/pragma-attribute-supported-attributes-list.test:15 +// FIXME: After changing the subject from Function to HasFunctionProto, AllocSize is no longer listed (similar to Format, etc) +// FIXME-NEXT: AllocSize

[PATCH] D55212: Handle alloc_size attribute on function pointers

2018-12-10 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson marked 5 inline comments as done. arichardson added inline comments. Comment at: test/Misc/pragma-attribute-supported-attributes-list.test:15 +// FIXME: After changing the subject from Function to HasFunctionProto, AllocSize is no longer listed (similar to Format,

[PATCH] D55212: Handle alloc_size attribute on function pointers

2018-12-10 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson updated this revision to Diff 177519. arichardson marked 3 inline comments as done. arichardson added a comment. fix typo Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55212/new/ https://reviews.llvm.org/D55212 Files: include/clang/Basic/Attr.td

[PATCH] D55212: Handle alloc_size attribute on function pointers

2018-12-10 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson updated this revision to Diff 177517. arichardson added a comment. clang-format fix a failing test Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55212/new/ https://reviews.llvm.org/D55212 Files: include/clang/Basic/Attr.td

[PATCH] D55212: Handle alloc_size attribute on function pointers

2018-12-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM aside from two small style nits with the new test file. Comment at: test/SemaCXX/alloc-size.cpp:6 + int alloc(int) __attribute__((alloc_size(2))); //

[PATCH] D55212: Handle alloc_size attribute on function pointers

2018-12-06 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson updated this revision to Diff 177027. arichardson added a comment. Add a C++ test for alloc_size Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55212/new/ https://reviews.llvm.org/D55212 Files: include/clang/Basic/Attr.td lib/AST/ExprConstant.cpp

[PATCH] D55212: Handle alloc_size attribute on function pointers

2018-12-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. I think all that's missing are some C++ tests and some nits. Comment at: include/clang/Basic/Attr.td:1072 def AllocSize : InheritableAttr { let Spellings = [GCC<"alloc_size">]; + let Subjects = SubjectList<[HasFunctionProto]>;

[PATCH] D55212: Handle alloc_size attribute on function pointers

2018-12-06 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson marked an inline comment as done. arichardson added inline comments. Comment at: include/clang/Basic/Attr.td:1072 def AllocSize : InheritableAttr { let Spellings = [GCC<"alloc_size">]; + let Subjects = SubjectList<[HasFunctionProto]>;

[PATCH] D55212: Handle alloc_size attribute on function pointers

2018-12-03 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: include/clang/Basic/Attr.td:1072 def AllocSize : InheritableAttr { let Spellings = [GCC<"alloc_size">]; + let Subjects = SubjectList<[HasFunctionProto]>; arichardson wrote: > aaron.ballman wrote: > >

[PATCH] D55212: Handle alloc_size attribute on function pointers

2018-12-03 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson marked an inline comment as done. arichardson added a comment. Thanks for the review! I'll write a C++ test tomorrow. Comment at: include/clang/Basic/Attr.td:1072 def AllocSize : InheritableAttr { let Spellings = [GCC<"alloc_size">]; + let Subjects =

[PATCH] D55212: Handle alloc_size attribute on function pointers

2018-12-03 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: include/clang/Basic/Attr.td:1072 def AllocSize : InheritableAttr { let Spellings = [GCC<"alloc_size">]; + let Subjects = SubjectList<[HasFunctionProto]>; arichardson wrote: > aaron.ballman wrote: > > Does GCC

[PATCH] D55212: Handle alloc_size attribute on function pointers

2018-12-03 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson updated this revision to Diff 176413. arichardson added a comment. - address review comments - add test that we can assign between function pointers with and without alloc_size attribute. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55212/new/

[PATCH] D55212: Handle alloc_size attribute on function pointers

2018-12-03 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson marked 5 inline comments as done. arichardson added inline comments. Comment at: include/clang/Basic/Attr.td:1072 def AllocSize : InheritableAttr { let Spellings = [GCC<"alloc_size">]; + let Subjects = SubjectList<[HasFunctionProto]>;

[PATCH] D55212: Handle alloc_size attribute on function pointers

2018-12-03 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: include/clang/Basic/Attr.td:1072 def AllocSize : InheritableAttr { let Spellings = [GCC<"alloc_size">]; + let Subjects = SubjectList<[HasFunctionProto]>; Does GCC support writing `alloc_size` on function

[PATCH] D55212: Handle alloc_size attribute on function pointers

2018-12-03 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson updated this revision to Diff 176368. arichardson added a comment. Remove RUN: line added for debugging Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55212/new/ https://reviews.llvm.org/D55212 Files: include/clang/Basic/Attr.td

[PATCH] D55212: Handle alloc_size attribute on function pointers

2018-12-03 Thread Alexander Richardson via Phabricator via cfe-commits
arichardson created this revision. arichardson added reviewers: george.burgess.iv, aaron.ballman, jdenny. Herald added a subscriber: cfe-commits. I have been trying to statically find and analyze all calls to heap allocation functions to determine how many of them use sizes known at compile time