Lines Matching refs:C

25   void checkPreStmt(const CXXNewExpr *NE, CheckerContext &C) const;
29 CheckerContext &C) const;
32 CheckerContext &C) const;
36 SVal getExtentSizeOfNewTarget(const CXXNewExpr *NE, CheckerContext &C,
40 SVal getExtentSizeOfPlace(const CXXNewExpr *NE, CheckerContext &C) const;
42 void emitBadAlignReport(const Expr *P, CheckerContext &C,
45 unsigned getStorageAlign(CheckerContext &C, const ValueDecl *VD) const;
47 void checkElementRegionAlign(const ElementRegion *R, CheckerContext &C,
50 void checkFieldRegionAlign(const FieldRegion *R, CheckerContext &C,
53 bool isVarRegionAlignedProperly(const VarRegion *R, CheckerContext &C,
65 CheckerContext &C) const { in getExtentSizeOfPlace()
67 return getDynamicExtentWithOffset(C.getState(), C.getSVal(Place)); in getExtentSizeOfPlace()
71 CheckerContext &C, in getExtentSizeOfNewTarget() argument
73 ProgramStateRef State = C.getState(); in getExtentSizeOfNewTarget()
74 SValBuilder &SvalBuilder = C.getSValBuilder(); in getExtentSizeOfNewTarget()
76 ASTContext &AstContext = C.getASTContext(); in getExtentSizeOfNewTarget()
82 SVal ElementCount = C.getSVal(SizeExpr); in getExtentSizeOfNewTarget()
95 C.getASTContext().getCharWidth(), in getExtentSizeOfNewTarget()
103 const CXXNewExpr *NE, CheckerContext &C) const { in checkPlaceCapacityIsSufficient()
105 SVal SizeOfTarget = getExtentSizeOfNewTarget(NE, C, IsArrayTypeAllocated); in checkPlaceCapacityIsSufficient()
106 SVal SizeOfPlace = getExtentSizeOfPlace(NE, C); in checkPlaceCapacityIsSufficient()
117 if (ExplodedNode *N = C.generateErrorNode(C.getState())) { in checkPlaceCapacityIsSufficient()
143 C.emitReport(std::move(R)); in checkPlaceCapacityIsSufficient()
152 void PlacementNewChecker::emitBadAlignReport(const Expr *P, CheckerContext &C, in emitBadAlignReport() argument
155 ProgramStateRef State = C.getState(); in emitBadAlignReport()
156 if (ExplodedNode *N = C.generateErrorNode(State)) { in emitBadAlignReport()
163 C.emitReport(std::move(R)); in emitBadAlignReport()
167 unsigned PlacementNewChecker::getStorageAlign(CheckerContext &C, in getStorageAlign() argument
169 unsigned StorageTAlign = C.getASTContext().getTypeAlign(VD->getType()); in getStorageAlign()
173 return StorageTAlign / C.getASTContext().getCharWidth(); in getStorageAlign()
177 const ElementRegion *R, CheckerContext &C, const Expr *P, in checkElementRegionAlign() argument
179 auto IsBaseRegionAlignedProperly = [this, R, &C, P, in checkElementRegionAlign()
204 BaseRegionAlign = getStorageAlign(C, TheElementDeclRegion->getDecl()); in checkElementRegionAlign()
206 BaseRegionAlign = getStorageAlign(C, BaseDeclRegion->getDecl()); in checkElementRegionAlign()
209 emitBadAlignReport(P, C, AllocatedTAlign, BaseRegionAlign); in checkElementRegionAlign()
216 auto CheckElementRegionOffset = [this, R, &C, P, AllocatedTAlign]() -> void { in checkElementRegionAlign()
222 TheOffsetRegion.getOffset() / C.getASTContext().getCharWidth(); in checkElementRegionAlign()
225 emitBadAlignReport(P, C, AllocatedTAlign, AddressAlign); in checkElementRegionAlign()
236 const FieldRegion *R, CheckerContext &C, const Expr *P, in checkFieldRegionAlign() argument
243 if (isVarRegionAlignedProperly(TheVarRegion, C, P, AllocatedTAlign)) { in checkFieldRegionAlign()
252 Offset.getOffset() / C.getASTContext().getCharWidth(); in checkFieldRegionAlign()
255 emitBadAlignReport(P, C, AllocatedTAlign, AddressAlign); in checkFieldRegionAlign()
261 const VarRegion *R, CheckerContext &C, const Expr *P, in isVarRegionAlignedProperly() argument
264 unsigned StorageTAlign = getStorageAlign(C, TheVarDecl); in isVarRegionAlignedProperly()
266 emitBadAlignReport(P, C, AllocatedTAlign, StorageTAlign); in isVarRegionAlignedProperly()
275 CheckerContext &C) const { in checkPlaceIsAlignedProperly()
279 unsigned AllocatedTAlign = C.getASTContext().getTypeAlign(AllocatedT) / in checkPlaceIsAlignedProperly()
280 C.getASTContext().getCharWidth(); in checkPlaceIsAlignedProperly()
282 SVal PlaceVal = C.getSVal(Place); in checkPlaceIsAlignedProperly()
285 checkElementRegionAlign(TheElementRegion, C, Place, AllocatedTAlign); in checkPlaceIsAlignedProperly()
287 checkFieldRegionAlign(TheFieldRegion, C, Place, AllocatedTAlign); in checkPlaceIsAlignedProperly()
289 isVarRegionAlignedProperly(TheVarRegion, C, Place, AllocatedTAlign); in checkPlaceIsAlignedProperly()
296 CheckerContext &C) const { in checkPreStmt()
304 if (!checkPlaceCapacityIsSufficient(NE, C)) in checkPreStmt()
307 checkPlaceIsAlignedProperly(NE, C); in checkPreStmt()