Commit Graph

506 Commits

Author SHA1 Message Date
John Holdsworth
32bd9f1e49 Cmake changes for -llog and -latomic III 2017-06-01 01:25:55 +01:00
John Holdsworth
0ab8788cc8 Cmake changes for -llog and -latomic II 2017-05-30 23:16:58 +01:00
John Holdsworth
c7ea92a280 Cmake changes for -llog and -latomic 2017-05-30 22:26:30 +01:00
Doug Coleman
f51f47b7c0 cmake: Don't generate targets for empty sdk/arch combinations.
See rdar://31642132.
2017-04-21 13:45:45 -07:00
practicalswift
7eb7d5b109 [gardening] Fix 100 typos. 2017-04-18 17:01:42 +02:00
Arnold Schwaighofer
d202256d1f Add -DSWIFT_RUNTIME_ENABLE_COW_EXISTENTIALS=1 when compiling the front-end
This should fix building a --debug-build
2017-04-02 12:49:26 -07:00
Doug Coleman
74c048ad90 cmake: Add `-Fsystem ${SDK_PATH}/System/Library/PrivateFrameworks`
for overlays builds.

Related to rdar://problem/28466433
2017-03-30 11:57:50 -07:00
Doug Coleman
e7390d1770 Revert "utils: Add swiftenvs, which allow the overriding of compiler tools."
This reverts commit 2b923f3846.
2017-03-22 20:09:34 -07:00
Doug Coleman
9880f65767 Revert "cmake: Ensure that CMAKE_CODESIGN is set instead of trying to run empty"
This reverts commit f3b7485369.
2017-03-22 20:09:34 -07:00
Doug Coleman
f3b7485369 cmake: Ensure that CMAKE_CODESIGN is set instead of trying to run empty
commands.
2017-03-21 21:13:12 -07:00
Doug Coleman
2b923f3846 utils: Add swiftenvs, which allow the overriding of compiler tools. 2017-03-21 14:59:12 -07:00
Arnold Schwaighofer
d5cbb0bd62 Runtime changes for the copy-on-write existential implementation
Adds the runtime implementation for copy-on-write existentials. This support is
enabled if SWIFT_RUNTIME_ENABLE_COW_EXISTENTIALS is defined. Focus is on
correctness -- not performance yet.

Don't use allocate/deallocate/projectBuffer witnesses for globals in cow
existential mode.

Use SWIFT_RUNTIME_ENABLE_COW_EXISTENTIALS configuration to set the default for
SILOptions.

This includes an IRGen fix to use the right projection in
emitMetatypeOfOpaqueExistential if SWIFT_RUNTIME_ENABLE_COW_EXISTENTIALS is set.

