Skip to content

Commit 233be31

Browse files
committed
---
yaml --- r: 347471 b: refs/heads/master c: a75e8fb h: refs/heads/master i: 347469: c6b8fb8 347467: 63fb66c 347463: c50c2b9 347455: f8ffa08
1 parent c95c60c commit 233be31

File tree

177 files changed

+1537
-5356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

177 files changed

+1537
-5356
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: 4694ca0d77701bf6abf6f9066870d95a3830d562
2+
refs/heads/master: a75e8fbd212c316a337aff9b91dfcc25db89d5df
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/benchmark/utils/build_script_helper.py

Lines changed: 0 additions & 44 deletions
This file was deleted.

trunk/cmake/modules/AddSwift.cmake

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -318,30 +318,6 @@ function(_add_variant_c_compile_flags)
318318
endforeach()
319319
endif()
320320

321-
set(ICU_UC_INCLUDE_DIR ${SWIFT_${CFLAGS_SDK}_${CFLAGS_ARCH}_ICU_UC_INCLUDE})
322-
if(NOT "${ICU_UC_INCLUDE_DIR}" STREQUAL "" AND
323-
NOT "${ICU_UC_INCLUDE_DIR}" STREQUAL "/usr/include" AND
324-
NOT "${ICU_UC_INCLUDE_DIR}" STREQUAL "/usr/${SWIFT_SDK_${CFLAGS_SDK}_ARCH_${CFLAGS_ARCH}_TRIPLE}/include" AND
325-
NOT "${ICU_UC_INCLUDE_DIR}" STREQUAL "/usr/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_TRIPLE}/include")
326-
if(SWIFT_COMPILER_IS_MSVC_LIKE)
327-
list(APPEND result -I;${ICU_UC_INCLUDE_DIR})
328-
else()
329-
list(APPEND result -isystem;${ICU_UC_INCLUDE_DIR})
330-
endif()
331-
endif()
332-
333-
set(ICU_I18N_INCLUDE_DIR ${SWIFT_${CFLAGS_SDK}_${CFLAGS_ARCH}_ICU_I18N_INCLUDE})
334-
if(NOT "${ICU_I18N_INCLUDE_DIR}" STREQUAL "" AND
335-
NOT "${ICU_I18N_INCLUDE_DIR}" STREQUAL "/usr/include" AND
336-
NOT "${ICU_I18N_INCLUDE_DIR}" STREQUAL "/usr/${SWIFT_SDK_${CFLAGS_SDK}_ARCH_${CFLAGS_ARCH}_TRIPLE}/include" AND
337-
NOT "${ICU_I18N_INCLUDE_DIR}" STREQUAL "/usr/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_TRIPLE}/include")
338-
if(SWIFT_COMPILER_IS_MSVC_LIKE)
339-
list(APPEND result -I;${ICU_I18N_INCLUDE_DIR})
340-
else()
341-
list(APPEND result -isystem;${ICU_I18N_INCLUDE_DIR})
342-
endif()
343-
endif()
344-
345321
set("${CFLAGS_RESULT_VAR_NAME}" "${result}" PARENT_SCOPE)
346322
endfunction()
347323

@@ -984,6 +960,21 @@ function(_add_swift_library_single target name)
984960
endif()
985961
_set_target_prefix_and_suffix("${target}" "${libkind}" "${SWIFTLIB_SINGLE_SDK}")
986962

963+
if(SWIFTLIB_SINGLE_TARGET_LIBRARY)
964+
if(NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "" AND
965+
NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "/usr/include" AND
966+
NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_ARCH_${SWIFTLIB_SINGLE_ARCHITECTURE}_TRIPLE}/include" AND
967+
NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_TRIPLE}/include")
968+
target_include_directories("${target}" SYSTEM PRIVATE "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_UC_INCLUDE}")
969+
endif()
970+
if(NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "" AND
971+
NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "/usr/include" AND
972+
NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_ARCH_${SWIFTLIB_SINGLE_ARCHITECTURE}_TRIPLE}/include" AND
973+
NOT "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}" STREQUAL "/usr/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_TRIPLE}/include")
974+
target_include_directories("${target}" SYSTEM PRIVATE "${SWIFT_${SWIFTLIB_SINGLE_SDK}_${SWIFTLIB_SINGLE_ARCHITECTURE}_ICU_I18N_INCLUDE}")
975+
endif()
976+
endif()
977+
987978
if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "WINDOWS")
988979
swift_windows_include_for_arch(${SWIFTLIB_SINGLE_ARCHITECTURE} SWIFTLIB_INCLUDE)
989980
target_include_directories("${target}" SYSTEM PRIVATE ${SWIFTLIB_INCLUDE})
@@ -1027,11 +1018,6 @@ function(_add_swift_library_single target name)
10271018
set_target_properties("${target}" PROPERTIES
10281019
LIBRARY_OUTPUT_DIRECTORY ${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}
10291020
ARCHIVE_OUTPUT_DIRECTORY ${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR})
1030-
if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS AND SWIFTLIB_SINGLE_IS_STDLIB_CORE
1031-
AND libkind STREQUAL SHARED)
1032-
add_custom_command(TARGET ${target} POST_BUILD
1033-
COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${target}> ${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR})
1034-
endif()
10351021

