[PATCH] D21453: Add support for attribute "overallocated"

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 20 07:24:28 PDT 2016


aaron.ballman added inline comments.

================
Comment at: include/clang/Basic/Attr.td:2279
@@ +2278,3 @@
+  let Spellings = [GNU<"overallocated">, CXX11<"clang", "overallocated">];
+  let Subjects = SubjectList<[Record], ErrorDiag, "ExpectedStructOrUnion">;
+  let Documentation = [OverAllocatedDocs];
----------------
Can drop the "Expected" string literal. A record type should automatically do the right thing.

================
Comment at: lib/Sema/SemaDeclAttr.cpp:4932
@@ -4931,1 +4931,3 @@
 
+static void handleOverAllocatedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
+  D->addAttr(::new (S.Context)
----------------
This isn't required.

================
Comment at: lib/Sema/SemaDeclAttr.cpp:5404
@@ +5403,3 @@
+  case AttributeList::AT_OverAllocated:
+    handleOverAllocatedAttr(S, D, Attr);
+    break;
----------------
Can just call `handleSimpleAttribute()` instead.


http://reviews.llvm.org/D21453





More information about the cfe-commits mailing list