diff options
author | Jean-Daniel Dupas <devlists@shadowlab.org> | 2012-01-17 20:03:31 +0000 |
---|---|---|
committer | Jean-Daniel Dupas <devlists@shadowlab.org> | 2012-01-17 20:03:31 +0000 |
commit | 29c3f814b64808c6dac4597b61a50ceecdf141fc (patch) | |
tree | f4f081711e9f99af5d828f3e780e0ef85f357e6c /include/clang/Sema/Sema.h | |
parent | 56ca8a9c0fabd65418e9b2fd85140f4ed7d3c187 (diff) |
Fix a couples of issues in format strings checking.
PR 10274: format function attribute with the NSString archetype yields no compiler warnings
PR 10275: format function attribute isn't checked in Objective-C methods
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148324 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Sema/Sema.h')
-rw-r--r-- | include/clang/Sema/Sema.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index 8b0075fc77..634a1aacc0 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -6281,9 +6281,12 @@ private: bool AllowOnePastEnd=true, bool IndexNegated=false); void CheckArrayAccess(const Expr *E); bool CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall); + bool CheckObjCMethodCall(ObjCMethodDecl *Method, SourceLocation loc, + Expr **Args, unsigned NumArgs); bool CheckBlockCall(NamedDecl *NDecl, CallExpr *TheCall); - bool CheckablePrintfAttr(const FormatAttr *Format, CallExpr *TheCall); + bool CheckablePrintfAttr(const FormatAttr *Format, Expr **Args, + unsigned NumArgs, bool IsCXXMemberCall); bool CheckObjCString(Expr *Arg); ExprResult CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall); @@ -6307,13 +6310,13 @@ private: bool SemaBuiltinConstantArg(CallExpr *TheCall, int ArgNum, llvm::APSInt &Result); - bool SemaCheckStringLiteral(const Expr *E, const CallExpr *TheCall, + bool SemaCheckStringLiteral(const Expr *E, Expr **Args, unsigned NumArgs, bool HasVAListArg, unsigned format_idx, unsigned firstDataArg, bool isPrintf, bool inFunctionCall = true); void CheckFormatString(const StringLiteral *FExpr, const Expr *OrigFormatExpr, - const CallExpr *TheCall, bool HasVAListArg, + Expr **Args, unsigned NumArgs, bool HasVAListArg, unsigned format_idx, unsigned firstDataArg, bool isPrintf, bool inFunctionCall); @@ -6321,9 +6324,14 @@ private: const Expr * const *ExprArgs, SourceLocation CallSiteLoc); - void CheckPrintfScanfArguments(const CallExpr *TheCall, bool HasVAListArg, - unsigned format_idx, unsigned firstDataArg, - bool isPrintf); + void CheckFormatArguments(const FormatAttr *Format, CallExpr *TheCall); + void CheckFormatArguments(const FormatAttr *Format, Expr **Args, + unsigned NumArgs, bool IsCXXMember, + SourceLocation Loc, SourceRange Range); + void CheckPrintfScanfArguments(Expr **Args, unsigned NumArgs, + bool HasVAListArg, unsigned format_idx, + unsigned firstDataArg, bool isPrintf, + SourceLocation Loc, SourceRange range); void CheckMemaccessArguments(const CallExpr *Call, unsigned BId, |