10361022
foreach(config ${CMAKE_CONFIGURATION_TYPES})
10371023
string(TOUPPER ${config} config_upper)
@@ -1376,8 +1362,15 @@ endfunction()
13761362
# add_swift_host_library(name
13771363
# [SHARED]
13781364
# [STATIC]
1365+
# [DEPENDS dep1 ...]
1366+
# [INTERFACE_LINK_LIBRARIES dep1 ...]
1367+
# [SWIFT_MODULE_DEPENDS dep1 ...]
13791368
# [LLVM_COMPONENT_DEPENDS comp1 ...]
13801369
# [FILE_DEPENDS target1 ...]
1370+
# [C_COMPILE_FLAGS flag1...]
1371+
# [LINK_FLAGS flag1...]
1372+
# [INSTALL]
1373+
# INSTALL_IN_COMPONENT comp
13811374
# source1 [source2 source3 ...])
13821375
#
13831376
# name
@@ -1389,12 +1382,24 @@ endfunction()
13891382
# STATIC
13901383
# Build a static library.
13911384
#
1385+
# DEPENDS
1386+
# Targets that this library depends on.
1387+
#
13921388
# LLVM_COMPONENT_DEPENDS
13931389
# LLVM components this library depends on.
13941390
#
13951391
# FILE_DEPENDS
13961392
# Additional files this library depends on.
13971393
#
1394+
# C_COMPILE_FLAGS
1395+
# Extra compiler flags (C, C++, ObjC).
1396+
#
1397+
# LINK_FLAGS
1398+
# Extra linker flags.
1399+
#
1400+
# INSTALL_IN_COMPONENT comp
1401+
# The Swift installation component that this library belongs to.
1402+
#
13981403
# source1 ...
13991404
# Sources to add into this library.
14001405
function(add_swift_host_library name)
@@ -1408,6 +1413,7 @@ function(add_swift_host_library name)
14081413
DEPENDS
14091414
FILE_DEPENDS
14101415
INTERFACE_LINK_LIBRARIES
1416+
LINK_FLAGS
14111417
LINK_LIBRARIES
14121418
LLVM_COMPONENT_DEPENDS)
14131419

@@ -1418,15 +1424,6 @@ function(add_swift_host_library name)
14181424
${ARGN})
14191425
set(ASHL_SOURCES ${ASHL_UNPARSED_ARGUMENTS})
14201426

1421-
if(ASHL_C_COMPILE_FLAGS)
1422-
message(SEND_ERROR "library ${name} is using C_COMPILE_FLAGS parameter which is deprecated. Please use target_compile_definitions, target_compile_options, or target_include_directories instead")
1423-
endif()
1424-
if(ASHL_DEPENDS)
1425-
message(SEND_ERROR "library ${name} is using DEPENDS parameter which is deprecated. Please use add_dependencies instead")
1426-
endif()
1427-
if(ASHL_INTERFACE_LINK_LIBRARIES)
1428-
message(SEND_ERROR "library ${name} is using INTERFACE_LINK_LIBRARIES parameter which is deprecated. Please use target_link_libraries instead.")
1429-
endif()
14301427
if(ASHL_LINK_LIBRARIES)
14311428
message(SEND_ERROR "library ${name} is using LINK_LIBRARIES parameter which is deprecated. Please use target_link_libraries instead")
14321429
endif()
@@ -1446,8 +1443,12 @@ function(add_swift_host_library name)
14461443
${ASHL_FORCE_BUILD_OPTIMIZED_keyword}
14471444
SDK ${SWIFT_HOST_VARIANT_SDK}
14481445
ARCHITECTURE ${SWIFT_HOST_VARIANT_ARCH}
1446+
DEPENDS ${ASHL_DEPENDS}
14491447
LLVM_COMPONENT_DEPENDS ${ASHL_LLVM_COMPONENT_DEPENDS}
14501448
FILE_DEPENDS ${ASHL_FILE_DEPENDS}
1449+
C_COMPILE_FLAGS ${ASHL_C_COMPILE_FLAGS}
1450+
LINK_FLAGS ${ASHL_LINK_FLAGS}
1451+
INTERFACE_LINK_LIBRARIES ${ASHL_INTERFACE_LINK_LIBRARIES}
14511452
INSTALL_IN_COMPONENT "dev"
14521453
)
14531454

