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(Attr.getArg(AttrArgNo).is<Expr *>());
+ // FuncParamNo is base-1
----------------
Can be replaced with assert(Attr.isArgExpr(AttrArgNo) && "expected expression
argument");
================
Comment at: lib/Sema/SemaDeclAttr.cpp:739
@@ +738,3 @@
+ // FuncParamNo is base-1
+ if (FuncParamNo < 1 || FuncParamNo > FD->getNumParams()) {
+ SourceLocation SrcLoc = Attr.getArgAsExpr(AttrArgNo)->getLocStart();
----------------
This whole if should be replaced by a call to
checkFunctionOrMethodParameterIndex(), which will return the correct function
parameter number as an output parameter.
http://reviews.llvm.org/D14274
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits