Home | History | Annotate | Download | only in Analysis

Lines Matching defs:Exp

91   void buildMutexID(Expr *Exp, const NamedDecl *D, Expr *Parent,
93 if (!Exp) {
98 if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(Exp)) {
118 } else if (MemberExpr *ME = dyn_cast<MemberExpr>(Exp)) {
122 } else if (isa<CXXThisExpr>(Exp)) {
129 } else if (CXXMemberCallExpr *CMCE = dyn_cast<CXXMemberCallExpr>(Exp)) {
138 } else if (CallExpr *CE = dyn_cast<CallExpr>(Exp)) {
145 } else if (BinaryOperator *BOE = dyn_cast<BinaryOperator>(Exp)) {
148 } else if (UnaryOperator *UOE = dyn_cast<UnaryOperator>(Exp)) {
150 } else if (ArraySubscriptExpr *ASE = dyn_cast<ArraySubscriptExpr>(Exp)) {
154 dyn_cast<AbstractConditionalOperator>(Exp)) {
158 } else if (ChooseExpr *CE = dyn_cast<ChooseExpr>(Exp)) {
162 } else if (CastExpr *CE = dyn_cast<CastExpr>(Exp)) {
164 } else if (ParenExpr *PE = dyn_cast<ParenExpr>(Exp)) {
166 } else if (isa<CharacterLiteral>(Exp) ||
167 isa<CXXNullPtrLiteralExpr>(Exp) ||
168 isa<GNUNullExpr>(Exp) ||
169 isa<CXXBoolLiteralExpr>(Exp) ||
170 isa<FloatingLiteral>(Exp) ||
171 isa<ImaginaryLiteral>(Exp) ||
172 isa<IntegerLiteral>(Exp) ||
173 isa<StringLiteral>(Exp) ||
174 isa<ObjCStringLiteral>(Exp)) {
402 Expr *Exp; // The expression for this variable, OR
404 Context Ctx; // The map with which Exp should be interpreted.
406 bool isReference() { return !Exp; }
411 : Dec(D), Exp(E), Ref(0), Ctx(C)
416 : Dec(D), Exp(0), Ref(R), Ctx(C)
451 if (VarDefinitions[i].Exp) {
453 return VarDefinitions[i].Exp;
491 Expr *Exp = VarDefinitions[i].Exp;
496 if (Exp) Exp->dump();
531 Context addDefinition(NamedDecl *D, Expr *Exp, Context Ctx) {
535 VarDefinitions.push_back(VarDefinition(D, Exp, Ctx));
549 Context updateDefinition(NamedDecl *D, Expr *Exp, Context Ctx) {
554 VarDefinitions.push_back(VarDefinition(D, Exp, Ctx));
912 Expr *Exp, NamedDecl *D, VarDecl *VD = 0);
914 Expr *Exp, NamedDecl* FunDecl);
916 const ValueDecl *getValueDecl(Expr *Exp);
917 void warnIfMutexNotHeld (const NamedDecl *D, Expr *Exp, AccessKind AK,
919 void checkAccess(Expr *Exp, AccessKind AK);
920 void checkDereference(Expr *Exp, AccessKind AK);
921 void handleCall(Expr *Exp, NamedDecl *D, VarDecl *VD = 0);
924 void addTrylock(LockKind LK, AttrType *Attr, Expr *Exp, NamedDecl *FunDecl,
974 void VisitCallExpr(CallExpr *Exp);
975 void VisitCXXConstructExpr(CXXConstructExpr *Exp);
1010 Expr *Exp, NamedDecl* FunDecl, VarDecl *VD) {
1013 SourceLocation ExpLocation = Exp->getExprLoc();
1027 MutexID Mutex(0, Exp, FunDecl);
1029 MutexID::warnInvalidLock(Handler, 0, Exp, FunDecl);
1036 MutexID Mutex(*I, Exp, FunDecl);
1038 MutexID::warnInvalidLock(Handler, *I, Exp, FunDecl);
1054 Expr *Exp, NamedDecl* FunDecl) {
1056 if (Exp) ExpLocation = Exp->getExprLoc();
1060 MutexID Mu(0, Exp, FunDecl);
1062 MutexID::warnInvalidLock(Handler, 0, Exp, FunDecl);
1070 MutexID Mutex(*I, Exp, FunDecl);
1072 MutexID::warnInvalidLock(Handler, *I, Exp, FunDecl);
1079 const ValueDecl *BuildLockset::getValueDecl(Expr *Exp) {
1080 if (const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(Exp))
1083 if (const MemberExpr *ME = dyn_cast<MemberExpr>(Exp))
1091 void BuildLockset::warnIfMutexNotHeld(const NamedDecl *D, Expr *Exp,
1096 MutexID Mutex(MutexExp, Exp, D);
1098 MutexID::warnInvalidLock(Handler, MutexExp, Exp, D);
1100 Handler.handleMutexNotHeld(D, POK, Mutex.getName(), LK, Exp->getExprLoc());
1108 /// \param Exp An expression that has been read or written.
1109 void BuildLockset::checkDereference(Expr *Exp, AccessKind AK) {
1110 UnaryOperator *UO = dyn_cast<UnaryOperator>(Exp);
1113 Exp = UO->getSubExpr()->IgnoreParenCasts();
1115 const ValueDecl *D = getValueDecl(Exp);
1120 Handler.handleNoMutexHeld(D, POK_VarDereference, AK, Exp->getExprLoc());
1125 warnIfMutexNotHeld(D, Exp, AK, PGBAttr->getArg(), POK_VarDereference);
1132 void BuildLockset::checkAccess(Expr *Exp, AccessKind AK) {
1133 const ValueDecl *D = getValueDecl(Exp);
1138 Handler.handleNoMutexHeld(D, POK_VarAccess, AK, Exp->getExprLoc());
1143 warnIfMutexNotHeld(D, Exp, AK, GBAttr->getArg(), POK_VarAccess);
1160 void BuildLockset::handleCall(Expr *Exp, NamedDecl *D, VarDecl *VD) {
1169 addLocksToSet(LK_Exclusive, A, Exp, D, VD);
1177 addLocksToSet(LK_Shared, A, Exp, D, VD);
1185 removeLocksFromSet(UFAttr, Exp, D);
1195 warnIfMutexNotHeld(D, Exp, AK_Written, *I, POK_FunctionCall);
1204 warnIfMutexNotHeld(D, Exp, AK_Read, *I, POK_FunctionCall);
1212 MutexID Mutex(*I, Exp, D);
1214 MutexID::warnInvalidLock(Handler, *I, Exp, D);
1217 Exp->getExprLoc());
1233 void BuildLockset::addTrylock(LockKind LK, AttrType *Attr, Expr *Exp,
1252 addLocksToSet(LK, Attr, Exp, FunDecl, 0);
1293 CallExpr *Exp = getTrylockCallExpr(Cond, LVarCtx, Negate);
1294 if (!Exp)
1297 NamedDecl *FunDecl = dyn_cast_or_null<NamedDecl>(Exp->getCalleeDecl());
1309 addTrylock(LK_Exclusive, A, Exp, FunDecl, PredBlock, CurrBlock,
1316 addTrylock(LK_Shared, A, Exp, FunDecl, PredBlock, CurrBlock,
1373 void BuildLockset::VisitCallExpr(CallExpr *Exp) {
1374 NamedDecl *D = dyn_cast_or_null<NamedDecl>(Exp->getCalleeDecl());
1377 handleCall(Exp, D);
1380 void BuildLockset::VisitCXXConstructExpr(CXXConstructExpr *Exp) {