Skip to content

Commit 18e997c

Browse files
authored
---
yaml --- r: 349079 b: refs/heads/master c: e7ab752 h: refs/heads/master i: 349077: e7fee9f 349075: e6609fd 349071: 5445fdf
1 parent 80cd87f commit 18e997c

26 files changed

+234
-335
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: ff4f234333575fb948c2b29e4a7d4cf3fe64218b
2+
refs/heads/master: e7ab7529b9f07b5d96b758d5f982219be9d2b52a
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ endif()
1111
list(APPEND CMAKE_MODULE_PATH
1212
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
1313

14+
set(CMAKE_DISABLE_IN_SOURCE_BUILD YES)
15+
1416
if(DEFINED CMAKE_JOB_POOLS)
1517
# CMake < 3.11 doesn't support CMAKE_JOB_POOLS. Manually set the property.
1618
set_property(GLOBAL PROPERTY JOB_POOLS "${CMAKE_JOB_POOLS}")

trunk/include/swift/AST/Decl.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2978,9 +2978,6 @@ class TypeAliasDecl : public GenericTypeDecl {
29782978
/// Retrieve a sugared interface type containing the structure of the interface
29792979
/// type before any semantic validation has occured.
29802980
Type getStructuralType() const;
2981-
2982-
/// Set the interface type of this typealias declaration from the underlying type.
2983-
void computeType();
29842981

29852982
bool isCompatibilityAlias() const {
29862983
return Bits.TypeAliasDecl.IsCompatibilityAlias;
@@ -3169,10 +3166,6 @@ class AssociatedTypeDecl : public AbstractTypeParamDecl {
31693166
TrailingWhere = trailingWhereClause;
31703167
}
31713168

3172-
/// Set the interface type of this associated type declaration to a dependent
3173-
/// member type of 'Self'.
3174-
void computeType();
3175-
31763169
/// Retrieve the associated type "anchor", which is the associated type
31773170
/// declaration that will be used to describe this associated type in the
31783171
/// ABI.
@@ -3362,10 +3355,6 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
33623355
Bits.NominalTypeDecl.AddedImplicitInitializers = true;
33633356
}
33643357

3365-
/// Set the interface type of this nominal type to the metatype of the
3366-
/// declared interface type.
3367-
void computeType();
3368-
33693358
/// getDeclaredType - Retrieve the type declared by this entity, without
33703359
/// any generic parameters bound if this is a generic type.
33713360
Type getDeclaredType() const;
@@ -5484,10 +5473,6 @@ class SubscriptDecl : public GenericContext, public AbstractStorageDecl {
54845473
TypeLoc &getElementTypeLoc() { return ElementTy; }
54855474
const TypeLoc &getElementTypeLoc() const { return ElementTy; }
54865475

5487-
/// Compute the interface type of this subscript from the parameter and
5488-
/// element types.
5489-
void computeType();
5490-
54915476
/// Determine the kind of Objective-C subscripting this declaration
54925477
/// implies.
54935478
ObjCSubscriptKind getObjCSubscriptKind() const;
@@ -6358,10 +6343,6 @@ class EnumElementDecl : public DeclContext, public ValueDecl {
63586343
return hasName() ? getBaseName().getIdentifier().str() : "_";
63596344
}
63606345

6361-
/// Set the interface type of this enum element to the constructor function
6362-
/// type; (Self.Type) -> Self or (Self.Type) -> (Args...) -> Self.
6363-
void computeType();
6364-
63656346
Type getArgumentInterfaceType() const;
63666347

63676348
void setParameterList(ParameterList *params);

trunk/include/swift/AST/TypeCheckRequests.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,6 +1362,29 @@ class ParamSpecifierRequest
13621362
void cacheResult(ParamSpecifier value) const;
13631363
};
13641364

1365+
/// Determines the result type of a function or element type of a subscript.
1366+
class ResultTypeRequest
1367+
: public SimpleRequest<ResultTypeRequest,
1368+
Type(ValueDecl *),
1369+
CacheKind::SeparatelyCached> {
1370+
public:
1371+
using SimpleRequest::SimpleRequest;
1372+
1373+
private:
1374+
friend SimpleRequest;
1375+
1376+
TypeLoc &getResultTypeLoc() const;
1377+
1378+
// Evaluation.
1379+
llvm::Expected<Type> evaluate(Evaluator &evaluator, ValueDecl *decl) const;
1380+
1381+
public:
1382+
// Separate caching.
1383+
bool isCached() const { return true; }
1384+
Optional<Type> getCachedResult() const;
1385+
void cacheResult(Type value) const;
1386+
};
1387+
13651388
// Allow AnyValue to compare two Type values, even though Type doesn't
13661389
// support ==.
13671390
template<>

trunk/include/swift/AST/TypeCheckerTypeIDZone.def

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,3 +153,5 @@ SWIFT_REQUEST(TypeChecker, NeedsNewVTableEntryRequest,
153153
bool(AbstractFunctionDecl *), SeparatelyCached, NoLocationInfo)
154154
SWIFT_REQUEST(TypeChecker, ParamSpecifierRequest,
155155
ParamDecl::Specifier(ParamDecl *), SeparatelyCached, NoLocationInfo)
156+
SWIFT_REQUEST(TypeChecker, ResultTypeRequest,
157+
Type(ValueDecl *), SeparatelyCached, NoLocationInfo)

trunk/include/swift/Sema/IDETypeChecking.h

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,31 @@
2020
#define SWIFT_SEMA_IDETYPECHECKING_H
2121

2222
#include "llvm/ADT/MapVector.h"
23+
#include "swift/AST/Identifier.h"
2324
#include "swift/Basic/SourceLoc.h"
2425
#include <memory>
2526

2627
namespace swift {
2728
class AbstractFunctionDecl;
29+
class ASTContext;
30+
class ConcreteDeclRef;
2831
class Decl;
32+
class DeclContext;
33+
class DeclName;
34+
enum class DeclRefKind;
2935
class Expr;
3036
class ExtensionDecl;
37+
class FunctionType;
38+
class NominalTypeDecl;
39+
class PatternBindingDecl;
3140
class ProtocolDecl;
41+
class SourceFile;
42+
class SubscriptDecl;
43+
class TopLevelCodeDecl;
3244
class Type;
3345
class TypeChecker;
34-
class DeclContext;
35-
class ConcreteDeclRef;
3646
class ValueDecl;
37-
class DeclName;
47+
struct PrintOptions;
3848

3949
/// Typecheck binding initializer at \p bindingIndex.
4050
void typeCheckPatternBinding(PatternBindingDecl *PBD, unsigned bindingIndex);
@@ -127,12 +137,6 @@ namespace swift {
127137
/// \returns true on success, false on error.
128138
bool typeCheckTopLevelCodeDecl(TopLevelCodeDecl *TLCD);
129139

130-
/// Creates a type checker instance on the given AST context, if it
131-
/// doesn't already have one.
132-
///
133-
/// \returns a reference to the type checker instance.
134-
TypeChecker &createTypeChecker(ASTContext &Ctx);
135-
136140
struct ExtensionInfo {
137141
// The extension with the declarations to apply.
138142
ExtensionDecl *Ext;

trunk/include/swift/Subsystems.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ namespace swift {
6565
class SyntaxParsingCache;
6666
class Token;
6767
class TopLevelContext;
68+
class TypeChecker;
6869
struct TypeLoc;
6970
class UnifiedStatsReporter;
7071
enum class SourceFileKind;
@@ -194,6 +195,12 @@ namespace swift {
194195
SkipNonInlinableFunctionBodies = 1 << 4,
195196
};
196197

198+
/// Creates a type checker instance on the given AST context, if it
199+
/// doesn't already have one.
200+
///
201+
/// \returns a reference to the type checker instance.
202+
TypeChecker &createTypeChecker(ASTContext &Ctx);
203+
197204
/// Once parsing and name-binding are complete, this walks the AST to resolve
198205
/// types and diagnose problems therein.
199206
///

0 commit comments

Comments
 (0)