diff options
author | Mike Stump <mrs@apple.com> | 2010-01-13 02:59:54 +0000 |
---|---|---|
committer | Mike Stump <mrs@apple.com> | 2010-01-13 02:59:54 +0000 |
commit | fa6ef180c0d3609124217387618fbb51bbdd2e48 (patch) | |
tree | 17e8dd3227c9b5603d3abc9b15d61bf6b7822103 /lib/Sema/Sema.h | |
parent | 0397af277e3bba16da1fd125ddba07415686b429 (diff) |
Add an unreachable code checker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93287 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.h')
-rw-r--r-- | lib/Sema/Sema.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index bc139c19a8..38657638b7 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -42,6 +42,7 @@ namespace llvm { } namespace clang { + class AnalysisContext; class ASTContext; class ASTConsumer; class CodeCompleteConsumer; @@ -1097,6 +1098,9 @@ public: OwningExprResult BuildOverloadedArrowExpr(Scope *S, ExprArg Base, SourceLocation OpLoc); + /// CheckUnreachable - Check for unreachable code. + void CheckUnreachable(AnalysisContext &); + /// CheckCallReturnType - Checks that a call expression's return type is /// complete. Returns true on failure. The location passed in is the location /// that best represents the call. @@ -1104,14 +1108,14 @@ public: CallExpr *CE, FunctionDecl *FD); /// Helpers for dealing with blocks and functions. - void CheckFallThroughForFunctionDef(Decl *D, Stmt *Body); - void CheckFallThroughForBlock(QualType BlockTy, Stmt *Body); + void CheckFallThroughForFunctionDef(Decl *D, Stmt *Body, AnalysisContext &); + void CheckFallThroughForBlock(QualType BlockTy, Stmt *, AnalysisContext &); bool CheckParmsForFunctionDef(FunctionDecl *FD); void CheckCXXDefaultArguments(FunctionDecl *FD); void CheckExtraCXXDefaultArguments(Declarator &D); enum ControlFlowKind { NeverFallThrough = 0, MaybeFallThrough = 1, AlwaysFallThrough = 2, NeverFallThroughOrReturn = 3 }; - ControlFlowKind CheckFallThrough(Stmt *); + ControlFlowKind CheckFallThrough(AnalysisContext &); Scope *getNonFieldDeclScope(Scope *S); |