|
22 | 22 | using swift::RetainObserveKind;
|
23 | 23 |
|
24 | 24 | namespace {
|
25 |
| - /// A cache for AliasAnalysis. |
26 |
| - /// This struct represents the argument list to the method 'alias'. |
27 |
| - /// The two SILValue pointers are mapped to size_t indices because we need |
28 |
| - /// an efficient way to invalidate them (the mechanism is described below). |
29 |
| - /// The Type arguments are translated to void* because their |
30 |
| - /// underlying storage is opaque pointers that never goes away. |
| 25 | +/// A key used for the AliasAnalysis cache. |
| 26 | +/// |
| 27 | +/// This struct represents the argument list to the method 'alias'. The two |
| 28 | +/// SILValue pointers are mapped to size_t indices because we need an |
| 29 | +/// efficient way to invalidate them (the mechanism is described below). The |
| 30 | +/// Type arguments are translated to void* because their underlying storage is |
| 31 | +/// opaque pointers that never goes away. |
31 | 32 | struct AliasKeyTy {
|
32 | 33 | // The SILValue pair:
|
33 | 34 | size_t V1, V2;
|
34 | 35 | // The TBAAType pair:
|
35 | 36 | void *T1, *T2;
|
36 | 37 | };
|
37 | 38 |
|
38 |
| - /// A cache for MemoryBehavior Analysis. |
39 |
| - /// The two SILValue pointers are mapped to size_t indices because we need |
40 |
| - /// an efficient way to invalidate them (the mechanism is described below). |
41 |
| - /// The RetainObserveKind represents the inspection mode for the memory |
42 |
| - /// behavior analysis. |
| 39 | + /// A key used for for the MemoryBehavior Analysis cache. |
| 40 | + /// |
| 41 | + /// The two SILValue pointers are mapped to size_t indices because we need an |
| 42 | + /// efficient way to invalidate them (the mechanism is described below). The |
| 43 | + /// RetainObserveKind represents the inspection mode for the memory behavior |
| 44 | + /// analysis. |
43 | 45 | struct MemBehaviorKeyTy {
|
44 | 46 | // The SILValue pair:
|
45 | 47 | size_t V1, V2;
|
@@ -100,11 +102,13 @@ class AliasAnalysis : public SILAnalysis {
|
100 | 102 | llvm::DenseMap<TBAACacheKey, bool> TypesMayAliasCache;
|
101 | 103 |
|
102 | 104 | /// AliasAnalysis value cache.
|
| 105 | + /// |
103 | 106 | /// The alias() method uses this map to cache queries.
|
104 | 107 | llvm::DenseMap<AliasKeyTy, AliasResult> AliasCache;
|
105 | 108 |
|
106 | 109 | using MemoryBehavior = SILInstruction::MemoryBehavior;
|
107 | 110 | /// MemoryBehavior value cache.
|
| 111 | + /// |
108 | 112 | /// The computeMemoryBehavior() method uses this map to cache queries.
|
109 | 113 | llvm::DenseMap<MemBehaviorKeyTy, MemoryBehavior> MemoryBehaviorCache;
|
110 | 114 |
|
|
0 commit comments