Skip to content

Commit 43b9441

Browse files
jrose-applebeccadax
authored andcommitted
---
yaml --- r: 349378 b: refs/heads/master-next c: 735eda0 h: refs/heads/master
1 parent 2e4c0ae commit 43b9441

File tree

319 files changed

+1504
-4981
lines changed

Some content is hidden

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

319 files changed

+1504
-4981
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 3574c513bbc5578dd9346b4ea9ab5995c5927bb5
3-
refs/heads/master-next: 9461dcdc00e3320be12b74ed8d6be2b404b5638c
3+
refs/heads/master-next: 735eda042ad987f5de0118cbd87f80bd016b8dfc
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/CMakeLists.txt

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ if(MSVC OR "${CMAKE_SIMULATE_ID}" STREQUAL MSVC)
450450
endif()
451451

452452
if(CMAKE_SYSTEM_NAME STREQUAL Darwin OR
453-
EXISTS "${SWIFT_PATH_TO_LIBDISPATCH_SOURCE}")
453+
EXISTS ${SWIFT_PATH_TO_LIBDISPATCH_SOURCE})
454454
set(SWIFT_BUILD_SYNTAXPARSERLIB_default TRUE)
455455
set(SWIFT_BUILD_SOURCEKIT_default TRUE)
456456
else()
@@ -499,6 +499,18 @@ include(CMakePushCheckState)
499499

500500
print_versions()
501501

502+
include(SwiftSharedCMakeConfig)
503+
504+
# NOTE: We include this before SwiftComponents as it relies on some LLVM CMake
505+
# functionality.
506+
# Support building Swift as a standalone project, using LLVM as an
507+
# external library.
508+
if(SWIFT_BUILT_STANDALONE)
509+
swift_common_standalone_build_config(SWIFT)
510+
else()
511+
swift_common_unified_build_config(SWIFT)
512+
endif()
513+
502514
include(SwiftComponents)
503515
include(SwiftHandleGybSources)
504516
include(SwiftSetIfArchBitness)
@@ -527,16 +539,6 @@ if(NOT CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_PROCESSOR STREQUAL "i386")
527539
OUTPUT_STRIP_TRAILING_WHITESPACE)
528540
endif()
529541

