Lines Matching defs:Exp

402     const Expr *Exp = nullptr;
407 // The map with which Exp should be interpreted.
410 bool isReference() const { return !Exp; }
415 : Dec(D), Exp(E), Ctx(C) {}
452 if (VarDefinitions[i].Exp) {
454 return VarDefinitions[i].Exp;
492 const Expr *Exp = VarDefinitions[i].Exp;
497 if (Exp) Exp->dump();
533 Context addDefinition(const NamedDecl *D, const Expr *Exp, Context Ctx) {
537 VarDefinitions.push_back(VarDefinition(D, Exp, Ctx));
551 Context updateDefinition(const NamedDecl *D, Expr *Exp, Context Ctx) {
556 VarDefinitions.push_back(VarDefinition(D, Exp, Ctx));
1056 void getMutexIDs(CapExprSet &Mtxs, AttrType *Attr, const Expr *Exp,
1060 void getMutexIDs(CapExprSet &Mtxs, AttrType *Attr, const Expr *Exp,
1086 const Expr *Exp, AccessKind AK, Expr *MutexExp,
1089 void warnIfMutexHeld(const FactSet &FSet, const NamedDecl *D, const Expr *Exp,
1093 void checkAccess(const FactSet &FSet, const Expr *Exp, AccessKind AK,
1095 void checkPtAccess(const FactSet &FSet, const Expr *Exp, AccessKind AK,
1221 static const ValueDecl *getValueDecl(const Expr *Exp) {
1222 if (const auto *CE = dyn_cast<ImplicitCastExpr>(Exp))
1225 if (const auto *DR = dyn_cast<DeclRefExpr>(Exp))
1228 if (const auto *ME = dyn_cast<MemberExpr>(Exp))
1350 const Expr *Exp, const NamedDecl *D,
1354 CapabilityExpr Cp = SxBuilder.translateAttrExpr(nullptr, D, Exp, Self);
1356 warnInvalidLock(Handler, nullptr, D, Exp, Cp.getKind());
1366 CapabilityExpr Cp = SxBuilder.translateAttrExpr(Arg, D, Exp, Self);
1368 warnInvalidLock(Handler, nullptr, D, Exp, Cp.getKind());
1382 const Expr *Exp, const NamedDecl *D,
1402 getMutexIDs(Mtxs, Attr, Exp, D);
1509 const auto *Exp = getTrylockCallExpr(Cond, LVarCtx, Negate);
1510 if (!Exp)
1513 auto *FunDecl = dyn_cast_or_null<NamedDecl>(Exp->getCalleeDecl());
1526 Exp, FunDecl, PredBlock, CurrBlock, A->getSuccessValue(),
1532 getMutexIDs(ExclusiveLocksToAdd, A, Exp, FunDecl, PredBlock, CurrBlock,
1538 getMutexIDs(SharedLocksToAdd, A, Exp, FunDecl, PredBlock, CurrBlock,
1548 SourceLocation Loc = Exp->getExprLoc();
1576 void checkAccess(const Expr *Exp, AccessKind AK,
1578 Analyzer->checkAccess(FSet, Exp, AK, POK);
1580 void checkPtAccess(const Expr *Exp, AccessKind AK,
1582 Analyzer->checkPtAccess(FSet, Exp, AK, POK);
1585 void handleCall(const Expr *Exp, const NamedDecl *D,
1603 void VisitCallExpr(const CallExpr *Exp);
1604 void VisitCXXConstructExpr(const CXXConstructExpr *Exp);
1606 void VisitMaterializeTemporaryExpr(const MaterializeTemporaryExpr *Exp);
1615 const FactSet &FSet, const NamedDecl *D, const Expr *Exp, AccessKind AK,
1619 CapabilityExpr Cp = SxBuilder.translateAttrExpr(MutexExp, D, Exp, Self);
1621 warnInvalidLock(Handler, MutexExp, D, Exp, Cp.getKind());
1674 const NamedDecl *D, const Expr *Exp,
1678 CapabilityExpr Cp = SxBuilder.translateAttrExpr(MutexExp, D, Exp, Self);
1680 warnInvalidLock(Handler, MutexExp, D, Exp, Cp.getKind());
1698 void ThreadSafetyAnalyzer::checkAccess(const FactSet &FSet, const Expr *Exp,
1701 Exp = Exp->IgnoreImplicit()->IgnoreParenCasts();
1703 SourceLocation Loc = Exp->getExprLoc();
1707 while (const auto *DRE = dyn_cast<DeclRefExpr>(Exp)) {
1712 if (E == Exp)
1714 Exp = E;
1721 if (const auto *UO = dyn_cast<UnaryOperator>(Exp)) {
1728 if (const auto *BO = dyn_cast<BinaryOperator>(Exp)) {
1739 if (const auto *AE = dyn_cast<ArraySubscriptExpr>(Exp)) {
1744 if (const auto *ME = dyn_cast<MemberExpr>(Exp)) {
1751 const ValueDecl *D = getValueDecl(Exp);
1760 warnIfMutexNotHeld(FSet, D, Exp, AK, I->getArg(), POK, nullptr, Loc);
1765 void ThreadSafetyAnalyzer::checkPtAccess(const FactSet &FSet, const Expr *Exp,
1769 if (const auto *PE = dyn_cast<ParenExpr>(Exp)) {
1770 Exp = PE->getSubExpr();
1773 if (const auto *CE = dyn_cast<CastExpr>(Exp)) {
1780 Exp = CE->getSubExpr();
1792 const ValueDecl *D = getValueDecl(Exp);
1797 Handler.handleNoMutexHeld(D, PtPOK, AK, Exp->getExprLoc());
1800 warnIfMutexNotHeld(FSet, D, Exp, AK, I->getArg(), PtPOK, nullptr,
1801 Exp->getExprLoc());
1814 /// \param Exp The call expression.
1816 /// \param Self If \p Exp = nullptr, the implicit this argument or the argument
1818 /// \param Loc If \p Exp = nullptr, the location.
1819 void BuildLockset::handleCall(const Expr *Exp, const NamedDecl *D,
1827 if (Exp) {
1829 const auto *TagT = Exp->getType()->getAs<TagType>();
1830 if (D->hasAttrs() && TagT && Exp->isPRValue()) {
1832 Analyzer->SxBuilder.createThisPlaceholder(Exp);
1834 Analyzer->ConstructedObjects.insert({Exp, Placeholder.first});
1836 if (isa<CXXConstructExpr>(Exp))
1843 Loc = Exp->getExprLoc();
1854 A, Exp, D, Self);
1865 Analyzer->getMutexIDs(AssertLocks, A, Exp, D, Self);
1876 Analyzer->getMutexIDs(AssertLocks, A, Exp, D, Self);
1887 Analyzer->getMutexIDs(AssertLocks, A, Exp, D, Self);
1901 Analyzer->getMutexIDs(GenericLocksToRemove, A, Exp, D, Self);
1903 Analyzer->getMutexIDs(SharedLocksToRemove, A, Exp, D, Self);
1905 Analyzer->getMutexIDs(ExclusiveLocksToRemove, A, Exp, D, Self);
1912 Analyzer->warnIfMutexNotHeld(FSet, D, Exp,
1917 Analyzer->getMutexIDs(ScopedReqsAndExcludes, A, Exp, D, Self);
1925 Analyzer->warnIfMutexHeld(FSet, D, Exp, Arg, Self, Loc);
1928 Analyzer->getMutexIDs(ScopedReqsAndExcludes, A, Exp, D, Self);
1940 if (Exp) {
1941 if (const auto *CE = dyn_cast<CallExpr>(Exp))
1943 else if (const auto *CE = dyn_cast<CXXConstructExpr>(Exp))
1958 A, Exp, D, Self);
1959 Analyzer->getMutexIDs(DeclaredLocks, A, Exp, D, Self);
1966 Analyzer->getMutexIDs(GenericLocksToRemove, A, Exp, D, Self);
1968 Analyzer->getMutexIDs(SharedLocksToRemove, A, Exp, D, Self);
1970 Analyzer->getMutexIDs(ExclusiveLocksToRemove, A, Exp, D, Self);
1971 Analyzer->getMutexIDs(DeclaredLocks, A, Exp, D, Self);
1978 Analyzer->warnIfMutexNotHeld(FSet, D, Exp,
1981 Analyzer->getMutexIDs(DeclaredLocks, A, Exp, D, Self);
1988 Analyzer->warnIfMutexHeld(FSet, D, Exp, Arg, Self, Loc);
1989 Analyzer->getMutexIDs(DeclaredLocks, A, Exp, D, Self);
2011 Exp->getExprLoc());
2019 Exp->getExprLoc(), D->getLocation(), Scope->toString(),
2023 Exp->getExprLoc(), D->getLocation(), Scope->toString(),
2027 Exp->getExprLoc(), D->getLocation(), Scope->toString(),
2140 void BuildLockset::VisitCallExpr(const CallExpr *Exp) {
2141 if (const auto *CE = dyn_cast<CXXMemberCallExpr>(Exp)) {
2157 } else if (const auto *OE = dyn_cast<CXXOperatorCallExpr>(Exp)) {
2200 examineArguments(Exp->getDirectCallee(), Exp->arg_begin(), Exp->arg_end());
2203 auto *D = dyn_cast_or_null<NamedDecl>(Exp->getCalleeDecl());
2206 handleCall(Exp, D);
2209 void BuildLockset::VisitCXXConstructExpr(const CXXConstructExpr *Exp) {
2210 const CXXConstructorDecl *D = Exp->getConstructor();
2212 const Expr* Source = Exp->getArg(0);
2215 examineArguments(D, Exp->arg_begin(), Exp->arg_end());
2218 handleCall(Exp, D);
2260 const MaterializeTemporaryExpr *Exp) {
2261 if (const ValueDecl *ExtD = Exp->getExtendingDecl()) {
2263 UnpackConstruction(Exp->getSubExpr()));
2637 LocksetBuilder.handleCall(/*Exp=*/nullptr, CF.getFunctionDecl(),