diff options
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Sema/ScopeInfo.cpp')
-rw-r--r-- | contrib/llvm/tools/clang/lib/Sema/ScopeInfo.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/contrib/llvm/tools/clang/lib/Sema/ScopeInfo.cpp b/contrib/llvm/tools/clang/lib/Sema/ScopeInfo.cpp index 3970b41..b309a36 100644 --- a/contrib/llvm/tools/clang/lib/Sema/ScopeInfo.cpp +++ b/contrib/llvm/tools/clang/lib/Sema/ScopeInfo.cpp @@ -40,10 +40,15 @@ void FunctionScopeInfo::Clear() { FirstCXXTryLoc = SourceLocation(); FirstSEHTryLoc = SourceLocation(); + // Coroutine state + FirstCoroutineStmtLoc = SourceLocation(); + CoroutinePromise = nullptr; + NeedsCoroutineSuspends = true; + CoroutineSuspends.first = nullptr; + CoroutineSuspends.second = nullptr; + SwitchStack.clear(); Returns.clear(); - CoroutinePromise = nullptr; - CoroutineStmts.clear(); ErrorTrap.reset(); PossiblyUnreachableDiags.clear(); WeakObjectUses.clear(); @@ -184,7 +189,7 @@ void FunctionScopeInfo::markSafeWeakUse(const Expr *E) { } // Has this weak object been seen before? - FunctionScopeInfo::WeakObjectUseMap::iterator Uses; + FunctionScopeInfo::WeakObjectUseMap::iterator Uses = WeakObjectUses.end(); if (const ObjCPropertyRefExpr *RefExpr = dyn_cast<ObjCPropertyRefExpr>(E)) { if (!RefExpr->isObjectReceiver()) return; @@ -197,10 +202,10 @@ void FunctionScopeInfo::markSafeWeakUse(const Expr *E) { } else if (const ObjCIvarRefExpr *IvarE = dyn_cast<ObjCIvarRefExpr>(E)) Uses = WeakObjectUses.find(WeakObjectProfileTy(IvarE)); - else if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E)) - Uses = WeakObjectUses.find(WeakObjectProfileTy(DRE)); - else if (const ObjCMessageExpr *MsgE = dyn_cast<ObjCMessageExpr>(E)) { - Uses = WeakObjectUses.end(); + else if (const DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E)) { + if (isa<VarDecl>(DRE->getDecl())) + Uses = WeakObjectUses.find(WeakObjectProfileTy(DRE)); + } else if (const ObjCMessageExpr *MsgE = dyn_cast<ObjCMessageExpr>(E)) { if (const ObjCMethodDecl *MD = MsgE->getMethodDecl()) { if (const ObjCPropertyDecl *Prop = MD->findPropertyDecl()) { Uses = |