diff options
Diffstat (limited to 'clang/include/clang/Sema/ScopeInfo.h')
-rw-r--r-- | clang/include/clang/Sema/ScopeInfo.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/include/clang/Sema/ScopeInfo.h b/clang/include/clang/Sema/ScopeInfo.h index 5925fd6ccea..e09a68aba70 100644 --- a/clang/include/clang/Sema/ScopeInfo.h +++ b/clang/include/clang/Sema/ScopeInfo.h @@ -31,6 +31,7 @@ #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSwitch.h" +#include "llvm/ADT/TinyPtrVector.h" #include "llvm/Support/Casting.h" #include "llvm/Support/ErrorHandling.h" #include <algorithm> @@ -202,6 +203,12 @@ public: /// function. SmallVector<CompoundScopeInfo, 4> CompoundScopes; + /// The set of blocks that are introduced in this function. + llvm::SmallPtrSet<const BlockDecl *, 1> Blocks; + + /// The set of __block variables that are introduced in this function. + llvm::TinyPtrVector<VarDecl *> ByrefBlockVars; + /// A list of PartialDiagnostics created but delayed within the /// current function scope. These diagnostics are vetted for reachability /// prior to being emitted. @@ -426,6 +433,16 @@ public: (HasBranchProtectedScope && HasBranchIntoScope)); } + // Add a block introduced in this function. + void addBlock(const BlockDecl *BD) { + Blocks.insert(BD); + } + + // Add a __block variable introduced in this function. + void addByrefBlockVar(VarDecl *VD) { + ByrefBlockVars.push_back(VD); + } + bool isCoroutine() const { return !FirstCoroutineStmtLoc.isInvalid(); } void setFirstCoroutineStmt(SourceLocation Loc, StringRef Keyword) { |