530-
include(SwiftSharedCMakeConfig)
531-
532-
# Support building Swift as a standalone project, using LLVM as an
533-
# external library.
534-
if(SWIFT_BUILT_STANDALONE)
535-
swift_common_standalone_build_config(SWIFT)
536-
else()
537-
swift_common_unified_build_config(SWIFT)
538-
endif()
539-
540542
get_filename_component(SWIFT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} REALPATH)
541543
set(SWIFT_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}")
542544
set(SWIFT_CMAKE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
@@ -1051,6 +1053,7 @@ if(SWIFT_NEED_EXPLICIT_LIBDISPATCH)
10511053
else()
10521054
set(SOURCEKIT_RUNTIME_DIR lib)
10531055
endif()
1056+
add_dependencies(sourcekit-inproc BlocksRuntime dispatch)
10541057
swift_install_in_component(FILES
10551058
$<TARGET_FILE:dispatch>
10561059
$<TARGET_FILE:BlocksRuntime>

branches/master-next/apinotes/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ add_custom_target("copy_apinotes" ALL
2626
COMMENT "Copying API notes to ${output_dir}"
2727
SOURCES "${sources}")
2828

29+
add_dependencies(compiler copy_apinotes)
2930
swift_install_in_component(DIRECTORY "${output_dir}"
3031
DESTINATION "lib/swift/"
3132
COMPONENT compiler)

branches/master-next/cmake/modules/AddSwift.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,6 +1506,7 @@ function(add_swift_host_library name)
15061506
INSTALL_IN_COMPONENT "dev"
15071507
)
15081508

1509+
add_dependencies(dev ${name})
15091510
if(NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
15101511
swift_install_in_component(TARGETS ${name}
15111512
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX} COMPONENT dev
@@ -2117,6 +2118,7 @@ function(add_swift_target_library name)
21172118
endif()
21182119

21192120
if(sdk STREQUAL WINDOWS AND CMAKE_SYSTEM_NAME STREQUAL Windows)
2121+
add_dependencies(${SWIFTLIB_INSTALL_IN_COMPONENT} ${name}-windows-${SWIFT_PRIMARY_VARIANT_ARCH})
21202122
swift_install_in_component(TARGETS ${name}-windows-${SWIFT_PRIMARY_VARIANT_ARCH}
21212123
RUNTIME
21222124
DESTINATION "bin"
@@ -2129,6 +2131,9 @@ function(add_swift_target_library name)
21292131
COMPONENT "${SWIFTLIB_INSTALL_IN_COMPONENT}"
21302132
PERMISSIONS ${file_permissions})
21312133
else()
2134+
# NOTE: ${UNIVERSAL_LIBRARY_NAME} is the output associated with the target
2135+
# ${lipo_target}
2136+
add_dependencies(${SWIFTLIB_INSTALL_IN_COMPONENT} ${lipo_target})
21322137
swift_install_in_component(FILES "${UNIVERSAL_LIBRARY_NAME}"
21332138
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${resource_dir}/${resource_dir_sdk_subdir}"
21342139
COMPONENT "${SWIFTLIB_INSTALL_IN_COMPONENT}"
@@ -2139,6 +2144,7 @@ function(add_swift_target_library name)
21392144
foreach(arch ${SWIFT_SDK_WINDOWS_ARCHITECTURES})
21402145
if(TARGET ${name}-windows-${arch}_IMPLIB)
21412146
get_target_property(import_library ${name}-windows-${arch}_IMPLIB IMPORTED_LOCATION)
2147+
add_dependencies(${SWIFTLIB_INSTALL_IN_COMPONENT} ${name}-windows-${arch}_IMPLIB)
21422148
swift_install_in_component(FILES ${import_library}
21432149
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${resource_dir}/${resource_dir_sdk_subdir}/${arch}"
21442150
COMPONENT ${SWIFTLIB_INSTALL_IN_COMPONENT}
@@ -2205,6 +2211,7 @@ function(add_swift_target_library name)
22052211
OUTPUT
22062212
"${UNIVERSAL_LIBRARY_NAME}"
22072213
${THIN_INPUT_TARGETS_STATIC})
2214+
add_dependencies(${SWIFTLIB_INSTALL_IN_COMPONENT} ${lipo_target_static})
22082215
swift_install_in_component(FILES "${UNIVERSAL_LIBRARY_NAME}"
22092216
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/${install_subdir}/${resource_dir_sdk_subdir}"
22102217
PERMISSIONS
@@ -2406,6 +2413,7 @@ function(add_swift_host_tool executable)
24062413
ARCHITECTURE ${SWIFT_HOST_VARIANT_ARCH}
24072414
${ASHT_UNPARSED_ARGUMENTS})
24082415

2416+
add_dependencies(${ASHT_SWIFT_COMPONENT} ${executable})
24092417
swift_install_in_component(TARGETS ${executable}
24102418
RUNTIME
24112419
DESTINATION bin

branches/master-next/cmake/modules/SwiftComponents.cmake

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,23 @@ macro(swift_configure_components)
9292
"A semicolon-separated list of components to install from the set ${_SWIFT_DEFINED_COMPONENTS}")
9393

9494
foreach(component ${_SWIFT_DEFINED_COMPONENTS})
95+
add_custom_target(${component})
96+
add_llvm_install_targets(install-${component}
97+
DEPENDS ${component}
98+
COMPONENT ${component})
99+
95100
string(TOUPPER "${component}" var_name_piece)
96101
string(REPLACE "-" "_" var_name_piece "${var_name_piece}")
97102
set(SWIFT_INSTALL_${var_name_piece} FALSE)
98103
endforeach()
99104

105+
# NOTE: never_install is a dummy component to indicate something should not
106+
# be installed. We explicitly do not add an install target for this.
107+
add_custom_target(never_install)
108+
109+
add_custom_target(swift-components)
110+
add_custom_target(install-swift-components)
111+
100112
foreach(component ${SWIFT_INSTALL_COMPONENTS})
101113
if(NOT "${component}" IN_LIST _SWIFT_DEFINED_COMPONENTS)
102114
message(FATAL_ERROR "unknown install component: ${component}")
@@ -106,6 +118,8 @@ macro(swift_configure_components)
106118
string(REPLACE "-" "_" var_name_piece "${var_name_piece}")
107119
if(NOT SWIFT_INSTALL_EXCLUDE_${var_name_piece})
108120
set(SWIFT_INSTALL_${var_name_piece} TRUE)
121+
add_dependencies(swift-components ${component})
122+
add_dependencies(install-swift-components install-${component})
109123
endif()
110124
endforeach()
111125
endmacro()
@@ -174,5 +188,6 @@ function(swift_install_symlink_component component)
174188
MESSAGE "LLVMInstallSymlink script must be available.")
175189

176190
install(SCRIPT ${INSTALL_SYMLINK}
177-
CODE "install_symlink(${ARG_LINK_NAME} ${ARG_TARGET} ${ARG_DESTINATION})")
191+
CODE "install_symlink(${ARG_LINK_NAME} ${ARG_TARGET} ${ARG_DESTINATION})"
192+
COMPONENT ${component})
178193
endfunction()

branches/master-next/cmake/modules/SwiftManpage.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function(manpage)
2727
"${CMAKE_CURRENT_BINARY_DIR}/${MP_MAN_FILE_BASENAME}.${MP_MAN_SECTION}")
2828