trunk/docs/WindowsBuild.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Visual Studio 2017 or newer is needed to build swift on Windows.
44

55
## 1. Install dependencies
6-
- Install the latest version of [Visual Studio](https://www.visualstudio.com/downloads/)
6+
1. Latest version of [Visual Studio](https://www.visualstudio.com/downloads/)
77
- Make sure to include "Programming Languages|Visual C++" and "Windows and Web
88
Development|Universal Windows App Development|Windows SDK" in your
99
installation.
@@ -205,10 +205,15 @@ cmake --build S:\b\lldb
205205

206206
## 10. Running tests on Windows
207207

208-
Running the testsuite on Windows has additional external dependencies.
208+
Running the testsuite on Windows has additional external dependencies. You must have a subset of the GNUWin32 programs installed and available in your path. The following packages are currently required:
209+
210+
1. coreutils
211+
2. diffutils
212+
3. grep
213+
4. sed
209214

210215
```cmd
211-
path S:\thirdparty\icu4c-63_1-Win64-MSVC2017\bin64;S:\b\swift\bin;S:\b\swift\libdispatch-prefix\bin;%PATH%;%ProgramFiles%\Git\usr\bin
216+
path S:\thirdparty\icu4c-63_1-Win64-MSVC2017\bin64;S:\b\swift\bin;S:\b\swift\libdispatch-prefix\bin;%PATH%;%ProgramFiles(x86)%\GnuWin32\bin
212217
ninja -C S:\b\swift check-swift
213218
```
214219

trunk/include/swift/AST/AccessScopeChecker.h

Lines changed: 21 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -23,79 +23,47 @@
2323

2424
namespace swift {
2525

26-
class BoundGenericType;
27-
class ComponentIdentTypeRepr;
28-
class NominalType;
26+
class AbstractStorageDecl;
27+
class ExtensionDecl;
2928
class SourceFile;
30-
class TypeAliasType;
29+
class ValueDecl;
3130

3231
class AccessScopeChecker {
3332
const SourceFile *File;
3433
bool TreatUsableFromInlineAsPublic;
3534

35+
protected:
36+
ASTContext &Context;
3637
Optional<AccessScope> Scope = AccessScope::getPublic();
3738

3839
AccessScopeChecker(const DeclContext *useDC,
3940
bool treatUsableFromInlineAsPublic);
40-
bool visitDecl(const ValueDecl *VD);
41+
bool visitDecl(ValueDecl *VD);
42+
};
43+
44+
class TypeReprAccessScopeChecker : private ASTWalker, AccessScopeChecker {
45+
TypeReprAccessScopeChecker(const DeclContext *useDC,
46+
bool treatUsableFromInlineAsPublic);
47+
48+
bool walkToTypeReprPre(TypeRepr *TR) override;
49+
bool walkToTypeReprPost(TypeRepr *TR) override;
4150

4251
public:
4352
static Optional<AccessScope>
4453
getAccessScope(TypeRepr *TR, const DeclContext *useDC,
4554
bool treatUsableFromInlineAsPublic = false);
46-
static Optional<AccessScope>
47-
getAccessScope(Type T, const DeclContext *useDC,
48-
bool treatUsableFromInlineAsPublic = false);
4955
};
5056

51-
/// Walks a Type to find all NominalTypes, BoundGenericTypes, and
52-
/// TypeAliasTypes.
53-
class TypeDeclFinder : public TypeWalker {
54-
Action walkToTypePre(Type T) override;
55-
56-
public:
57-
virtual Action visitNominalType(const NominalType *ty) {
58-
return Action::Continue;
59-
}
60-
virtual Action visitBoundGenericType(const BoundGenericType *ty) {
61-
return Action::Continue;
62-
}
63-
virtual Action visitTypeAliasType(const TypeAliasType *ty) {
64-
return Action::Continue;
65-
}
66-
};
57+
class TypeAccessScopeChecker : private TypeWalker, AccessScopeChecker {
58+
TypeAccessScopeChecker(const DeclContext *useDC,
59+
bool treatUsableFromInlineAsPublic);
6760

68-
/// A TypeDeclFinder for use cases where all types should be treated
69-
/// equivalently and where generic arguments can be walked to separately from
70-
/// the generic type.
71-
class SimpleTypeDeclFinder : public TypeDeclFinder {
72-
/// The function to call when a ComponentIdentTypeRepr is seen.
73-
llvm::function_ref<Action(const TypeDecl *)> Callback;
74-
75-
Action visitNominalType(const NominalType *ty) override;
76-
Action visitBoundGenericType(const BoundGenericType *ty) override;
77-
Action visitTypeAliasType(const TypeAliasType *ty) override;
61+
Action walkToTypePre(Type T);
7862

7963
public:
80-
explicit SimpleTypeDeclFinder(
81-
llvm::function_ref<Action(const TypeDecl *)> callback)
82-
: Callback(callback) {}
83-
};
84-
85-
/// Walks a TypeRepr to find all ComponentIdentTypeReprs with bound TypeDecls.
86-
///
87-
/// Subclasses can either override #visitTypeDecl if they only care about
88-
/// types on their own, or #visitComponentIdentTypeRepr if they want to keep
89-
/// the TypeRepr around.
90-
class TypeReprIdentFinder : public ASTWalker {
91-
/// The function to call when a ComponentIdentTypeRepr is seen.
92-
llvm::function_ref<bool(const ComponentIdentTypeRepr *)> Callback;
93-
94-
bool walkToTypeReprPost(TypeRepr *TR) override;
95-
public:
96-
explicit TypeReprIdentFinder(
97-
llvm::function_ref<bool(const ComponentIdentTypeRepr *)> callback)
98-
: Callback(callback) {}
64+
static Optional<AccessScope>
65+
getAccessScope(Type T, const DeclContext *useDC,
66+
bool treatUsableFromInlineAsPublic = false);
9967
};
10068

10169
}

trunk/include/swift/AST/Decl.h

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "swift/Basic/ArrayRefView.h"
3737
#include "swift/Basic/Compiler.h"
3838
#include "swift/Basic/InlineBitfield.h"
39-
#include "swift/Basic/NullablePtr.h"
4039
#include "swift/Basic/OptionalEnum.h"
4140
#include "swift/Basic/Range.h"
4241
#include "llvm/ADT/DenseMap.h"
@@ -4748,32 +4747,8 @@ class VarDecl : public AbstractStorageDecl {
47484747
/// return this. Otherwise, this VarDecl must belong to a CaseStmt's
47494748
/// CaseLabelItem. In that case, return the first case label item of the first
47504749
/// case stmt in a sequence of case stmts that fallthrough into each other.
4751-
///
4752-
/// NOTE: During type checking, we emit an error if we have a single case
4753-
/// label item with a pattern that has multiple var decls of the same
4754-
/// name. This means that during type checking and before type checking, we
4755-
/// may have a _malformed_ switch stmt var decl linked list since var decls in
4756-
/// the same case label item that have the same name will point at the same
4757-
/// canonical var decl, namely the first var decl with the name in the
4758-
/// canonical case label item's var decl list. This is ok, since we are going
4759-
/// to emit the error, but it requires us to be more careful/cautious before
4760-
/// type checking has been complete when relying on canonical var decls
4761-
/// matching up.
47624750
VarDecl *getCanonicalVarDecl() const;
47634751

4764-
/// If this is a case stmt var decl, return the var decl that corresponds to
4765-
/// this var decl in the first case label item of the case stmt. Returns
4766-
/// nullptr if this isn't a VarDecl that is part of a case stmt.
4767-
NullablePtr<VarDecl> getCorrespondingFirstCaseLabelItemVarDecl() const;
4768-
4769-
/// If this is a case stmt var decl, return the case body var decl that this
4770-
/// var decl maps to.
4771-
NullablePtr<VarDecl> getCorrespondingCaseBodyVariable() const;
4772-
4773-
/// Return true if this var decl is an implicit var decl belonging to a case
4774-
/// stmt's body.
4775-
bool isCaseBodyVariable() const;
4776-
47774752
/// True if the global stored property requires lazy initialization.
47784753
bool isLazilyInitializedGlobal() const;
47794754

0 commit comments

Comments
 (0)