aaron.ballman added inline comments. ================ Comment at: lib/Sema/SemaDeclAttr.cpp:829 @@ +828,3 @@ + if (Type > 3) { + S.Diag(E->getLocStart(), diag::err_attribute_argument_outof_range) + << Attr.getName() << 0 << 3 << E->getSourceRange(); ---------------- >> I'm wondering why the magic value 3 at all? It seems like this (and the >> above code) should be replaced by a call to >> checkFunctionOrMethodParameterIndex(). > Marking this as done because checkFunctionOrMethodParameterIndex doesn't seem > to accomplish our goal. > >> There should be comments explaining the magic number 3. > The docs for pass_object_size(N) state that N is passed as the second > parameter to __builtin_object_size, which means that N must be in the range > [0, 3]. I'll add a comment, but given your other comment, it looks like there > may have been a miscommunication about the purpose of pass_object_size's > argument. :)
Ah, yes, I was confused. This isn't checking that the number matches a parameter index. :-) http://reviews.llvm.org/D13263 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits