summaryrefslogtreecommitdiffstats
path: root/include/clang/Sema/ScopeInfo.h
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-11-19 00:19:15 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-11-19 00:19:15 +0000
commit8fc32d272bd57b0a59f61c874cb7b56d9005e89e (patch)
tree2902573b26b86b4e2c1a534f90bb996580f65d25 /include/clang/Sema/ScopeInfo.h
parent9c4eb1f3438370355f51dc8c62f2ca4803e3338d (diff)
Refactoring. Get FunctionScopeInfo to use DiagnosticErrorTrap.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119764 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Sema/ScopeInfo.h')
-rw-r--r--include/clang/Sema/ScopeInfo.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/include/clang/Sema/ScopeInfo.h b/include/clang/Sema/ScopeInfo.h
index 50cfa9bb56..15d17306c9 100644
--- a/include/clang/Sema/ScopeInfo.h
+++ b/include/clang/Sema/ScopeInfo.h
@@ -48,9 +48,8 @@ public:
/// \brief Whether this function contains any indirect gotos.
bool HasIndirectGoto;
- /// \brief The number of errors that had occurred before starting this
- /// function or block.
- unsigned NumErrorsAtStartOfFunction;
+ /// \brief Used to determine if errors occurred in this function or block.
+ DiagnosticErrorTrap ErrorTrap;
/// LabelMap - This is a mapping from label identifiers to the LabelStmt for
/// it (which acts like the label decl in some ways). Forward referenced
@@ -83,18 +82,18 @@ public:
(HasBranchProtectedScope && HasBranchIntoScope);
}
- FunctionScopeInfo(unsigned NumErrors)
+ FunctionScopeInfo(Diagnostic &Diag)
: IsBlockInfo(false),
HasBranchProtectedScope(false),
HasBranchIntoScope(false),
HasIndirectGoto(false),
- NumErrorsAtStartOfFunction(NumErrors) { }
+ ErrorTrap(Diag) { }
virtual ~FunctionScopeInfo();
/// \brief Clear out the information in this function scope, making it
/// suitable for reuse.
- void Clear(unsigned NumErrors);
+ void Clear();
static bool classof(const FunctionScopeInfo *FSI) { return true; }
};
@@ -118,8 +117,8 @@ public:
/// Its return type may be BuiltinType::Dependent.
QualType FunctionType;
- BlockScopeInfo(unsigned NumErrors, Scope *BlockScope, BlockDecl *Block)
- : FunctionScopeInfo(NumErrors), hasBlockDeclRefExprs(false),
+ BlockScopeInfo(Diagnostic &Diag, Scope *BlockScope, BlockDecl *Block)
+ : FunctionScopeInfo(Diag), hasBlockDeclRefExprs(false),
TheDecl(Block), TheScope(BlockScope)
{
IsBlockInfo = true;