Use unknownRetain instead of native retain in dynamicCastToExistential.
2017-03-15 14:54:55 -07:00
Doug Coleman
8c2bd5ae23 cmake: Initial standalone overlays builds.
./utils/build-overlay AVFoundation OSX macosx
rdar://problem/28707246
2017-03-14 12:51:42 -07:00
Saleem Abdulrasool
04ca723570 build: enable ABI breaking std::atomic changes on MSVC
The std::atomic implementation in MSVC broke ABI compatibility across a
minor update (VS2015U2).  Permit the ABI breaking change for the use in
the runtime.
2017-02-26 17:27:15 -08:00
practicalswift
d352652a72 Merge pull request #7727 from practicalswift/typos-20170223
[gardening] Fix typos
2017-02-24 09:15:12 +01:00
Hugh Bellamy
99f9581802 Merge pull request #5904 from hughbe/windows-cmake
Add support for building Swift on Windows with clang-cl and MSVC
2017-02-24 07:52:11 +07:00
practicalswift
33a5601ad1 [gardening] Fix typos 2017-02-23 22:46:40 +01:00
Hugh Bellamy
781820b470 Fixup omitting frame pointers on various compilers and architectures (#7626)
* Omit leaf frame pointers on i686 architectures

This is x86. See the root CMakeLists.txt file
```
elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86")
set(SWIFT_HOST_VARIANT_ARCH_default "i686")
```

* Use the correct flags to omit leaf frame pointers with clang-cl and MSVC

* Don't omit leaf frame pointers on 64 bit architectures
2017-02-22 11:17:17 +07:00
Hugh Bellamy
3d5396794f Fix misc compiler flags passed to MSVC/clang-cl 2017-02-20 17:07:11 +07:00
Hugh Bellamy
b60945fbd8 [CMake] Use correct compiler flag for unoptimized MSVC/clang-cl builds 2017-02-20 15:15:32 +07:00
swift-ci
25722bb750 Merge pull request #7632 from hughbe/msvc-specific 2017-02-19 23:45:57 -08:00
Hugh Bellamy
9f9da4b647 [CMake] Simplify consecutive identical if statements 2017-02-20 14:04:24 +07:00
Hugh Bellamy
0da22a2e53 Fixup Windows specific compiler flags passed to MSVC/Clang-cl 2017-02-20 14:03:33 +07:00
Hugh Bellamy
1098e61ae1 Fix debug info flags passed to MSVC/clang-cl 2017-02-20 13:38:49 +07:00
Hugh Bellamy
119faa8cfe Don't attempt to set a custom linker when building with MSVC/clang-cl on Windows 2017-02-18 13:11:37 +07:00
Hugh Bellamy
03a9709b33 Don't pass -nostdlib when linking with MSVC/Clang-cl 2017-02-18 12:58:41 +07:00
Hugh Bellamy
097a18e4cc Merge pull request #7559 from hughbe/cmake-dead-code
[CMake] remove some unused functions and versioning dead code
2017-02-18 00:09:46 +07:00
Hugh Bellamy
aba6d41648 [CMake] remove redundant generator expression checks
The minimum version of CMake is 3.4.3
2017-02-17 14:33:08 +07:00
Hugh Bellamy
9746582ece [CMake] Replace manual fatal error messages in AddSwift.cmake with preconditions 2017-02-17 11:51:15 +07:00
Chris Bieneman
01b36c061a [CMake] Re-apply all the changes from PR7500
This was reverted in PR7517 as collateral for an unrelated issue.
2017-02-16 10:07:28 -08:00
Hugh Bellamy
cd34d544cb Merge pull request #7487 from hughbe/link-flags-common
Consolidate common fuse-ld linker flag setting in AddSwift
2017-02-16 19:05:31 +07:00
Michael Gottesman
8437819b5a [CMake] Revert recent changes.
These changes caused a number of issues:

1. No debug info is emitted when a release-debug info compiler is built.
2. OS X deployment target specification is broken.
3. Swift options were broken without any attempt any recreating that
functionality. The specific option in question is --force-optimized-typechecker.

Such refactorings should be done in a fashion that does not break existing
users and use cases.

This reverts commit e6ce2ff388.
This reverts commit e8645f3750.
This reverts commit 89b038ea7e.
This reverts commit 497cac64d9.
This reverts commit 953ad094da.
This reverts commit e096d1c033.

rdar://30549345
2017-02-15 22:26:06 -08:00
swift-ci
191a19c4bb Merge pull request #7500 from llvm-beanz/cmake-buildtree-package 2017-02-15 13:02:11 -08:00
Hugh Bellamy
3fae0fbdec Consolidate common fuse-ld linker flag setting in AddSwift 2017-02-15 16:15:03 +07:00
Hugh Bellamy
bc432e639b Cleanup CMake _require_empty list 2017-02-15 15:20:12 +07:00
Chris Bieneman
497cac64d9 [CMake] Add support for Swift buildtrees including CMake packages
This patch generates SwiftExports.cmake and SwiftConfig.cmake in the build tree to be compatible with CMake's `find_package` function for importing targets between CMake build trees. This will allow LLDB to consume Swift's targets and infer their transitive dependencies.
2017-02-14 19:23:13 -08:00
Chris Bieneman
953ad094da [CMake] Fix up an issue encountered in Linux PR testing
This should fix out-of-tree LLDB builds.

This patch overrides the output directories setup by llvm_add_library.
This is required because swift deviates from the LLVM convention of using the LLVM_*_INTDIR variables.

This was causing failures on LLDB's PR testing because LLDB has a terrible mechanism for picking the swift libraries. It finds all the .a files by searching a directory.
2017-02-14 14:50:50 -08:00
Chris Bieneman
e096d1c033 [CMake] Simplify add_swift_library
This patch splits add_swift_library into two functions one which handles
the simple case of adding a library that is part of the compiler being
built and the second handling the more complicated case of "target"
libraries, which may need to build for one or more targets.

The new add_swift_library is built using llvm_add_library, which re-uses
LLVM's CMake modules. In adapting to use LLVM's modules some of
add_swift_library's named parameters have been removed and
LINK_LIBRARIES has changed to LINK_LIBS, and LLVM_LINK_COMPONENTS
changed to LINK_COMPONENTS.

This patch also cleans up libswiftBasic's handling of UUID library and
headers, and how it interfaces with gyb sources.

add_swift_library also no longer has the FILE_DEPENDS parameter, which
doesn't matter because llvm_add_library's DEPENDS parameter has the same
behavior.
2017-02-14 14:28:10 -08:00
John McCall
038303b1b1 Switch MetadataCache to use a global slab allocator.
This seems to more than fix a performance regression that we
detected on a metadata-allocation microbenchmark.

A few months ago, I improved the metadata cache representation
and changed the metadata allocation scheme to primarily use malloc.
Previously, we'd been using malloc in the concurrent tree data
structure but a per-cache slab allocator for the metadata itself.
At the time, I was concerned about the overhead of per-cache
allocators, since many metadata patterns see only a small number
of instantiations.  That's still an important factor, so in the
new scheme we're using a global allocator; but instead of using
malloc for individual allocations, we're using a slab allocator,
which should have better peak, single-thread performance, at the
cost of not easily supporting deallocation.  Deallocation is
only used for metadata when there's contention on the cache, and
specifically only when there's contention for the same key, so
leaking a little isn't the worst thing in the world.

The initial slab is a 64K globally-allocated buffer.
Successive slabs are 16K and allocated with malloc.

rdar://28189496
2017-02-14 11:10:44 -05:00
Chris Bieneman
44b6f32f0e Clean up handling of CMark library dependency.
This change depends on:

https://github.com/apple/swift-cmark/pull/4
2017-02-08 14:32:50 -08:00
swift-ci
37c7641c38 Merge pull request #7258 from gottesmm/swift_force_optimized_typechecker 2017-02-05 18:22:34 -08:00
Saleem Abdulrasool
a891f544a1 Merge pull request #7134 from compnerd/exherbo
build: avoid re-including system paths
2017-02-05 17:49:02 -08:00
Michael Gottesman
fee2db81de [cmake] Add a new option called SWIFT_FORCE_OPTIMIZED_TYPECHECKER that forces Sema to be built optimized.
This should help speed up people trying to compile the standard library and do
SILGen work. *NOTE* This will not necessarily result in a type checker that is
as fast as a release build since most likely the type checker will use some
link_once odr functions that are debug. But it should still be significantly
faster otherwise.

This makes getting to SILGen take 16 seconds on my machine instead of forever
when compiling with everything else in the compiler in debug mode.
2017-02-05 16:48:54 -08:00
Doug Coleman
9e11d8dc7e cmake: For overlays, install to sdk-overlay target by default, but don't
hardcode it.

rdar://problem/21952953
2017-02-02 14:46:57 -08:00
Saleem Abdulrasool
e8aa6cba16 build: avoid re-including system paths
Do not add the (default) system include path as a system include path.
Doing so results in a `-isystem /usr/.../include`.  This changes the
include ordering, resulting in the failure to include headers from the
system when building the standard library.  This breaks compilation on
exherbo which uses a slightly different directory structure
(/usr/include -> /usr/host/include -> /usr/<target>/include).  If the
paths are canonicalised during the build, we would then add
/usr/<target>/include to the CPPFLAGS, resulting in the failure to
include C headers.  Unfortunately, this is insufficient as another site
is also including the path as a SYSTEM include path.  But, this is still
strictly an improvement.
2017-01-29 14:04:25 -08:00
John McCall
2b25701a93 Revert "Switch MetadataCache to use a global slab allocator."
This reverts commit ccbe5fcf73.
2017-01-29 00:17:30 -05:00
John McCall
ccbe5fcf73 Switch MetadataCache to use a global slab allocator.
This seems to more than fix a performance regression that we
detected on a metadata-allocation microbenchmark.

A few months ago, I improved the metadata cache representation
and changed the metadata allocation scheme to primarily use malloc.
Previously, we'd been using malloc in the concurrent tree data
structure but a per-cache slab allocator for the metadata itself.
At the time, I was concerned about the overhead of per-cache
allocators, since many metadata patterns see only a small number
of instantiations.  That's still an important factor, so in the
new scheme we're using a global allocator; but instead of using
malloc for individual allocations, we're using a slab allocator,
which should have better peak, single-thread performance, at the
cost of not easily supporting deallocation.  Deallocation is
only used for metadata when there's contention on the cache, and
specifically only when there's contention for the same key, so
leaking a little isn't the worst thing in the world.

The initial slab is a 64K globally-allocated buffer.
Successive slabs are 16K and allocated with malloc.

rdar://28189496
2017-01-28 02:37:22 -05:00
practicalswift
a9d6d8938c [gardening] Fix recently introduced typos 2017-01-22 20:40:45 +01:00
Hugh Bellamy
e2755c1058 Move Windows specific compiler definitions from _add_link_flags to _add_compile_flags 2017-01-18 10:23:28 +00:00
Han Sangjin
a8dec7fa43 [stdlib] Fixed for Cygwin
- CYGWIN symbol is used to distinguish Cygwin environment from other OS
  and other environment in Windows.
- Added windows and windowsCygnus to OSVersion in StdlibUnittest
2017-01-17 02:31:16 +09:00