Skip to content

Commit 7fb4406

Browse files
committed
---
yaml --- r: 323539 b: refs/heads/tensorflow-next c: fcdb6db h: refs/heads/master i: 323537: bee9b6f 323535: abb8172
1 parent ac976d7 commit 7fb4406

File tree

6 files changed

+90
-121
lines changed

6 files changed

+90
-121
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1461,4 +1461,4 @@ refs/heads/master-rebranch: 86e95c23aa0d37f24ec138b7853146c1cead2e40
14611461
refs/heads/rdar-53901732: 9bd06af3284e18a109cdbf9aa59d833b24eeca7b
14621462
refs/heads/revert-26776-subst-always-returns-a-type: 1b8e18fdd391903a348970a4c848995d4cdd789c
14631463
refs/heads/tensorflow-merge: 8b854f62f80d4476cb383d43c4aac2001dde3cec
1464-
refs/heads/tensorflow-next: 55806395fbde12af4e64647c4e90bc549465575c
1464+
refs/heads/tensorflow-next: fcdb6dbaca3342336f23a1a29aa1f3c9bd533210

branches/tensorflow-next/include/swift/AST/AccessRequests.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ class ValueDecl;
3232
/// Request the AccessLevel of the given ValueDecl.
3333
class AccessLevelRequest :
3434
public SimpleRequest<AccessLevelRequest,
35-
CacheKind::SeparatelyCached,
36-
AccessLevel,
37-
ValueDecl *> {
35+
AccessLevel(ValueDecl *),
36+
CacheKind::SeparatelyCached> {
3837
public:
3938
using SimpleRequest::SimpleRequest;
4039

@@ -61,9 +60,8 @@ class AccessLevelRequest :
6160
/// the accessibility of mutating accessors.
6261
class SetterAccessLevelRequest :
6362
public SimpleRequest<SetterAccessLevelRequest,
64-
CacheKind::SeparatelyCached,
65-
AccessLevel,
66-
AbstractStorageDecl *> {
63+
AccessLevel(AbstractStorageDecl *),
64+
CacheKind::SeparatelyCached> {
6765
public:
6866
using SimpleRequest::SimpleRequest;
6967

@@ -88,9 +86,8 @@ class SetterAccessLevelRequest :
8886
/// Request the Default and Max AccessLevels of the given ExtensionDecl.
8987
class DefaultAndMaxAccessLevelRequest :
9088
public SimpleRequest<DefaultAndMaxAccessLevelRequest,
91-
CacheKind::SeparatelyCached,
92-
std::pair<AccessLevel, AccessLevel>,
93-
ExtensionDecl *> {
89+
std::pair<AccessLevel, AccessLevel>(ExtensionDecl *),
90+
CacheKind::SeparatelyCached> {
9491
public:
9592
using SimpleRequest::SimpleRequest;
9693
using DefaultAndMax = std::pair<AccessLevel, AccessLevel>;

branches/tensorflow-next/include/swift/AST/NameLookupRequests.h

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ using DirectlyReferencedTypeDecls = llvm::TinyPtrVector<TypeDecl *>;
5656
/// The inherited declaration of \c D at index 1 is the typealias Alias.
5757
class InheritedDeclsReferencedRequest :
5858
public SimpleRequest<InheritedDeclsReferencedRequest,
59-
CacheKind::Uncached, // FIXME: Cache these
60-
DirectlyReferencedTypeDecls,
61-
llvm::PointerUnion<TypeDecl *, ExtensionDecl *>,
62-
unsigned>
59+
DirectlyReferencedTypeDecls(
60+
llvm::PointerUnion<TypeDecl *, ExtensionDecl *>,
61+
unsigned),
62+
CacheKind::Uncached> // FIXME: Cache these
6363
{
6464
/// Retrieve the TypeLoc for this inherited type.
6565
TypeLoc &getTypeLoc(llvm::PointerUnion<TypeDecl *, ExtensionDecl *> decl,
@@ -107,9 +107,8 @@ class InheritedDeclsReferencedRequest :
107107
/// using another instance of this request.
108108
class UnderlyingTypeDeclsReferencedRequest :
109109
public SimpleRequest<UnderlyingTypeDeclsReferencedRequest,
110-
CacheKind::Uncached, // FIXME: Cache these
111-
DirectlyReferencedTypeDecls,
112-
TypeAliasDecl *>
110+
DirectlyReferencedTypeDecls(TypeAliasDecl *),
111+
CacheKind::Uncached> // FIXME: Cache these
113112
{
114113
public:
115114
using SimpleRequest::SimpleRequest;
@@ -134,9 +133,8 @@ class UnderlyingTypeDeclsReferencedRequest :
134133
/// Request the superclass declaration for the given class.
135134
class SuperclassDeclRequest :
136135
public SimpleRequest<SuperclassDeclRequest,
137-
CacheKind::SeparatelyCached,
138-
ClassDecl *,
139-
NominalTypeDecl *> {
136+
ClassDecl *(NominalTypeDecl *),
137+
CacheKind::SeparatelyCached> {
140138
public:
141139
using SimpleRequest::SimpleRequest;
142140

@@ -161,9 +159,8 @@ class SuperclassDeclRequest :
161159
/// Request the nominal declaration extended by a given extension declaration.
162160
class ExtendedNominalRequest :
163161
public SimpleRequest<ExtendedNominalRequest,
164-
CacheKind::SeparatelyCached,
165-
NominalTypeDecl *,
166-
ExtensionDecl *> {
162+
NominalTypeDecl *(ExtensionDecl *),
163+
CacheKind::SeparatelyCached> {
167164
public:
168165
using SimpleRequest::SimpleRequest;
169166

@@ -194,9 +191,9 @@ struct SelfBounds {
194191
/// constraints in the "where" clause of a protocol extension.
195192
class SelfBoundsFromWhereClauseRequest :
196193
public SimpleRequest<SelfBoundsFromWhereClauseRequest,
197-
CacheKind::Uncached,
198-
SelfBounds,
199-
llvm::PointerUnion<TypeDecl *, ExtensionDecl *>> {
194+
SelfBounds(llvm::PointerUnion<TypeDecl *,
195+
ExtensionDecl *>),
196+
CacheKind::Uncached> {
200197
public:
201198
using SimpleRequest::SimpleRequest;
202199

@@ -219,9 +216,8 @@ class SelfBoundsFromWhereClauseRequest :
219216
/// clause of an extension.
220217
class TypeDeclsFromWhereClauseRequest :
221218
public SimpleRequest<TypeDeclsFromWhereClauseRequest,
222-
CacheKind::Uncached,
223-
DirectlyReferencedTypeDecls,
224-
ExtensionDecl *> {
219+
DirectlyReferencedTypeDecls(ExtensionDecl *),
220+
CacheKind::Uncached> {
225221
public:
226222
using SimpleRequest::SimpleRequest;
227223

@@ -243,10 +239,8 @@ class TypeDeclsFromWhereClauseRequest :
243239
/// refers.
244240
class CustomAttrNominalRequest :
245241
public SimpleRequest<CustomAttrNominalRequest,
246-
CacheKind::Cached,
247-
NominalTypeDecl *,
248-
CustomAttr *,
249-
DeclContext *> {
242+
NominalTypeDecl *(CustomAttr *, DeclContext *),
243+
CacheKind::Cached> {
250244
public:
251245
using SimpleRequest::SimpleRequest;
252246

branches/tensorflow-next/include/swift/AST/SimpleRequest.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,10 @@ enum class CacheKind {
4747
/// the given type.
4848
///
4949
/// \tparam Derived The final, derived class type for the request.
50+
/// \tparam Signature The signature of the request, described as a
51+
/// function type whose inputs (\c Inputs) are the parameter types and
52+
/// whose output (\c Output) is the result of evaluating this request.
5053
/// \tparam Caching Describes how the output value is cached, if at all.
51-
/// \tparam Output The type of the result produced by evaluating this request.
52-
/// \tparam Inputs The types of the inputs to this request, i.e., the values
53-
/// that comprise the request itself. These will determine the uniqueness of
54-
/// the request.
5554
///
5655
/// The \c Derived class needs to implement several operations. The most
5756
/// important one takes an evaluator and the input values, then computes the
@@ -84,9 +83,12 @@ enum class CacheKind {
8483
/// Optional<Output> getCachedResult() const;
8584
/// void cacheResult(Output value) const;
8685
/// \endcode
86+
template<typename Derived, typename Signature, CacheKind Caching>
87+
class SimpleRequest;
88+
8789
template<typename Derived, CacheKind Caching, typename Output,
8890
typename ...Inputs>
89-
class SimpleRequest {
91+
class SimpleRequest<Derived, Output(Inputs...), Caching> {
9092
std::tuple<Inputs...> storage;
9193

9294
Derived &asDerived() {

0 commit comments

Comments
 (0)