aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Sema/Scope.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Sema/Scope.h')
-rw-r--r--include/clang/Sema/Scope.h23
1 files changed, 15 insertions, 8 deletions
diff --git a/include/clang/Sema/Scope.h b/include/clang/Sema/Scope.h
index d016b9b887c5..249a4c74311b 100644
--- a/include/clang/Sema/Scope.h
+++ b/include/clang/Sema/Scope.h
@@ -91,7 +91,10 @@ public:
TryScope = 0x2000,
/// \brief This is the scope for a function-level C++ try or catch scope.
- FnTryCatchScope = 0x4000
+ FnTryCatchScope = 0x4000,
+
+ /// \brief This is the scope of OpenMP executable directive
+ OpenMPDirectiveScope = 0x8000
};
private:
/// The parent scope for this scope. This is null for the translation-unit
@@ -143,11 +146,10 @@ private:
typedef llvm::SmallPtrSet<Decl *, 32> DeclSetTy;
DeclSetTy DeclsInScope;
- /// Entity - The entity with which this scope is associated. For
+ /// The DeclContext with which this scope is associated. For
/// example, the entity of a class scope is the class itself, the
- /// entity of a function scope is a function, etc. This field is
- /// maintained by the Action implementation.
- void *Entity;
+ /// entity of a function scope is a function, etc.
+ DeclContext *Entity;
typedef SmallVector<UsingDirectiveDecl *, 2> UsingDirectivesTy;
UsingDirectivesTy UsingDirectives;
@@ -236,8 +238,8 @@ public:
return DeclsInScope.count(D) != 0;
}
- void* getEntity() const { return Entity; }
- void setEntity(void *E) { Entity = E; }
+ DeclContext *getEntity() const { return Entity; }
+ void setEntity(DeclContext *E) { Entity = E; }
bool hasErrorOccurred() const { return ErrorTrap.hasErrorOccurred(); }
@@ -301,7 +303,12 @@ public:
}
return false;
}
-
+
+ /// \brief Determines whether this scope is the OpenMP directive scope
+ bool isOpenMPDirectiveScope() const {
+ return (getFlags() & Scope::OpenMPDirectiveScope);
+ }
+
/// \brief Determine whether this scope is a C++ 'try' block.
bool isTryScope() const { return getFlags() & Scope::TryScope; }