diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-01-28 01:18:22 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-01-28 01:18:22 +0000 |
commit | ce7024e8a3793b05861a4904ecdb1272924ada14 (patch) | |
tree | 6cf3aa7c9229376dee5443468906eb86a720b1c0 /lib/Sema/SemaChecking.cpp | |
parent | 8acc9f6370865e200f1bf63dee5c48d8c28e2b06 (diff) |
Add placeholder function in Sema for new format string checking logic.
This function will use the format string parsing logic in libAnalysis,
and once it is shown to be better than the current implementation it
will replace AlternateCheckPrintfString() entirely.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94721 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 9305ff7562..2a5136ee9d 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -1036,6 +1036,14 @@ void Sema::CheckPrintfString(const StringLiteral *FExpr, const Expr *OrigFormatExpr, const CallExpr *TheCall, bool HasVAListArg, unsigned format_idx, unsigned firstDataArg) { + + static bool UseAlternatePrintfChecking = false; + if (UseAlternatePrintfChecking) { + AlternateCheckPrintfString(FExpr, OrigFormatExpr, TheCall, + HasVAListArg, format_idx, firstDataArg); + return; + } + const ObjCStringLiteral *ObjCFExpr = dyn_cast<ObjCStringLiteral>(OrigFormatExpr); @@ -1059,7 +1067,7 @@ void Sema::CheckPrintfString(const StringLiteral *FExpr, << OrigFormatExpr->getSourceRange(); return; } - + // We process the format string using a binary state machine. The // current state is stored in CurrentState. enum { @@ -1271,6 +1279,15 @@ void Sema::CheckPrintfString(const StringLiteral *FExpr, } } +void +Sema::AlternateCheckPrintfString(const StringLiteral *FExpr, + const Expr *OrigFormatExpr, + const CallExpr *TheCall, bool HasVAListArg, + unsigned format_idx, unsigned firstDataArg) { + + +} + //===--- CHECK: Return Address of Stack Variable --------------------------===// static DeclRefExpr* EvalVal(Expr *E); |