clang: include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_MEMREGION_H
16#define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_MEMREGION_H
17
32#include "llvm/ADT/DenseMap.h"
33#include "llvm/ADT/FoldingSet.h"
34#include "llvm/ADT/PointerIntPair.h"
35#include "llvm/ADT/iterator_range.h"
36#include "llvm/Support/Allocator.h"
37#include "llvm/Support/Casting.h"
38#include "llvm/Support/ErrorHandling.h"
39#include
40#include
41#include
42#include
43#include
44#include
45
47
53
54namespace ento {
55
63
64
66
68
69
70 int64_t Offset;
71
72public:
73
74
75 static const int64_t Symbolic = std::numeric_limits<int64_t>::max();
76
79
80
82
84
89
90 bool isValid() const { return R; }
91};
92
93
94
95
96
97
98class MemRegion : public llvm::FoldingSetNode {
99public:
101#define REGION(Id, Parent) Id ## Kind,
102#define REGION_RANGE(Id, First, Last) BEGIN_##Id = First, END_##Id = Last,
103#include "clang/StaticAnalyzer/Core/PathSensitive/Regions.def"
104#undef REGION
105#undef REGION_RANGE
106 };
107
108private:
109 const Kind kind;
110 mutable std::optional cachedOffset;
111
112protected:
115
116public:
118
119 virtual void Profile(llvm::FoldingSetNodeID& ID) const = 0;
120
122
123
124
125
126
127 [[nodiscard]] LLVM_ATTRIBUTE_RETURNS_NONNULL const MemSpaceRegion *
129
130
131 template
135
136
137
138
139 [[nodiscard]] LLVM_ATTRIBUTE_RETURNS_NONNULL const MemSpaceRegion *
141
142 template
146
147 template <typename... MemorySpaces>
149 static_assert(sizeof...(MemorySpaces));
151 }
152
153
154
157
159
160
161
162 LLVM_ATTRIBUTE_RETURNS_NONNULL
164
165
166
168
169 LLVM_ATTRIBUTE_RETURNS_NONNULL
171
172
173
174
176
177
179
180
182
183 virtual void dumpToStream(raw_ostream &os) const;
184
185 void dump() const;
186
187
189
190
191 virtual void printPretty(raw_ostream &os) const;
192
193
194
196
197
198
199
200
202
204
206
207 template const RegionTy* getAs() const;
208 template
209 LLVM_ATTRIBUTE_RETURNS_NONNULL const RegionTy *castAs() const;
210
212
213
214
215
216
217
218
219
220
222
223
224
225
226
227
228
229
230
232};
233
234
235
237protected:
239
243
245
246public:
248
249 void Profile(llvm::FoldingSetNodeID &ID) const override;
250
253 return k >= BEGIN_MEMSPACES && k <= END_MEMSPACES;
254 }
255};
256
257
258
261
264
265public:
266 void dumpToStream(raw_ostream &os) const override;
267
269 return R->getKind() == CodeSpaceRegionKind;
270 }
271};
272
274 virtual void anchor();
275
276protected:
280
281public:
284 return k >= BEGIN_GLOBAL_MEMSPACES && k <= END_GLOBAL_MEMSPACES;
285 }
286};
287
288
289
290
291
292
295
297
300 assert(cr);
301 }
302
303public:
304 void Profile(llvm::FoldingSetNodeID &ID) const override;
305
306 void dumpToStream(raw_ostream &os) const override;
307
308 LLVM_ATTRIBUTE_RETURNS_NONNULL
310
312 return R->getKind() == StaticGlobalSpaceRegionKind;
313 }
314};
315
316
317
318
319
320
321
323 void anchor() override;
324
325protected:
330
331public:
334 return k >= BEGIN_NON_STATIC_GLOBAL_MEMSPACES &&
335 k <= END_NON_STATIC_GLOBAL_MEMSPACES;
336 }
337};
338
339
340
343
346
347public:
348 void dumpToStream(raw_ostream &os) const override;
349
351 return R->getKind() == GlobalSystemSpaceRegionKind;
352 }
353};
354
355
356
357
358
359
362
365
366public:
367 void dumpToStream(raw_ostream &os) const override;
368
370 return R->getKind() == GlobalImmutableSpaceRegionKind;
371 }
372};
373
374
375
376
379
382
383public:
384 void dumpToStream(raw_ostream &os) const override;
385
387 return R->getKind() == GlobalInternalSpaceRegionKind;
388 }
389};
390
393
396
397public:
398 void dumpToStream(raw_ostream &os) const override;
399
401 return R->getKind() == HeapSpaceRegionKind;
402 }
403};
404
407
410
411public:
412 void dumpToStream(raw_ostream &os) const override;
413
415 return R->getKind() == UnknownSpaceRegionKind;
416 }
417};
418
420 virtual void anchor();
421
423
424protected:
430
431public:
432 LLVM_ATTRIBUTE_RETURNS_NONNULL
434
435 void Profile(llvm::FoldingSetNodeID &ID) const override;
436
439 return k >= BEGIN_STACK_MEMSPACES && k <= END_STACK_MEMSPACES;
440 }
441};
442
445
448
449public:
450 void dumpToStream(raw_ostream &os) const override;
451
453 return R->getKind() == StackLocalsSpaceRegionKind;
454 }
455};
456
458private:
460
462 : StackSpaceRegion(mgr, StackArgumentsSpaceRegionKind, sfc) {}
463
464public:
465 void dumpToStream(raw_ostream &os) const override;
466
468 return R->getKind() == StackArgumentsSpaceRegionKind;
469 }
470};
471
472
473
475 virtual void anchor();
476
477protected:
479
484
485public:
486 LLVM_ATTRIBUTE_RETURNS_NONNULL
490
492
494
496 return R->getKind() > END_MEMSPACES;
497 }
498};
499
500
501
502
503
504
505
508
509
510
511 unsigned Cnt;
512
513 const Expr *Ex;
514
517 assert(Ex);
518 }
519
520 static void ProfileRegion(llvm::FoldingSetNodeID& ID, const Expr *Ex,
522
523public:
524 LLVM_ATTRIBUTE_RETURNS_NONNULL
526
528
529 void Profile(llvm::FoldingSetNodeID& ID) const override;
530
531 void dumpToStream(raw_ostream &os) const override;
532
534 return R->getKind() == AllocaRegionKind;
535 }
536};
537
538
540 void anchor() override;
541
542protected:
546
547public:
549
553
555
557 unsigned k = R->getKind();
558 return k >= BEGIN_TYPED_REGIONS && k <= END_TYPED_REGIONS;
559 }
560};
561
562
564 void anchor() override;
565
566protected:
570
571public:
573
582
585 return T.getTypePtrOrNull() ? T.getDesugaredType(Context) : T;
586 }
587
589 unsigned k = R->getKind();
590 return k >= BEGIN_TYPED_VALUE_REGIONS && k <= END_TYPED_VALUE_REGIONS;
591 }
592};
593
595 void anchor() override;
596
597protected:
601
602public:
604
607 return k >= BEGIN_CODE_TEXT_REGIONS && k <= END_CODE_TEXT_REGIONS;
608 }
609};
610
611
614
616
618 : CodeTextRegion(sreg, FunctionCodeRegionKind), FD(fd) {
620 }
621
622 static void ProfileRegion(llvm::FoldingSetNodeID& ID, const NamedDecl *FD,
624
625public:
628 if (const auto *D = dyn_cast(FD)) {
630 }
631
633 assert(false && "Getting the type of ObjCMethod is not supported yet");
634
635
636
637 return {};
638 }
639
643
644 void dumpToStream(raw_ostream &os) const override;
645
646 void Profile(llvm::FoldingSetNodeID& ID) const override;
647
649 return R->getKind() == FunctionCodeRegionKind;
650 }
651};
652
653
654
655
656
657
658
661
665
668 : CodeTextRegion(sreg, BlockCodeRegionKind), BD(bd), AC(ac), locTy(lTy) {
669 assert(bd);
670 assert(ac);
672 }
673
674 static void ProfileRegion(llvm::FoldingSetNodeID& ID, const BlockDecl *BD,
677
678public:
682
683 LLVM_ATTRIBUTE_RETURNS_NONNULL
687
688 LLVM_ATTRIBUTE_RETURNS_NONNULL
690
691 void dumpToStream(raw_ostream &os) const override;
692
693 void Profile(llvm::FoldingSetNodeID& ID) const override;
694
696 return R->getKind() == BlockCodeRegionKind;
697 }
698};
699
700
701
702
703
704
705
708
711 unsigned BlockCount;
712 void *ReferencedVars = nullptr;
713 void *OriginalVars = nullptr;
714
717 : TypedRegion(sreg, BlockDataRegionKind), BC(bc), LC(lc),
718 BlockCount(count) {
719 assert(bc);
721 assert(lc);
725 }
726
727 static void ProfileRegion(llvm::FoldingSetNodeID&, const BlockCodeRegion *,
730
731public:
732 LLVM_ATTRIBUTE_RETURNS_NONNULL
734
735 LLVM_ATTRIBUTE_RETURNS_NONNULL
737
739
742 const MemRegion * const *OriginalR;
743
744 public:
746 const MemRegion * const *originalR)
747 : R(r), OriginalR(originalR) {}
748
749 LLVM_ATTRIBUTE_RETURNS_NONNULL
753
754 LLVM_ATTRIBUTE_RETURNS_NONNULL
758
760 assert((R == nullptr) == (I.R == nullptr));
761 return I.R == R;
762 }
763
765 assert((R == nullptr) == (I.R == nullptr));
766 return I.R != R;
767 }
768
770 ++R;
771 ++OriginalR;
772 return *this;
773 }
774
775
776
777
779 };
780
781
782
784
787 llvm::iterator_range<referenced_vars_iterator> referenced_vars() const;
788
789 void dumpToStream(raw_ostream &os) const override;
790
791 void Profile(llvm::FoldingSetNodeID& ID) const override;
792
794 return R->getKind() == BlockDataRegionKind;
795 }
796
797private:
798 void LazyInitializeReferencedVars();
799 std::pair<const VarRegion *, const VarRegion *>
800 getCaptureRegions(const VarDecl *VD);
801};
802
803
804
805
806
807
810
812
814 : SubRegion(sreg, SymbolicRegionKind), sym(s) {
815
816
817 assert(isa_and_nonnull(s));
818 assert(s->getType()->isAnyPointerType() ||
819 s->getType()->isReferenceType() ||
820 s->getType()->isBlockPointerType());
823 }
824
825public:
826
828
829
830
831
832
833
834
835
836
840
842
843 void Profile(llvm::FoldingSetNodeID& ID) const override;
844
845 static void ProfileRegion(llvm::FoldingSetNodeID& ID,
848
849 void dumpToStream(raw_ostream &os) const override;
850
852 return R->getKind() == SymbolicRegionKind;
853 }
854};
855
856
859
861
864 assert(str);
865 }
866
867 static void ProfileRegion(llvm::FoldingSetNodeID &ID,
870
871public:
872 LLVM_ATTRIBUTE_RETURNS_NONNULL
874
876
878
879 void Profile(llvm::FoldingSetNodeID& ID) const override {
881 }
882
883 void dumpToStream(raw_ostream &os) const override;
884
886 return R->getKind() == StringRegionKind;
887 }
888};
889
890
893
895
899 assert(str);
900 }
901
902 static void ProfileRegion(llvm::FoldingSetNodeID &ID,
905
906public:
907 LLVM_ATTRIBUTE_RETURNS_NONNULL
909
911
913
914 void Profile(llvm::FoldingSetNodeID& ID) const override {
916 }
917
918 void dumpToStream(raw_ostream &os) const override;
919
921 return R->getKind() == ObjCStringRegionKind;
922 }
923};
924
925
926
927
930
932
936 assert(cl);
939 }
940
941 static void ProfileRegion(llvm::FoldingSetNodeID& ID,
944
945public:
947
948 bool isBoundable() const override { return ->isFileScope(); }
949
950 void Profile(llvm::FoldingSetNodeID& ID) const override;
951
952 void dumpToStream(raw_ostream &os) const override;
953
954 LLVM_ATTRIBUTE_RETURNS_NONNULL
956
958 return R->getKind() == CompoundLiteralRegionKind;
959 }
960};
961
963protected:
967
968public:
969
971
973 unsigned k = R->getKind();
974 return k >= BEGIN_DECL_REGIONS && k <= END_DECL_REGIONS;
975 }
976};
977
980
981protected:
982
991
992public:
993
995
996
998
1003
1005 unsigned k = R->getKind();
1006 return k >= BEGIN_VAR_REGIONS && k <= END_VAR_REGIONS;
1007 }
1008};
1009
1012
1014
1015
1017 : VarRegion(sReg, NonParamVarRegionKind), VD(vd) {
1018
1019
1020
1021
1024 assert(vd);
1025 }
1026
1027 static void ProfileRegion(llvm::FoldingSetNodeID &ID, const VarDecl *VD,
1029
1030public:
1031 void Profile(llvm::FoldingSetNodeID &ID) const override;
1032
1033 LLVM_ATTRIBUTE_RETURNS_NONNULL
1035
1040
1041 void dumpToStream(raw_ostream &os) const override;
1042
1044
1046
1048 return R->getKind() == NonParamVarRegionKind;
1049 }
1050};
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1064
1065 const Expr *OriginExpr;
1066 unsigned Index;
1067
1068 ParamVarRegion(const Expr *OE, unsigned Idx, const MemRegion *SReg)
1069 : VarRegion(SReg, ParamVarRegionKind), OriginExpr(OE), Index(Idx) {
1071 assert(OriginExpr);
1072 }
1073
1074 static void ProfileRegion(llvm::FoldingSetNodeID &ID, const Expr *OE,
1075 unsigned Idx, const MemRegion *SReg);
1076
1077public:
1078 LLVM_ATTRIBUTE_RETURNS_NONNULL
1081
1082 void Profile(llvm::FoldingSetNodeID& ID) const override;
1083
1084 void dumpToStream(raw_ostream &os) const override;
1085
1087
1088
1090
1093
1095 return R->getKind() == ParamVarRegionKind;
1096 }
1097};
1098
1099
1100
1101
1104
1105 CXXThisRegion(const PointerType *thisPointerTy,
1108 ThisPointerTy(thisPointerTy) {
1109 assert(ThisPointerTy->getPointeeType()->getAsCXXRecordDecl() &&
1110 "Invalid region type!");
1111 }
1112
1113 static void ProfileRegion(llvm::FoldingSetNodeID &ID,
1116
1117public:
1118 void Profile(llvm::FoldingSetNodeID &ID) const override;
1119
1121 return QualType(ThisPointerTy, 0);
1122 }
1123
1124 void dumpToStream(raw_ostream &os) const override;
1125
1127 return R->getKind() == CXXThisRegionKind;
1128 }
1129
1130private:
1132};
1133
1136
1138
1140 : DeclRegion(sReg, FieldRegionKind), FD(fd) {
1141 assert(FD);
1142 }
1143
1144 static void ProfileRegion(llvm::FoldingSetNodeID &ID, const FieldDecl *FD,
1146 ID.AddInteger(static_cast<unsigned>(FieldRegionKind));
1147 ID.AddPointer(FD);
1149 }
1150
1151public:
1152 LLVM_ATTRIBUTE_RETURNS_NONNULL
1154
1155 void Profile(llvm::FoldingSetNodeID &ID) const override;
1156
1161
1162 void dumpToStream(raw_ostream &os) const override;
1163
1165 void printPretty(raw_ostream &os) const override;
1168
1170 return R->getKind() == FieldRegionKind;
1171 }
1172};
1173
1176
1178
1180
1181 static void ProfileRegion(llvm::FoldingSetNodeID& ID, const ObjCIvarDecl *ivd,
1183
1184public:
1185 LLVM_ATTRIBUTE_RETURNS_NONNULL
1187
1188 void Profile(llvm::FoldingSetNodeID& ID) const override;
1189
1191
1194
1195 void dumpToStream(raw_ostream &os) const override;
1196
1198 return R->getKind() == ObjCIvarRegionKind;
1199 }
1200};
1201
1202
1203
1204
1205
1206class RegionRawOffset {
1208
1211
1213 : Region(reg), Offset(offset) {}
1214
1215public:
1216
1218
1219
1221
1223 void dump() const;
1224};
1225
1226
1229
1232
1234 : TypedValueRegion(sReg, ElementRegionKind), ElementType(elementType),
1235 Index(Idx) {
1238 "The index must be signed");
1239 assert(!elementType.isNull() && !elementType->isVoidType() &&
1240 "Invalid region type!");
1241 }
1242
1243 static void ProfileRegion(llvm::FoldingSetNodeID& ID, QualType elementType,
1245
1246public:
1248
1250
1252
1253
1255
1256 void dumpToStream(raw_ostream &os) const override;
1257
1258 void Profile(llvm::FoldingSetNodeID& ID) const override;
1259
1261 return R->getKind() == ElementRegionKind;
1262 }
1263};
1264
1265
1268
1269 Expr const *Ex;
1270
1273 assert(E);
1275 }
1276
1277 static void ProfileRegion(llvm::FoldingSetNodeID &ID,
1279
1280public:
1281 LLVM_ATTRIBUTE_RETURNS_NONNULL
1283
1284 LLVM_ATTRIBUTE_RETURNS_NONNULL
1286
1288
1289 void dumpToStream(raw_ostream &os) const override;
1290
1291 void Profile(llvm::FoldingSetNodeID &ID) const override;
1292
1294 return R->getKind() == CXXTempObjectRegionKind;
1295 }
1296};
1297
1298
1299
1302
1303 Expr const *Ex;
1305
1306 CXXLifetimeExtendedObjectRegion(Expr const *E, ValueDecl const *D,
1308 : TypedValueRegion(sReg, CXXLifetimeExtendedObjectRegionKind), Ex(E),
1309 ExD(D) {
1310 assert(E);
1311 assert(D);
1313 }
1314
1315 static void ProfileRegion(llvm::FoldingSetNodeID &ID, Expr const *E,
1317
1318public:
1319 LLVM_ATTRIBUTE_RETURNS_NONNULL
1321 LLVM_ATTRIBUTE_RETURNS_NONNULL
1323
1325
1327
1328 void dumpToStream(raw_ostream &os) const override;
1329
1330 void Profile(llvm::FoldingSetNodeID &ID) const override;
1331
1333 return R->getKind() == CXXLifetimeExtendedObjectRegionKind;
1334 }
1335};
1336
1337
1338
1341
1342 llvm::PointerIntPair<const CXXRecordDecl *, 1, bool> Data;
1343
1344 CXXBaseObjectRegion(const CXXRecordDecl *RD, bool IsVirtual,
1346 : TypedValueRegion(SReg, CXXBaseObjectRegionKind), Data(RD, IsVirtual) {
1347 assert(RD);
1348 }
1349
1350 static void ProfileRegion(llvm::FoldingSetNodeID &ID, const CXXRecordDecl *RD,
1351 bool IsVirtual, const MemRegion *SReg);
1352
1353public:
1354 LLVM_ATTRIBUTE_RETURNS_NONNULL
1356 bool isVirtual() const { return Data.getInt(); }
1357
1359
1360 void dumpToStream(raw_ostream &os) const override;
1361
1362 void Profile(llvm::FoldingSetNodeID &ID) const override;
1363
1365
1367
1369 return region->getKind() == CXXBaseObjectRegionKind;
1370 }
1371};
1372
1373
1374
1375
1376
1377
1380
1382
1384 : TypedValueRegion(SReg, CXXDerivedObjectRegionKind), DerivedD(DerivedD) {
1385 assert(DerivedD);
1386
1387
1388
1390 "Should have unwrapped a base region instead!");
1391 }
1392
1393 static void ProfileRegion(llvm::FoldingSetNodeID &ID, const CXXRecordDecl *RD,
1395
1396public:
1397 LLVM_ATTRIBUTE_RETURNS_NONNULL
1399
1401
1402 void dumpToStream(raw_ostream &os) const override;
1403
1404 void Profile(llvm::FoldingSetNodeID &ID) const override;
1405
1407
1409
1411 return region->getKind() == CXXDerivedObjectRegionKind;
1412 }
1413};
1414
1415template
1417 if (const auto *RT = dyn_cast(this))
1418 return RT;
1419
1420 return nullptr;
1421}
1422
1423template
1427
1428
1429
1430
1431
1434 llvm::BumpPtrAllocator& A;
1435
1436 llvm::FoldingSet Regions;
1437
1441
1442 llvm::DenseMap<const StackFrameContext *, StackLocalsSpaceRegion *>
1443 StackLocalsSpaceRegions;
1444 llvm::DenseMap<const StackFrameContext *, StackArgumentsSpaceRegion *>
1445 StackArgumentsSpaceRegions;
1446 llvm::DenseMap<const CodeTextRegion *, StaticGlobalSpaceRegion *>
1447 StaticsGlobalSpaceRegions;
1448
1452
1453public:
1456
1459
1461
1462
1463
1466
1467
1468
1471
1472
1473
1476
1477
1478
1480 MemRegion::Kind K = MemRegion::GlobalInternalSpaceRegionKind,
1482
1483
1484
1486
1487
1488
1490
1492
1493
1496
1497
1498
1502
1503
1504
1507
1508
1509
1512
1513
1515
1517
1519
1520
1521
1523
1524
1525
1528
1529
1530
1532 unsigned Index,
1534
1535
1536
1540
1546
1547
1548
1549
1550
1553
1558
1559
1560
1561
1562
1565
1568
1569
1570
1574
1575
1576
1577
1578
1581
1582
1583
1584
1585
1588 bool IsVirtual);
1589
1590
1591
1598
1599
1600
1601
1602
1606
1611
1612
1613
1614
1615
1618 unsigned blockCount);
1619
1620private:
1621 template <typename RegionTy, typename SuperTy,
1622 typename Arg1Ty>
1623 RegionTy* getSubRegion(const Arg1Ty arg1,
1624 const SuperTy* superRegion);
1625
1626 template <typename RegionTy, typename SuperTy,
1627 typename Arg1Ty, typename Arg2Ty>
1628 RegionTy* getSubRegion(const Arg1Ty arg1, const Arg2Ty arg2,
1629 const SuperTy* superRegion);
1630
1631 template <typename RegionTy, typename SuperTy,
1632 typename Arg1Ty, typename Arg2Ty, typename Arg3Ty>
1633 RegionTy* getSubRegion(const Arg1Ty arg1, const Arg2Ty arg2,
1634 const Arg3Ty arg3,
1635 const SuperTy* superRegion);
1636
1637 template
1638 const REG* LazyAllocate(REG*& region);
1639
1640 template <typename REG, typename ARG>
1641 const REG* LazyAllocate(REG*& region, ARG a);
1642};
1643
1644
1645
1646
1647
1651
1652
1653
1654
1655
1656
1658 using StorageTypeForKinds = unsigned char;
1659
1660 llvm::DenseMap<const MemRegion *, StorageTypeForKinds> MRTraitsMap;
1661 llvm::DenseMap<SymbolRef, StorageTypeForKinds> SymTraitsMap;
1662
1663 using const_region_iterator =
1664 llvm::DenseMap<const MemRegion *, StorageTypeForKinds>::const_iterator;
1665 using const_symbol_iterator =
1666 llvm::DenseMap<SymbolRef, StorageTypeForKinds>::const_iterator;
1667
1668public:
1669
1671
1673
1674
1676
1677
1679
1680
1681
1683
1684
1685
1686 };
1687
1692};
1693
1694
1695
1696
1701
1702}
1703
1704}
1705
1706#endif
Defines the clang::ASTContext interface.
This file defines AnalysisDeclContext, a class that manages the analysis context data for context sen...
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::SourceLocation class and associated facilities.
C Language Family Type Representation.
__device__ __2f16 float __ockl_bool s
__device__ __2f16 float c
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
QualType getObjCObjectPointerType(QualType OIT) const
Return a ObjCObjectPointerType type for the given ObjCObjectType.
AnalysisDeclContext contains the context data for the function, method or block under analysis.
Represents a block literal declaration, which is like an unnamed FunctionDecl.
Represents a C++ struct/union/class.
const T * getTypePtr() const
Retrieve the underlying type pointer, which refers to a canonical type.
CharUnits - This is an opaque type for sizes expressed in character units.
static CharUnits Zero()
Zero - Construct a CharUnits quantity of zero.
CompoundLiteralExpr - [C99 6.5.2.5].
Decl - This represents one declaration (or definition), e.g.
This represents one expression.
Represents a member of a struct/union/class.
It wraps the AnalysisDeclContext to represent both the call stack with the help of StackFrameContext ...
This represents a decl that may have a name.
ObjCIvarDecl - Represents an ObjC instance variable.
ObjCStringLiteral, used for Objective-C string literals i.e.
Represents a parameter to a function.
PointerType - C99 6.7.5.1 - Pointer Declarators.
A (possibly-)qualified type.
QualType getDesugaredType(const ASTContext &Context) const
Return the specified type with any "sugar" removed from the type.
bool isNull() const
Return true if this QualType doesn't point to a type yet.
A trivial tuple used to represent a source range.
It represents a stack frame of the call stack (based on CallEvent).
StringLiteral - This represents a string literal expression, e.g.
bool isBlockPointerType() const
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
Represents a variable declaration or definition.
AllocaRegion - A region that represents an untyped blob of bytes created by a call to 'alloca'.
Definition MemRegion.h:506
void dumpToStream(raw_ostream &os) const override
static bool classof(const MemRegion *R)
Definition MemRegion.h:533
void Profile(llvm::FoldingSetNodeID &ID) const override
LLVM_ATTRIBUTE_RETURNS_NONNULL const Expr * getExpr() const
Definition MemRegion.h:525
bool isBoundable() const override
Definition MemRegion.h:527
friend class MemRegionManager
Definition MemRegion.h:507
BlockCodeRegion - A region that represents code texts of blocks (closures).
Definition MemRegion.h:659
QualType getLocationType() const override
Definition MemRegion.h:679
LLVM_ATTRIBUTE_RETURNS_NONNULL AnalysisDeclContext * getAnalysisDeclContext() const
Definition MemRegion.h:689
void dumpToStream(raw_ostream &os) const override
LLVM_ATTRIBUTE_RETURNS_NONNULL const BlockDecl * getDecl() const
Definition MemRegion.h:684
static bool classof(const MemRegion *R)
Definition MemRegion.h:695
void Profile(llvm::FoldingSetNodeID &ID) const override
friend class MemRegionManager
Definition MemRegion.h:660
bool operator==(const referenced_vars_iterator &I) const
Definition MemRegion.h:759
const referenced_vars_iterator & operator*() const
Definition MemRegion.h:778
bool operator!=(const referenced_vars_iterator &I) const
Definition MemRegion.h:764
LLVM_ATTRIBUTE_RETURNS_NONNULL const VarRegion * getCapturedRegion() const
Definition MemRegion.h:750
LLVM_ATTRIBUTE_RETURNS_NONNULL const VarRegion * getOriginalRegion() const
Definition MemRegion.h:755
referenced_vars_iterator & operator++()
Definition MemRegion.h:769
referenced_vars_iterator(const MemRegion *const *r, const MemRegion *const *originalR)
Definition MemRegion.h:745
BlockDataRegion - A region that represents a block instance.
Definition MemRegion.h:706
const VarRegion * getOriginalRegion(const VarRegion *VR) const
Return the original region for a captured region, if one exists.
QualType getLocationType() const override
Definition MemRegion.h:738
LLVM_ATTRIBUTE_RETURNS_NONNULL const BlockDecl * getDecl() const
Definition MemRegion.h:736
static bool classof(const MemRegion *R)
Definition MemRegion.h:793
referenced_vars_iterator referenced_vars_begin() const
LLVM_ATTRIBUTE_RETURNS_NONNULL const BlockCodeRegion * getCodeRegion() const
Definition MemRegion.h:733
void Profile(llvm::FoldingSetNodeID &ID) const override
referenced_vars_iterator referenced_vars_end() const
void dumpToStream(raw_ostream &os) const override
friend class MemRegionManager
Definition MemRegion.h:707
llvm::iterator_range< referenced_vars_iterator > referenced_vars() const
Definition MemRegion.h:1339
void printPrettyAsExpr(raw_ostream &os) const override
Print the region as expression.
LLVM_ATTRIBUTE_RETURNS_NONNULL const CXXRecordDecl * getDecl() const
Definition MemRegion.h:1355
bool canPrintPrettyAsExpr() const override
Returns true if this region's textual representation can be used as part of a larger expression.
void Profile(llvm::FoldingSetNodeID &ID) const override
static bool classof(const MemRegion *region)
Definition MemRegion.h:1368
bool isVirtual() const
Definition MemRegion.h:1356
void dumpToStream(raw_ostream &os) const override
friend class MemRegionManager
Definition MemRegion.h:1340
QualType getValueType() const override
Definition MemRegion.h:1378
void printPrettyAsExpr(raw_ostream &os) const override
Print the region as expression.
void Profile(llvm::FoldingSetNodeID &ID) const override
QualType getValueType() const override
void dumpToStream(raw_ostream &os) const override
static bool classof(const MemRegion *region)
Definition MemRegion.h:1410
bool canPrintPrettyAsExpr() const override
Returns true if this region's textual representation can be used as part of a larger expression.
friend class MemRegionManager
Definition MemRegion.h:1379
LLVM_ATTRIBUTE_RETURNS_NONNULL const CXXRecordDecl * getDecl() const
Definition MemRegion.h:1398
Definition MemRegion.h:1300
static bool classof(const MemRegion *R)
Definition MemRegion.h:1332
LLVM_ATTRIBUTE_RETURNS_NONNULL const Expr * getExpr() const
Definition MemRegion.h:1320
void Profile(llvm::FoldingSetNodeID &ID) const override
LLVM_ATTRIBUTE_RETURNS_NONNULL const ValueDecl * getExtendingDecl() const
Definition MemRegion.h:1322
void dumpToStream(raw_ostream &os) const override
const StackFrameContext * getStackFrame() const
It might return null.
friend class MemRegionManager
Definition MemRegion.h:1301
QualType getValueType() const override
Definition MemRegion.h:1326
Definition MemRegion.h:1266
QualType getValueType() const override
Definition MemRegion.h:1287
void Profile(llvm::FoldingSetNodeID &ID) const override
void dumpToStream(raw_ostream &os) const override
static bool classof(const MemRegion *R)
Definition MemRegion.h:1293
LLVM_ATTRIBUTE_RETURNS_NONNULL const Expr * getExpr() const
Definition MemRegion.h:1282
LLVM_ATTRIBUTE_RETURNS_NONNULL const StackFrameContext * getStackFrame() const
friend class MemRegionManager
Definition MemRegion.h:1267
CXXThisRegion - Represents the region for the implicit 'this' parameter in a call to a C++ method.
Definition MemRegion.h:1102
QualType getValueType() const override
Definition MemRegion.h:1120
static bool classof(const MemRegion *R)
Definition MemRegion.h:1126
void Profile(llvm::FoldingSetNodeID &ID) const override
void dumpToStream(raw_ostream &os) const override
friend class MemRegionManager
Definition MemRegion.h:1103
CodeSpaceRegion - The memory space that holds the executable code of functions and blocks.
Definition MemRegion.h:259
void dumpToStream(raw_ostream &os) const override
static bool classof(const MemRegion *R)
Definition MemRegion.h:268
friend class MemRegionManager
Definition MemRegion.h:260
Definition MemRegion.h:594
CodeTextRegion(const MemSpaceRegion *sreg, Kind k)
Definition MemRegion.h:598
static bool classof(const MemRegion *R)
Definition MemRegion.h:605
bool isBoundable() const override
Definition MemRegion.h:603
CompoundLiteralRegion - A memory region representing a compound literal.
Definition MemRegion.h:928
LLVM_ATTRIBUTE_RETURNS_NONNULL const CompoundLiteralExpr * getLiteralExpr() const
Definition MemRegion.h:955
QualType getValueType() const override
Definition MemRegion.h:946
bool isBoundable() const override
Definition MemRegion.h:948
void Profile(llvm::FoldingSetNodeID &ID) const override
void dumpToStream(raw_ostream &os) const override
friend class MemRegionManager
Definition MemRegion.h:929
static bool classof(const MemRegion *R)
Definition MemRegion.h:957
DeclRegion(const MemRegion *sReg, Kind k)
Definition MemRegion.h:964
virtual const ValueDecl * getDecl() const =0
static bool classof(const MemRegion *R)
Definition MemRegion.h:972
ElementRegion is used to represent both array elements and casts.
Definition MemRegion.h:1227
static bool classof(const MemRegion *R)
Definition MemRegion.h:1260
QualType getValueType() const override
Definition MemRegion.h:1249
QualType getElementType() const
Definition MemRegion.h:1251
void Profile(llvm::FoldingSetNodeID &ID) const override
NonLoc getIndex() const
Definition MemRegion.h:1247
RegionRawOffset getAsArrayOffset() const
Compute the offset within the array. The array might also be a subobject.
void dumpToStream(raw_ostream &os) const override
friend class MemRegionManager
Definition MemRegion.h:1228
Definition MemRegion.h:1134
void printPrettyAsExpr(raw_ostream &os) const override
Print the region as expression.
static bool classof(const MemRegion *R)
Definition MemRegion.h:1169
bool canPrintPretty() const override
Returns true if this region can be printed in a user-friendly way.
bool canPrintPrettyAsExpr() const override
Returns true if this region's textual representation can be used as part of a larger expression.
void dumpToStream(raw_ostream &os) const override
QualType getValueType() const override
Definition MemRegion.h:1157
void printPretty(raw_ostream &os) const override
Print the region for use in diagnostics.
void Profile(llvm::FoldingSetNodeID &ID) const override
LLVM_ATTRIBUTE_RETURNS_NONNULL const FieldDecl * getDecl() const override
Definition MemRegion.h:1153
friend class MemRegionManager
Definition MemRegion.h:1135
FunctionCodeRegion - A region that represents code texts of function.
Definition MemRegion.h:612
static bool classof(const MemRegion *R)
Definition MemRegion.h:648
QualType getLocationType() const override
Definition MemRegion.h:626
const NamedDecl * getDecl() const
Definition MemRegion.h:640
void dumpToStream(raw_ostream &os) const override
void Profile(llvm::FoldingSetNodeID &ID) const override
friend class MemRegionManager
Definition MemRegion.h:613
The region containing globals which are considered not to be modified or point to data which could be...
Definition MemRegion.h:360
void dumpToStream(raw_ostream &os) const override
static bool classof(const MemRegion *R)
Definition MemRegion.h:369
friend class MemRegionManager
Definition MemRegion.h:361
The region containing globals which can be modified by calls to "internally" defined functions - (for...
Definition MemRegion.h:377
void dumpToStream(raw_ostream &os) const override
static bool classof(const MemRegion *R)
Definition MemRegion.h:386
friend class MemRegionManager
Definition MemRegion.h:378
The region containing globals which are defined in system/external headers and are considered modifia...
Definition MemRegion.h:341
static bool classof(const MemRegion *R)
Definition MemRegion.h:350
void dumpToStream(raw_ostream &os) const override
friend class MemRegionManager
Definition MemRegion.h:342
Definition MemRegion.h:273
GlobalsSpaceRegion(MemRegionManager &mgr, Kind k)
Definition MemRegion.h:277
static bool classof(const MemRegion *R)
Definition MemRegion.h:282
Definition MemRegion.h:391
void dumpToStream(raw_ostream &os) const override
static bool classof(const MemRegion *R)
Definition MemRegion.h:400
friend class MemRegionManager
Definition MemRegion.h:392
Definition MemRegion.h:1432
const HeapSpaceRegion * getHeapRegion()
getHeapRegion - Retrieve the memory region associated with the generic "heap".
const StackArgumentsSpaceRegion * getStackArgumentsRegion(const StackFrameContext *STC)
getStackArgumentsRegion - Retrieve the memory region associated with function/method arguments of the...
const CXXThisRegion * getCXXThisRegion(QualType thisPointerTy, const LocationContext *LC)
getCXXThisRegion - Retrieve the [artificial] region associated with the parameter 'this'.
llvm::BumpPtrAllocator & getAllocator()
Definition MemRegion.h:1460
const FieldRegion * getFieldRegion(const FieldDecl *FD, const SubRegion *SuperRegion)
getFieldRegion - Retrieve or create the memory region associated with a specified FieldDecl.
const BlockCodeRegion * getBlockCodeRegion(const BlockDecl *BD, CanQualType locTy, AnalysisDeclContext *AC)
const ASTContext & getContext() const
Definition MemRegion.h:1458
const UnknownSpaceRegion * getUnknownRegion()
getUnknownRegion - Retrieve the memory region associated with unknown memory space.
const CXXDerivedObjectRegion * getCXXDerivedObjectRegion(const CXXRecordDecl *BaseClass, const SubRegion *Super)
Create a CXXDerivedObjectRegion with the given derived class for region Super.
const CompoundLiteralRegion * getCompoundLiteralRegion(const CompoundLiteralExpr *CL, const LocationContext *LC)
getCompoundLiteralRegion - Retrieve the region associated with a given CompoundLiteral.
const AllocaRegion * getAllocaRegion(const Expr *Ex, unsigned Cnt, const LocationContext *LC)
getAllocaRegion - Retrieve a region associated with a call to alloca().
const ElementRegion * getElementRegion(QualType elementType, NonLoc Idx, const SubRegion *superRegion, const ASTContext &Ctx)
getElementRegion - Retrieve the memory region associated with the associated element type,...
const VarRegion * getVarRegion(const VarDecl *VD, const LocationContext *LC)
getVarRegion - Retrieve or create the memory region associated with a specified VarDecl and LocationC...
const NonParamVarRegion * getNonParamVarRegion(const VarDecl *VD, const MemRegion *superR)
getVarRegion - Retrieve or create the memory region associated with a specified VarDecl and LocationC...
const FieldRegion * getFieldRegionWithSuper(const FieldRegion *FR, const SubRegion *superRegion)
Definition MemRegion.h:1554
const StackLocalsSpaceRegion * getStackLocalsRegion(const StackFrameContext *STC)
getStackLocalsRegion - Retrieve the memory region associated with the specified stack frame.
const ObjCIvarRegion * getObjCIvarRegion(const ObjCIvarDecl *ivd, const SubRegion *superRegion)
getObjCIvarRegion - Retrieve or create the memory region associated with a specified Objective-c inst...
const SymbolicRegion * getSymbolicHeapRegion(SymbolRef sym)
Return a unique symbolic region belonging to heap memory space.
const ObjCStringRegion * getObjCStringRegion(const ObjCStringLiteral *Str)
MemRegionManager(ASTContext &c, llvm::BumpPtrAllocator &a)
Definition MemRegion.h:1454
const StringRegion * getStringRegion(const StringLiteral *Str)
ASTContext & getContext()
Definition MemRegion.h:1457
DefinedOrUnknownSVal getStaticSize(const MemRegion *MR, SValBuilder &SVB) const
const ParamVarRegion * getParamVarRegion(const Expr *OriginExpr, unsigned Index, const LocationContext *LC)
getParamVarRegion - Retrieve or create the memory region associated with a specified CallExpr,...
const CodeSpaceRegion * getCodeRegion()
const CXXLifetimeExtendedObjectRegion * getCXXLifetimeExtendedObjectRegion(Expr const *Ex, ValueDecl const *VD, LocationContext const *LC)
Create a CXXLifetimeExtendedObjectRegion for temporaries which are lifetime-extended by local referen...
const CXXTempObjectRegion * getCXXTempObjectRegion(Expr const *Ex, LocationContext const *LC)
const GlobalsSpaceRegion * getGlobalsRegion(MemRegion::Kind K=MemRegion::GlobalInternalSpaceRegionKind, const CodeTextRegion *R=nullptr)
getGlobalsRegion - Retrieve the memory region associated with global variables.
const SymbolicRegion * getSymbolicRegion(SymbolRef Sym, const MemSpaceRegion *MemSpace=nullptr)
Retrieve or create a "symbolic" memory region.
const ElementRegion * getElementRegionWithSuper(const ElementRegion *ER, const SubRegion *superRegion)
Definition MemRegion.h:1541
const FunctionCodeRegion * getFunctionCodeRegion(const NamedDecl *FD)
const BlockDataRegion * getBlockDataRegion(const BlockCodeRegion *bc, const LocationContext *lc, unsigned blockCount)
getBlockDataRegion - Get the memory region associated with an instance of a block.
const CXXBaseObjectRegion * getCXXBaseObjectRegion(const CXXRecordDecl *BaseClass, const SubRegion *Super, bool IsVirtual)
Create a CXXBaseObjectRegion with the given base class for region Super.
const CXXLifetimeExtendedObjectRegion * getCXXStaticLifetimeExtendedObjectRegion(const Expr *Ex, ValueDecl const *VD)
Create a CXXLifetimeExtendedObjectRegion for temporaries which are lifetime-extended by static refere...
const CXXBaseObjectRegion * getCXXBaseObjectRegionWithSuper(const CXXBaseObjectRegion *baseReg, const SubRegion *superRegion)
Create a CXXBaseObjectRegion with the same CXXRecordDecl but a different super region.
Definition MemRegion.h:1593
MemRegion - The root abstract class for all memory regions.
Definition MemRegion.h:98
virtual bool canPrintPrettyAsExpr() const
Returns true if this region's textual representation can be used as part of a larger expression.
virtual void Profile(llvm::FoldingSetNodeID &ID) const =0
LLVM_ATTRIBUTE_RETURNS_NONNULL const RegionTy * castAs() const
Definition MemRegion.h:1424
MemRegion(Kind k)
Definition MemRegion.h:113
const MemSpace * getMemorySpaceAs(ProgramStateRef State) const
Definition MemRegion.h:143
virtual bool isBoundable() const
Definition MemRegion.h:211
StringRef getKindStr() const
RegionOffset getAsOffset() const
Compute the offset within the top level memory object.
LLVM_ATTRIBUTE_RETURNS_NONNULL const MemRegion * StripCasts(bool StripBaseAndDerivedCasts=true) const
bool hasMemorySpace(ProgramStateRef State) const
Definition MemRegion.h:148
const MemSpace * getRawMemorySpaceAs() const
Deprecated. Use getMemorySpace(ProgramStateRef) instead.
Definition MemRegion.h:132
ProgramStateRef setMemorySpace(ProgramStateRef State, const MemSpaceRegion *Space) const
Set the dynamically deduced memory space of a MemRegion that currently has UnknownSpaceRegion.
ASTContext & getContext() const
Definition MemRegion.h:1648
LLVM_ATTRIBUTE_RETURNS_NONNULL const MemSpaceRegion * getMemorySpace(ProgramStateRef State) const
Returns the most specific memory space for this memory region in the given ProgramStateRef.
Kind
Definition MemRegion.h:100
std::string getDescriptiveName(bool UseQuotes=true) const
Get descriptive name for memory region.
virtual bool isSubRegionOf(const MemRegion *R) const
Check if the region is a subregion of the given region.
virtual void dumpToStream(raw_ostream &os) const
const SymbolicRegion * getSymbolicBase() const
If this is a symbolic region, returns the region.
LLVM_ATTRIBUTE_RETURNS_NONNULL const MemRegion * getBaseRegion() const
virtual void printPretty(raw_ostream &os) const
Print the region for use in diagnostics.
virtual void printPrettyAsExpr(raw_ostream &os) const
Print the region as expression.
std::string getString() const
Get a string representation of a region for debug use.
const RegionTy * getAs() const
Definition MemRegion.h:1416
Kind getKind() const
Definition MemRegion.h:203
LLVM_ATTRIBUTE_RETURNS_NONNULL const MemRegion * getMostDerivedObjectRegion() const
Recursively retrieve the region of the most derived class instance of regions of C++ base class insta...
LLVM_ATTRIBUTE_RETURNS_NONNULL const MemSpaceRegion * getRawMemorySpace() const
Deprecated.
virtual MemRegionManager & getMemRegionManager() const =0
virtual bool canPrintPretty() const
Returns true if this region can be printed in a user-friendly way.
SourceRange sourceRange() const
Retrieve source range from memory region.
MemSpaceRegion - A memory region that represents a "memory space"; for example, the set of global var...
Definition MemRegion.h:236
MemRegionManager & getMemRegionManager() const override
Definition MemRegion.h:244
static bool classof(const MemRegion *R)
Definition MemRegion.h:251
void Profile(llvm::FoldingSetNodeID &ID) const override
MemRegionManager & Mgr
Definition MemRegion.h:238
bool isBoundable() const override
Definition MemRegion.h:247
MemSpaceRegion(MemRegionManager &mgr, Kind k)
Definition MemRegion.h:240
Definition MemRegion.h:1010
QualType getValueType() const override
Definition MemRegion.h:1036
bool canPrintPrettyAsExpr() const override
Returns true if this region's textual representation can be used as part of a larger expression.
void Profile(llvm::FoldingSetNodeID &ID) const override
void printPrettyAsExpr(raw_ostream &os) const override
Print the region as expression.
void dumpToStream(raw_ostream &os) const override
LLVM_ATTRIBUTE_RETURNS_NONNULL const VarDecl * getDecl() const override
Definition MemRegion.h:1034
friend class MemRegionManager
Definition MemRegion.h:1011
static bool classof(const MemRegion *R)
Definition MemRegion.h:1047
NonStaticGlobalSpaceRegion(MemRegionManager &mgr, Kind k)
Definition MemRegion.h:326
static bool classof(const MemRegion *R)
Definition MemRegion.h:332
Definition MemRegion.h:1174
bool canPrintPrettyAsExpr() const override
Returns true if this region's textual representation can be used as part of a larger expression.
void Profile(llvm::FoldingSetNodeID &ID) const override
QualType getValueType() const override
static bool classof(const MemRegion *R)
Definition MemRegion.h:1197
void printPrettyAsExpr(raw_ostream &os) const override
Print the region as expression.
LLVM_ATTRIBUTE_RETURNS_NONNULL const ObjCIvarDecl * getDecl() const override
friend class MemRegionManager
Definition MemRegion.h:1175
void dumpToStream(raw_ostream &os) const override
The region associated with an ObjCStringLiteral.
Definition MemRegion.h:891
QualType getValueType() const override
Definition MemRegion.h:910
bool isBoundable() const override
Definition MemRegion.h:912
void dumpToStream(raw_ostream &os) const override
static bool classof(const MemRegion *R)
Definition MemRegion.h:920
LLVM_ATTRIBUTE_RETURNS_NONNULL const ObjCStringLiteral * getObjCStringLiteral() const
Definition MemRegion.h:908
void Profile(llvm::FoldingSetNodeID &ID) const override
Definition MemRegion.h:914
friend class MemRegionManager
Definition MemRegion.h:892
ParamVarRegion - Represents a region for parameters.
Definition MemRegion.h:1062
bool canPrintPrettyAsExpr() const override
Returns true if this region's textual representation can be used as part of a larger expression.
LLVM_ATTRIBUTE_RETURNS_NONNULL const Expr * getOriginExpr() const
Definition MemRegion.h:1079
static bool classof(const MemRegion *R)
Definition MemRegion.h:1094
const ParmVarDecl * getDecl() const override
TODO: What does this return?
unsigned getIndex() const
Definition MemRegion.h:1080
void Profile(llvm::FoldingSetNodeID &ID) const override
QualType getValueType() const override
friend class MemRegionManager
Definition MemRegion.h:1063
void dumpToStream(raw_ostream &os) const override
void printPrettyAsExpr(raw_ostream &os) const override
Print the region as expression.
Information about invalidation for a particular region/symbol.
Definition MemRegion.h:1657
InvalidationKinds
Describes different invalidation traits.
Definition MemRegion.h:1670
@ TK_PreserveContents
Tells that a region's contents is not changed.
Definition MemRegion.h:1672
@ TK_DoNotInvalidateSuperRegion
Definition MemRegion.h:1678
@ TK_EntireMemSpace
When applied to a MemSpaceRegion, indicates the entire memory space should be invalidated.
Definition MemRegion.h:1682
@ TK_SuppressEscape
Suppress pointer-escaping of a region.
Definition MemRegion.h:1675
bool hasTrait(SymbolRef Sym, InvalidationKinds IK) const
void setTrait(SymbolRef Sym, InvalidationKinds IK)
Represent a region's offset within the top level base region.
Definition MemRegion.h:65
static const int64_t Symbolic
Definition MemRegion.h:75
bool hasSymbolicOffset() const
Definition MemRegion.h:83
const MemRegion * getRegion() const
It might return null.
Definition MemRegion.h:81
RegionOffset(const MemRegion *r, int64_t off)
Definition MemRegion.h:78
int64_t getOffset() const
Definition MemRegion.h:85
bool isValid() const
Definition MemRegion.h:90
Definition MemRegion.h:1206
CharUnits getOffset() const
Definition MemRegion.h:1217
void dumpToStream(raw_ostream &os) const
friend class ElementRegion
Definition MemRegion.h:1207
const MemRegion * getRegion() const
Definition MemRegion.h:1220
SVal - This represents a symbolic expression, which can be either an L-value or an R-value.
T castAs() const
Convert to the specified SVal type, asserting that this SVal is of the desired type.
Definition MemRegion.h:457
static bool classof(const MemRegion *R)
Definition MemRegion.h:467
void dumpToStream(raw_ostream &os) const override
friend class MemRegionManager
Definition MemRegion.h:459
Definition MemRegion.h:443
static bool classof(const MemRegion *R)
Definition MemRegion.h:452
void dumpToStream(raw_ostream &os) const override
friend class MemRegionManager
Definition MemRegion.h:444
StackSpaceRegion(MemRegionManager &mgr, Kind k, const StackFrameContext *sfc)
Definition MemRegion.h:425
static bool classof(const MemRegion *R)
Definition MemRegion.h:437
LLVM_ATTRIBUTE_RETURNS_NONNULL const StackFrameContext * getStackFrame() const
Definition MemRegion.h:433
void Profile(llvm::FoldingSetNodeID &ID) const override
void Profile(llvm::FoldingSetNodeID &ID) const override
static bool classof(const MemRegion *R)
Definition MemRegion.h:311
void dumpToStream(raw_ostream &os) const override
LLVM_ATTRIBUTE_RETURNS_NONNULL const CodeTextRegion * getCodeRegion() const
Definition MemRegion.h:309
friend class MemRegionManager
Definition MemRegion.h:294
StringRegion - Region associated with a StringLiteral.
Definition MemRegion.h:857
static bool classof(const MemRegion *R)
Definition MemRegion.h:885
QualType getValueType() const override
Definition MemRegion.h:875
void Profile(llvm::FoldingSetNodeID &ID) const override
Definition MemRegion.h:879
bool isBoundable() const override
Definition MemRegion.h:877
void dumpToStream(raw_ostream &os) const override
LLVM_ATTRIBUTE_RETURNS_NONNULL const StringLiteral * getStringLiteral() const
Definition MemRegion.h:873
friend class MemRegionManager
Definition MemRegion.h:858
SubRegion - A region that subsets another larger region.
Definition MemRegion.h:474
LLVM_ATTRIBUTE_RETURNS_NONNULL const MemRegion * getSuperRegion() const
Definition MemRegion.h:487
static bool classof(const MemRegion *R)
Definition MemRegion.h:495
bool isSubRegionOf(const MemRegion *R) const override
Check if the region is a subregion of the given region.
SubRegion(const MemRegion *sReg, Kind k)
Definition MemRegion.h:480
const MemRegion * superRegion
Definition MemRegion.h:478
MemRegionManager & getMemRegionManager() const override
SymbolicRegion - A special, "non-concrete" region.
Definition MemRegion.h:808
void dumpToStream(raw_ostream &os) const override
static bool classof(const MemRegion *R)
Definition MemRegion.h:851
bool isBoundable() const override
Definition MemRegion.h:841
void Profile(llvm::FoldingSetNodeID &ID) const override
SymbolRef getSymbol() const
It might return null.
Definition MemRegion.h:827
static void ProfileRegion(llvm::FoldingSetNodeID &ID, SymbolRef sym, const MemRegion *superRegion)
friend class MemRegionManager
Definition MemRegion.h:809
QualType getPointeeStaticType() const
Gets the type of the wrapped symbol.
Definition MemRegion.h:837
QualType getDesugaredLocationType(ASTContext &Context) const
Definition MemRegion.h:550
bool isBoundable() const override
Definition MemRegion.h:554
virtual QualType getLocationType() const =0
TypedRegion(const MemRegion *sReg, Kind k)
Definition MemRegion.h:543
static bool classof(const MemRegion *R)
Definition MemRegion.h:556
virtual QualType getValueType() const =0
QualType getLocationType() const override
Definition MemRegion.h:574
static bool classof(const MemRegion *R)
Definition MemRegion.h:588
QualType getDesugaredValueType(ASTContext &Context) const
Definition MemRegion.h:583
TypedValueRegion(const MemRegion *sReg, Kind k)
Definition MemRegion.h:567
Definition MemRegion.h:405
void dumpToStream(raw_ostream &os) const override
static bool classof(const MemRegion *R)
Definition MemRegion.h:414
friend class MemRegionManager
Definition MemRegion.h:406
Definition MemRegion.h:978
QualType getValueType() const override
Definition MemRegion.h:999
const VarDecl * getDecl() const override=0
const StackFrameContext * getStackFrame() const
It might return null.
VarRegion(const MemRegion *sReg, Kind k)
Definition MemRegion.h:983
static bool classof(const MemRegion *R)
Definition MemRegion.h:1004
friend class MemRegionManager
Definition MemRegion.h:979
Value representing integer constant.
APSIntPtr getValue() const
IntrusiveRefCntPtr< const ProgramState > ProgramStateRef
const SymExpr * SymbolRef
raw_ostream & operator<<(raw_ostream &os, const MemRegion *R)
Definition MemRegion.h:1697
The JSON file list parser is used to communicate input to InstallAPI.
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
bool isa(CodeGen::Address addr)
const FunctionProtoType * T
U cast(CodeGen::Address addr)