This revision was automatically updated to reflect the committed changes.
Closed by commit rL290149: Add the alloc_size attribute to clang. (authored by
gbiv).
Changed prior to commit:
https://reviews.llvm.org/D14274?vs=77222&id=82046#toc
Repository:
rL LLVM
https://reviews.llvm.org/D14274
george.burgess.iv marked an inline comment as done.
george.burgess.iv added a comment.
Thanks, everyone! :)
Repository:
rL LLVM
https://reviews.llvm.org/D14274
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/
aaron.ballman added a comment.
I still think that this looks good, so if @rsmith doesn't comment over the
weekend, you can go ahead and commit on Monday -- we can handle any feedback in
post-commit review.
Comment at: include/clang/Basic/AttrDocs.td:240
+ Specifically, clang
george.burgess.iv added a comment.
Ping :)
https://reviews.llvm.org/D14274
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
george.burgess.iv added a comment.
Ping
https://reviews.llvm.org/D14274
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
george.burgess.iv updated this revision to Diff 77222.
george.burgess.iv added a comment.
Rebased and made the `__builtin_object_size` code a tiny bit cleaner.
The blocks bugfix I mentioned will be up as a separate review in a few minutes.
:)
https://reviews.llvm.org/D14274
Files:
include/c
george.burgess.iv added a comment.
With any luck, this'll be on the top of my to-do list next week. :)
https://reviews.llvm.org/D14274
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
hfinkel added a comment.
What's the status of this?
https://reviews.llvm.org/D14274
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
george.burgess.iv added inline comments.
Comment at: test/CodeGenCXX/alloc-size.cpp:66
@@ +65,3 @@
+ // CHECK: ret i32 122
+ return __builtin_object_size(my_malloc(), 0) +
+ __builtin_object_size(my_calloc(5), 0) +
ahatanak wrote:
> george.burgess.iv wro
ahatanak added inline comments.
Comment at: test/CodeGenCXX/alloc-size.cpp:66
@@ +65,3 @@
+ // CHECK: ret i32 122
+ return __builtin_object_size(my_malloc(), 0) +
+ __builtin_object_size(my_calloc(5), 0) +
george.burgess.iv wrote:
> ahatanak wrote:
> > I
george.burgess.iv added a comment.
> I'm wondering what the status of this patch is since someone has asked us to
> add support for this attribute in clang. Are you still waiting for review?
Waiting for an LGTM from Richard, though this patch currently doesn't pass all
tests. One of the change
ahatanak added a subscriber: ahatanak.
ahatanak added a comment.
I'm wondering what the status of this patch is since someone has asked us to
add support for this attribute in clang. Are you still waiting for review?
Comment at: test/CodeGenCXX/alloc-size.cpp:66
@@ +65,3 @@
+
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
Thank you for working on this! LGTM, but please wait for @rsmith to okay as
well.
Comment at: test/SemaCXX/constant-expression-cxx11.cpp:1171
@@ -1170,3 +1170,3
george.burgess.iv added inline comments.
Comment at: include/clang/Basic/Attr.td:753
@@ +752,3 @@
+ let Args = [IntArgument<"ElemSizeParam">, IntArgument<"NumElemsParam", 1>];
+ let TemplateDependent = 1;
+ let Documentation = [AllocSizeDocs];
aaron.ballman wro
george.burgess.iv updated this revision to Diff 55478.
george.burgess.iv marked 2 inline comments as done.
george.burgess.iv added a comment.
Addressed all feedback
http://reviews.llvm.org/D14274
Files:
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/Diagno
aaron.ballman added inline comments.
Comment at: include/clang/Basic/Attr.td:753
@@ +752,3 @@
+ let Args = [IntArgument<"ElemSizeParam">, IntArgument<"NumElemsParam", 1>];
+ let TemplateDependent = 1;
+ let Documentation = [AllocSizeDocs];
I don't see any C++ t
george.burgess.iv updated this revision to Diff 53611.
george.burgess.iv added a comment.
Now that `allocsize` is in LLVM (r266032), this isn't blocked. Yay!
Rebased, added a few tests, did a few tiny refactors, and fixed an overflow bug
when the user tried to allocate `2**63 < N < 2**64` bytes
george.burgess.iv updated this revision to Diff 46693.
george.burgess.iv marked 2 inline comments as done.
george.burgess.iv added a comment.
Addressed all feedback.
http://reviews.llvm.org/D14274
Files:
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/Diagn
george.burgess.iv added inline comments.
Comment at: lib/Sema/SemaDeclAttr.cpp:737
@@ +736,3 @@
+unsigned FuncParamNo, unsigned AttrArgNo) {
+ assert(Attr.getArg(AttrArgNo).is());
+ // FuncParamNo is base-1
aaron.ballman wrote
aaron.ballman added a comment.
The attribute part looks mostly good (a few small nits), but the rest should be
reviewed by @rsmith.
Comment at: lib/Sema/SemaDeclAttr.cpp:737
@@ +736,3 @@
+unsigned FuncParamNo, unsigned AttrArgNo) {
+ assert(
george.burgess.iv updated this revision to Diff 45622.
george.burgess.iv added a comment.
- Rebased
- Removed bits that were already upstreamed as part of
http://reviews.llvm.org/D14877
- Added support for LLVM's `allocsize` attribute (under review at
http://reviews.llvm.org/D14933 )
http://re
aaron.ballman added inline comments.
Comment at: lib/AST/ExprConstant.cpp:1110
@@ -1022,1 +1109,3 @@
void set(APValue::LValueBase B, unsigned I = 0, bool BInvalid = false) {
+#ifndef NDEBUG
+ // We only allow a few types of invalid bases. Enforce that here.
-
george.burgess.iv updated this revision to Diff 42547.
george.burgess.iv marked an inline comment as done.
george.burgess.iv added a comment.
- Fixed wording in AttrDocs
- Realized I forgot to press 'submit' on comment responses after the last
update. Will correct this in ~5 seconds :)
http://r
george.burgess.iv added inline comments.
Comment at: include/clang/Basic/Attr.td:714
@@ +713,3 @@
+ let Spellings = [GCC<"alloc_size">];
+ let Subjects = SubjectList<[Function]>;
+ let Args = [IntArgument<"ElemSizeParam">, IntArgument<"NumElemsParam", 1>];
aaro
majnemer added a subscriber: majnemer.
Comment at: include/clang/Basic/AttrDocs.td:214
@@ +213,3 @@
+ that we can lower to in the near future. This should cover a large number of
+ nonconst cases.
+ }];
nonconst -> non-const?
http://reviews.llvm.org/D14274
george.burgess.iv updated this revision to Diff 42474.
george.burgess.iv marked 15 inline comments as done.
george.burgess.iv added a comment.
Addressed all feedback
http://reviews.llvm.org/D14274
Files:
include/clang/Basic/Attr.td
include/clang/Basic/AttrDocs.td
include/clang/Basic/Diagn
aaron.ballman added inline comments.
Comment at: include/clang/Basic/Attr.td:714
@@ +713,3 @@
+ let Spellings = [GCC<"alloc_size">];
+ let Subjects = SubjectList<[Function]>;
+ let Args = [IntArgument<"ElemSizeParam">, IntArgument<"NumElemsParam", 1>];
Should t
george.burgess.iv added a comment.
Also, due to allowing the evaluation of const expressions as constexpr
expressions, this patch needs http://reviews.llvm.org/D14877 to go in so we
don't break tests. :)
http://reviews.llvm.org/D14274
___
cfe-comm
george.burgess.iv updated the summary for this revision.
george.burgess.iv updated this revision to Diff 42348.
george.burgess.iv added a comment.
As discussed offline:
- Added support for treating `const` variables as `constexpr`
- Added requirement for `LValue`s with an invalid `alloc_size` bas
george.burgess.iv created this revision.
george.burgess.iv added a reviewer: rsmith.
george.burgess.iv added a subscriber: cfe-commits.
This is the first in a two patch series aimed at adding the alloc_size
attribute to clang. This patch adds the alloc_size attribute, docs, and all of
the logic
30 matches
Mail list logo