diff options
Diffstat (limited to 'clang/lib/Analysis')
| -rw-r--r-- | clang/lib/Analysis/ThreadSafety.cpp | 8 | ||||
| -rw-r--r-- | clang/lib/Analysis/ThreadSafetyCommon.cpp | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/clang/lib/Analysis/ThreadSafety.cpp b/clang/lib/Analysis/ThreadSafety.cpp index fe6d3a23a8e..78e1b056e1d 100644 --- a/clang/lib/Analysis/ThreadSafety.cpp +++ b/clang/lib/Analysis/ThreadSafety.cpp @@ -1939,7 +1939,8 @@ void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D, if (isScopedVar) { // Add the managing object as a dummy mutex, mapped to the underlying mutex. SourceLocation MLoc = VD->getLocation(); - DeclRefExpr DRE(VD, false, VD->getType(), VK_LValue, VD->getLocation()); + DeclRefExpr DRE(VD->getASTContext(), VD, false, VD->getType(), VK_LValue, + VD->getLocation()); // FIXME: does this store a pointer to DRE? CapabilityExpr Scp = Analyzer->SxBuilder.translateAttrExpr(&DRE, nullptr); @@ -2475,8 +2476,9 @@ void ThreadSafetyAnalyzer::runAnalysis(AnalysisDeclContext &AC) { // Create a dummy expression, auto *VD = const_cast<VarDecl *>(AD.getVarDecl()); - DeclRefExpr DRE(VD, false, VD->getType().getNonReferenceType(), - VK_LValue, AD.getTriggerStmt()->getEndLoc()); + DeclRefExpr DRE(VD->getASTContext(), VD, false, + VD->getType().getNonReferenceType(), VK_LValue, + AD.getTriggerStmt()->getEndLoc()); LocksetBuilder.handleCall(&DRE, DD); break; } diff --git a/clang/lib/Analysis/ThreadSafetyCommon.cpp b/clang/lib/Analysis/ThreadSafetyCommon.cpp index 0c09974cf4e..14d1d9c7a8f 100644 --- a/clang/lib/Analysis/ThreadSafetyCommon.cpp +++ b/clang/lib/Analysis/ThreadSafetyCommon.cpp @@ -128,7 +128,8 @@ CapabilityExpr SExprBuilder::translateAttrExpr(const Expr *AttrExp, // Hack to handle constructors, where self cannot be recovered from // the expression. if (SelfDecl && !Ctx.SelfArg) { - DeclRefExpr SelfDRE(SelfDecl, false, SelfDecl->getType(), VK_LValue, + DeclRefExpr SelfDRE(SelfDecl->getASTContext(), SelfDecl, false, + SelfDecl->getType(), VK_LValue, SelfDecl->getLocation()); Ctx.SelfArg = &SelfDRE; |