2929
add_custom_command_target(
30-
unused_var
30+
manpage_target
3131
COMMAND
3232
"${POD2MAN}" "--section" "${MP_MAN_SECTION}"
3333
"--center" "${MP_PAGE_HEADER}" "--release=\"swift ${SWIFT_VERSION}\""
@@ -38,6 +38,7 @@ function(manpage)
3838
DEPENDS "${MP_SOURCE}"
3939
ALL)
4040

41+
add_dependencies(${MP_INSTALL_IN_COMPONENT} ${manpage_target})
4142
swift_install_in_component(FILES "${output_file_name}"
4243
DESTINATION "share/man/man${MP_MAN_SECTION}"
4344
COMPONENT "${MP_INSTALL_IN_COMPONENT}")

branches/master-next/docs/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ if (DOXYGEN_FOUND)
6868
add_dependencies(doxygen doxygen-swift)
6969
endif()
7070

71+
add_dependencies(dev doxygen-swift)
7172
swift_install_in_component(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doxygen/html"
7273
DESTINATION "docs/html"
7374
COMPONENT dev)

branches/master-next/docs/DebuggingTheCompiler.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,6 @@ diagnostic engine to assert on the first error/warning:
8686
These allow one to dump a stack trace of where the diagnostic is being emitted
8787
(if run without a debugger) or drop into the debugger if a debugger is attached.
8888

89-
Finding Diagnostic Names
90-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91-
92-
Some diagnostics rely heavily on format string arguments, so it can be difficult
93-
to find their implementation by searching for parts of the emitted message in
94-
the codebase. To print the corresponding diagnostic name at the end of each
95-
emitted message, use the ``-Xfrontend -debug-diagnostic-names`` argument.
96-
9789
Debugging the Type Checker
9890
--------------------------
9991

branches/master-next/docs/SIL.rst

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2342,8 +2342,8 @@ assign_by_wrapper
23422342
assign_by_wrapper %0 : $S to %1 : $*T, init %2 : $F, set %3 : $G
23432343
// $S can be a value or address type
23442344
// $T must be the type of a property wrapper.
2345-
// $F must be a function type, taking $S as a single argument (or multiple arguments in case of a tuple) and returning $T
2346-
// $G must be a function type, taking $S as a single argument (or multiple arguments in case of a tuple) and without a return value
2345+
// $F must be a function type, taking $S as a single argument and returning $T
2346+
// $G must be a function type, taking $S as a single argument and with not return value
23472347

23482348
Similar to the ``assign`` instruction, but the assignment is done via a
23492349
delegate.
@@ -3484,14 +3484,13 @@ has an escaping function type (not ``[on_stack]``) the closure context will be
34843484
allocated with retain count 1 and initialized to contain the values ``%1``,
34853485
``%2``, etc. The closed-over values will not be retained; that must be done
34863486
separately before the ``partial_apply``. The closure does however take ownership
3487-
of the partially applied arguments (except for ``@inout_aliasable`` parameters);
3488-
when the closure reference count reaches zero, the contained values will be
3489-
destroyed. If the ``partial_apply`` has a ``@noescape`` function type
3490-
(``partial_apply [on_stack]``) the closure context is allocated on the stack and
3491-
initialized to contain the closed-over values. The closed-over values are not
3492-
retained, lifetime of the closed-over values must be managed separately. The
3493-
lifetime of the stack context of a ``partial_apply [on_stack]`` must be
3494-
terminated with a ``dealloc_stack``.
3487+
of the partially applied arguments; when the closure reference count reaches
3488+
zero, the contained values will be destroyed. If the ``partial_apply`` has a
3489+
``@noescape`` function type (``partial_apply [on_stack]``) the closure context
3490+
is allocated on the stack and initialized to contain the closed-over values. The
3491+
closed-over values are not retained, lifetime of the closed-over values must be
3492+
managed separately. The lifetime of the stack context of a ``partial_apply
3493+
[on_stack]`` must be terminated with a ``dealloc_stack``.
34953494

34963495
If the callee is generic, all of its generic parameters must be bound by the
34973496
given substitution list. The arguments are given with these generic
@@ -3500,11 +3499,6 @@ type with the given substitutions applied. The generic parameters themselves
35003499
cannot be partially applied; all of them must be bound. The result is always
35013500
a concrete function.
35023501

