@@ -36,12 +36,23 @@ class Evaluator;
36
36
enum class RequestFlags {
37
37
// / The result for a particular request should never be cached.
38
38
Uncached = 1 << 0 ,
39
+
39
40
// / The result for a particular request should be cached within the
40
41
// / evaluator itself.
41
42
Cached = 1 << 1 ,
43
+
42
44
// / The result of a particular request will be cached via some separate
43
45
// / mechanism, such as a mutable data structure.
44
46
SeparatelyCached = 1 << 2 ,
47
+
48
+ // / The result is separately cached, but the request can also make use
49
+ // / of the request evaluator's cache for out-of-line storage. This
50
+ // / is used to optimize caching of requests where the usual case is
51
+ // / that the value is empty. In this case, the separate mechanism
52
+ // / can represent the empty state more efficiently than adding a new
53
+ // / entry to the request evaluator's cache.
54
+ SplitCached = 1 << 3 ,
55
+
45
56
// / This request introduces the source component of a source-sink
46
57
// / incremental dependency pair and defines a new dependency scope.
47
58
// /
@@ -50,7 +61,7 @@ enum class RequestFlags {
50
61
// /
51
62
// / For further discussion on incremental dependencies
52
63
// / see DependencyAnalysis.md.
53
- DependencySource = 1 << 3 ,
64
+ DependencySource = 1 << 4 ,
54
65
// / This request introduces the sink component of a source-sink
55
66
// / incremental dependency pair and is a consumer of the current
56
67
// / dependency scope.
@@ -60,7 +71,7 @@ enum class RequestFlags {
60
71
// /
61
72
// / For further discussion on incremental dependencies
62
73
// / see DependencyAnalysis.md.
63
- DependencySink = 1 << 4 ,
74
+ DependencySink = 1 << 5 ,
64
75
};
65
76
66
77
static constexpr inline RequestFlags operator |(RequestFlags lhs, RequestFlags rhs) {
@@ -167,6 +178,10 @@ constexpr bool hasExternalCache(RequestFlags kind) {
167
178
return cacheContains (kind, RequestFlags::SeparatelyCached);
168
179
}
169
180
181
+ constexpr bool hasSplitCache (RequestFlags kind) {
182
+ return cacheContains (kind, RequestFlags::SplitCached);
183
+ }
184
+
170
185
constexpr bool isDependencySource (RequestFlags kind) {
171
186
return cacheContains (kind, RequestFlags::DependencySource);
172
187
}
@@ -279,6 +294,7 @@ class SimpleRequest<Derived, Output(Inputs...), Caching> {
279
294
public:
280
295
constexpr static bool isEverCached = detail::isEverCached(Caching);
281
296
constexpr static bool hasExternalCache = detail::hasExternalCache(Caching);
297
+ constexpr static bool hasSplitCache = detail::hasSplitCache(Caching);
282
298
283
299
public:
284
300
constexpr static bool isDependencySource = detail::isDependencySource(Caching);
0 commit comments