diff options
author | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
commit | 39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df (patch) | |
tree | a9243275843fbeaa590afc07ee888e006b8d54ea /include/clang/Sema/Scope.h | |
parent | 69b4eca4a4255ba43baa5c1d9bbdec3ec17f479e (diff) | |
download | FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.zip FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.tar.gz |
Vendor import of clang trunk r126079:
http://llvm.org/svn/llvm-project/cfe/trunk@126079
Diffstat (limited to 'include/clang/Sema/Scope.h')
-rw-r--r-- | include/clang/Sema/Scope.h | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/include/clang/Sema/Scope.h b/include/clang/Sema/Scope.h index 4229c6c..d7fda35 100644 --- a/include/clang/Sema/Scope.h +++ b/include/clang/Sema/Scope.h @@ -14,6 +14,7 @@ #ifndef LLVM_CLANG_SEMA_SCOPE_H #define LLVM_CLANG_SEMA_SCOPE_H +#include "clang/Basic/Diagnostic.h" #include "llvm/ADT/SmallPtrSet.h" namespace clang { @@ -52,7 +53,7 @@ public: /// ClassScope - The scope of a struct/union/class definition. ClassScope = 0x20, - /// BlockScope - This is a scope that corresponds to a block object. + /// BlockScope - This is a scope that corresponds to a block/closure object. /// Blocks serve as top-level scopes for some objects like labels, they /// also prevent things like break and continue. BlockScopes always have /// the FnScope, BreakScope, ContinueScope, and DeclScope flags set as well. @@ -131,11 +132,12 @@ private: typedef llvm::SmallVector<UsingDirectiveDecl *, 2> UsingDirectivesTy; UsingDirectivesTy UsingDirectives; - /// \brief The number of errors at the start of the given scope. - unsigned NumErrorsAtStart; + /// \brief Used to determine if errors occurred in this scope. + DiagnosticErrorTrap ErrorTrap; public: - Scope(Scope *Parent, unsigned ScopeFlags) { + Scope(Scope *Parent, unsigned ScopeFlags, Diagnostic &Diag) + : ErrorTrap(Diag) { Init(Parent, ScopeFlags); } @@ -144,8 +146,7 @@ public: unsigned getFlags() const { return Flags; } void setFlags(unsigned F) { Flags = F; } - /// isBlockScope - Return true if this scope does not correspond to a - /// closure. + /// isBlockScope - Return true if this scope correspond to a closure. bool isBlockScope() const { return Flags & BlockScope; } /// getParent - Return the scope that this is nested in. @@ -214,13 +215,7 @@ public: void* getEntity() const { return Entity; } void setEntity(void *E) { Entity = E; } - /// \brief Retrieve the number of errors that had been emitted when we - /// entered this scope. - unsigned getNumErrorsAtStart() const { return NumErrorsAtStart; } - - void setNumErrorsAtStart(unsigned NumErrors) { - NumErrorsAtStart = NumErrors; - } + bool hasErrorOccurred() const { return ErrorTrap.hasErrorOccurred(); } /// isClassScope - Return true if this scope is a class/struct/union scope. bool isClassScope() const { @@ -318,7 +313,7 @@ public: DeclsInScope.clear(); UsingDirectives.clear(); Entity = 0; - NumErrorsAtStart = 0; + ErrorTrap.reset(); } }; |