3503-
If an address argument has ``@inout_aliasable`` convention, the closure
3504-
obtained from ``partial_apply`` will not own its underlying value.
3505-
The ``@inout_aliasable`` parameter convention is used when a ``@noescape``
3506-
closure captures an ``inout`` argument.
3507-
35083502
TODO: The instruction, when applied to a generic function,
35093503
currently implicitly performs abstraction difference transformations enabled
35103504
by the given substitutions, such as promoting address-only arguments and returns

branches/master-next/include/swift/AST/ASTContext.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,10 @@ class ASTContext final {
829829
/// \param IDC The context whose member decls should be lazily parsed.
830830
void parseMembers(IterableDeclContext *IDC);
831831

832+
/// Use the lazy parsers associated with the context to check whether the decl
833+
/// context has been parsed.
834+
bool hasUnparsedMembers(const IterableDeclContext *IDC) const;
835+
832836
/// Get the lazy function data for the given generic context.
833837
///
834838
/// \param lazyLoader If non-null, the lazy loader to use when creating the

branches/master-next/include/swift/AST/Attr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ class TypeAttributes {
101101
AttrLocs[A] = L;
102102
}
103103

104-
void getAttrLocs(SmallVectorImpl<SourceLoc> &Locs) const {
104+
void getAttrRanges(SmallVectorImpl<SourceRange> &Ranges) const {
105105
for (auto Loc : AttrLocs) {
106106
if (Loc.isValid())
107-
Locs.push_back(Loc);
107+
Ranges.push_back(Loc);
108108
}
109109
}
110110

branches/master-next/include/swift/AST/ClangModuleLoader.h

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#define SWIFT_AST_CLANG_MODULE_LOADER_H
1515

1616
#include "swift/AST/ModuleLoader.h"
17+
#include "swift/Demangling/Demangle.h"
1718

1819
namespace clang {
1920
class ASTContext;
@@ -27,24 +28,11 @@ namespace swift {
2728
class DeclContext;
2829
class VisibleDeclConsumer;
2930

30-
/// Represents the different namespaces for types in C.
31-
///
32-
/// A simplified version of clang::Sema::LookupKind.
33-
enum class ClangTypeKind {
34-
Typedef,
35-
ObjCClass = Typedef,
36-
/// Structs, enums, and unions.
37-
Tag,
38-
ObjCProtocol,
39-
};
40-
4131
class ClangModuleLoader : public ModuleLoader {
4232
private:
4333
virtual void anchor();
44-
4534
protected:
4635
using ModuleLoader::ModuleLoader;
47-
4836
public:
4937
virtual clang::ASTContext &getClangASTContext() const = 0;
5038
virtual clang::Preprocessor &getClangPreprocessor() const = 0;
@@ -68,9 +56,9 @@ class ClangModuleLoader : public ModuleLoader {
6856
///
6957
/// This routine is used for various hacks that are only permitted within
7058
/// overlays of imported modules, e.g., Objective-C bridging conformances.
71-
virtual bool
72-
isInOverlayModuleForImportedModule(const DeclContext *overlayDC,
73-
const DeclContext *importedDC) = 0;
59+
virtual bool isInOverlayModuleForImportedModule(
60+
const DeclContext *overlayDC,
61+
const DeclContext *importedDC) = 0;
7462

7563
/// Look for declarations associated with the given name.
7664
///
@@ -82,7 +70,7 @@ class ClangModuleLoader : public ModuleLoader {
8270
/// Note that this method does no filtering. If it finds the type in a loaded
8371
/// module, it returns it. This is intended for use in reflection / debugging
8472
/// contexts where access is not a problem.
85-
virtual void lookupTypeDecl(StringRef clangName, ClangTypeKind kind,
73+
virtual void lookupTypeDecl(StringRef clangName, Demangle::Node::Kind kind,
8674
llvm::function_ref<void(TypeDecl *)> receiver) {}
8775

8876
/// Look up type a declaration synthesized by the Clang importer itself, using
@@ -94,11 +82,11 @@ class ClangModuleLoader : public ModuleLoader {
9482
/// module, it returns it. This is intended for use in reflection / debugging
9583
/// contexts where access is not a problem.
9684
virtual void
97-
lookupRelatedEntity(StringRef clangName, ClangTypeKind kind,
98-
StringRef relatedEntityKind,
85+
lookupRelatedEntity(StringRef clangName, StringRef relatedEntityKind,
9986
llvm::function_ref<void(TypeDecl *)> receiver) {}
10087
};
10188

10289
} // namespace swift
10390

10491
#endif // LLVM_SWIFT_AST_CLANG_MODULE_LOADER_H
92+

0 commit comments

Comments
 (0)