Skip to content

Commit 82aa155

Browse files
authored
---
yaml --- r: 349085 b: refs/heads/master c: 36c5c2f h: refs/heads/master i: 349083: a4a18b8
1 parent 405283b commit 82aa155

32 files changed

+327
-347
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: 23db8d0e2ecc997462c8fefdeb3d3a1a6a7bec10
2+
refs/heads/master: 36c5c2f2eaed350cd5dd4b8dae0f10cf357b6914
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/docs/WindowsBuild.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ mklink "%VCToolsInstallDir%\include\visualc.apinotes" S:\swift\stdlib\public\Pla
9999
Warning: Creating the above links usually requires administrator privileges. The quick and easy way to do this is to open a second developer prompt by right clicking whatever shortcut you used to open the first one, choosing Run As Administrator, and pasting the above commands into the resulting window. You can then close the privileged prompt; this is the only step which requires elevation.
100100

101101
## 6. Build LLVM/Clang
102-
- This must be done from within a developer command prompt. LLVM and Clang are
103-
large projects, so building might take a few hours. Make sure that the build
102+
- This must be done from within a developer command prompt. Make sure that the build
104103
type for LLVM/Clang is compatible with the build type for Swift. That is,
105104
either build everything `Debug` or some variant of `Release` (e.g. `Release`,
106105
`RelWithDebInfo`).
@@ -126,8 +125,8 @@ ninja
126125
path S:\b\llvm\bin;%PATH%
127126
```
128127
## 7. Build CMark
129-
- This must be done from within a developer command prompt. CMark is a fairly
130-
small project and should only take a few minutes to build.
128+
- This must be done from within a developer command prompt.
129+
131130
```cmd
132131
md "S:\b\cmark"
133132
cd "S:\b\cmark"
@@ -180,8 +179,8 @@ cmake -G "Visual Studio 2017" -A x64 -T "host=x64"^ ...
180179
```
181180

182181
## 9. Build lldb
183-
- This must be done from within a developer command prompt and could take hours
184-
depending on your system.
182+
- This must be done from within a developer command prompt.
183+
185184
```cmd
186185
md "S:\b\lldb"
187186
cd "S:\b\lldb"

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/DiagnosticsCommon.def

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ ERROR(circular_protocol_def,none,
163163
NOTE(kind_declname_declared_here,none,
164164
"%0 %1 declared here", (DescriptiveDeclKind, DeclName))
165165

166+
WARNING(warn_property_wrapper_module_scope,none,
167+
"ignoring associated type %0 in favor of module-scoped property "
168+
"wrapper %0; please qualify the reference with %1",
169+
(DeclName, Identifier))
170+
166171
#ifndef DIAG_NO_UNDEF
167172
# if defined(DIAG)
168173
# undef DIAG

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)