Commit Graph

265 Commits

Author SHA1 Message Date
swift-ci
36b254df94 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-03-08 01:58:15 -08:00
swift-ci
52a9d71e70 Merge remote-tracking branch 'origin/master' into master-next 2018-03-08 01:49:10 -08:00
Sho Ikeda
cea6c03eb2 [gardening] Use !empty() over size() > 0 2018-03-08 09:21:09 +09:00
swift-ci
6c60b1d3e7 Merge remote-tracking branch 'origin/master' into master-next 2018-03-06 16:49:22 -08:00
swift-ci
73f148384e Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-03-06 16:38:13 -08:00
Sho Ikeda
26d650292f [gardening] Use empty() over size() == 0 2018-03-05 14:43:13 +09:00
swift-ci
d3871e9d24 Merge remote-tracking branch 'origin/master' into master-llvm-swift5-transition 2018-01-29 14:08:58 -08:00
swift-ci
328391d927 Merge remote-tracking branch 'origin/master' into master-next 2018-01-29 13:42:47 -08:00
Greg Parker
e223f1fc9b [IRGen][runtime] Simplify runtime CCs and entry point ABIs (#14175)
* Remove RegisterPreservingCC. It was unused.
* Remove DefaultCC from the runtime. The distinction between C_CC and DefaultCC
  was unused and inconsistently applied. Separate C_CC and DefaultCC are
  still present in the compiler.
* Remove function pointer indirection from runtime functions except those
  that are used by Instruments. The remaining Instruments interface is
  expected to change later due to function pointer liability.
* Remove swift_rt_ wrappers. Function pointers are an ABI liability that we
  don't want, and there are better ways to get nonlazy binding if we need it.
  The fully custom wrappers were only needed for RegisterPreservingCC and
  for optimizing the Instruments function pointers.
2018-01-29 13:22:30 -08:00
swift-ci
d782c18cff Merge remote-tracking branch 'origin/master' into master-next 2017-12-19 14:29:52 -08:00
Joe Shajrawi
91d763e5ac Lower the FunctionMergeThreshold from 30 to 15 2017-12-19 11:20:33 -08:00
Bob Wilson
47dde9695d [master-next] Update to use ModRefInfo enum from llvm r320107 2017-12-08 16:51:49 -08:00
Arnold Schwaighofer
3ae6d7cb4d runtime/IRGen: return the argument from swift_retain family of functions
On architectures where the calling convention uses the same argument register as
return register this allows the argument register to be live through the calls.

We use LLVM's 'returned' attribute on the parameter to facilitate this.

We used to perform this optimization via an optimization pass. This was ripped
out some time ago around commit 955e4ed652.
By using LLVM's 'returned' attribute on swift_*retain, we get the same
optimization from the LLVM backend.
2017-09-19 07:16:37 -07:00
swift-ci
a9bcdddb77 Merge remote-tracking branch 'origin/master' into master-next 2017-05-24 17:48:35 -07:00
Erik Eckstein
d342041420 Mangling: use ‘Tm’ mangling for merged functions
Previously merged functions just got the name with a “_merged” suffix
2017-05-24 17:00:16 -07:00
Michael Gottesman
28df98f971 Merge remote-tracking branch 'origin/master' into master-next 2017-05-08 14:57:21 -07:00
Michael Gottesman
3f1a3c7cb8 [llvm-arc] Remove dead incorrect code.
The code I am ripping out was meant to look at the input argument, not the
return value so was incorrect. Luckily this code was actually dead since whether
or not we returned no capture or unknown, we bailed.

Since the code is already dead, just rip it out.
2017-05-08 12:06:31 -07:00
Bob Wilson
8d61e93e81 Adapt to LLVM r301812 rename of WeakVH to WeakTrackingVH 2017-05-07 22:25:49 -07:00
Bob Wilson
e917b3cabf Tidy loop iterator to match the MergeFunctions.cpp change from LLVM r273808 2017-05-07 22:23:34 -07:00
Bob Wilson
4051d57d12 Adjust for LLVM r302060: avoid ArgNo+1 attribute indexing 2017-05-06 22:01:34 -07:00
swift-ci
502bda365b Merge remote-tracking branch 'origin/master' into master-next 2017-05-05 13:48:34 -07:00
practicalswift
492f5cd35a [gardening] Remove redundant repetition of type names (DRY): RepeatedTypeName foo = dyn_cast<RepeatedTypeName>(bar)
Replace `NameOfType foo = dyn_cast<NameOfType>(bar)` with DRY version `auto foo = dyn_cast<NameOfType>(bar)`.

The DRY auto version is by far the dominant form already used in the repo, so this PR merely brings the exceptional cases (redundant repetition form) in line with the dominant form (auto form).

See the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es11-use-auto-to-avoid-redundant-repetition-of-type-names) for a general discussion on why to use `auto` to avoid redundant repetition of type names.
2017-05-05 09:45:53 +02:00
Bob Wilson
c35eed4964 Update SwiftMergeFunctions::replaceDirectCallers to match LLVM r300272 2017-04-16 22:05:15 -07:00
Bob Wilson
dcf374dbed Adjust for LLVM r299949: Remove nullptr for Module::getOrInsertFunction
Module::getOrInsertFunction no longer needs the trailing nullptr argument,
and leaving it there causes a crash.
2017-04-13 14:35:07 -07:00
Bob Wilson
bd81b41de4 Update Swift master-next after LLVM API change in r300014.
AttributeSet was added back again, wrapping AttributeSetNode*.
2017-04-13 11:25:22 -07:00
swift-ci
6b8c0aa04a Merge remote-tracking branch 'origin/master' into master-next 2017-04-11 20:28:32 -07:00
Saleem Abdulrasool
cfb9da8dfe Adjust for SVN r299899 2017-04-11 18:19:49 -07:00
Erik Eckstein
f3a7824028 MergeFunctions: now really handle self recursions correctly.
fixes rdar://problem/31519893
2017-04-11 13:57:29 -07:00
Bob Wilson
701ed9d907 Merge remote-tracking branch 'origin/master' into master-next 2017-04-07 15:36:24 -07:00
Erik Eckstein
2584078e3c MergeFunctions: handle self recursive functions correctly.
First, it fixes a crash where the eliminated function is still referenced.
This shows up if two equivalent self-recursive functions are merged and those functions are internal.
Fixes SR-4514, rdar://problem/31479425

Second, it avoids creating a not needed parameter for really equivalent self recursive functions.
2017-04-07 14:21:26 -07:00
Saleem Abdulrasool
15565c116a Adjust for SVN r298393 2017-03-22 07:44:03 -07:00
Erik Eckstein
5e80555c9b demangler: put the demangler into a separate library
Previously it was part of swiftBasic.

The demangler library does not depend on llvm (except some header-only utilities like StringRef). Putting it into its own library makes sure that no llvm stuff will be linked into clients which use the demangler library.

This change also contains other refactoring, like moving demangler code into different files. This makes it easier to remove the old demangler from the runtime library when we switch to the new symbol mangling.

Also in this commit: remove some unused API functions from the demangler Context.

fixes rdar://problem/30503344
2017-03-09 13:42:43 -08: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
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
practicalswift
65b0219f7b [gardening] Fix typos 2017-02-14 20:04:08 +01:00
Hugh Bellamy
f001b7562b Use relatively new LLVM_FALLLTHROUGH instead of our own SWIFT_FALLTHROUGH 2017-02-12 10:47:03 +07:00
practicalswift
0193f2b872 [gardening] Fix typos 2017-02-04 09:22:38 +01:00
Erik Eckstein
36c807b0d1 LLVM passes: use new FunctionComparator utility in the SwiftMergeFunctions pass.
Now that the FunctionComparator is a separate utility in LLVM, the SwiftMergeFunctions pass can use it instead of duplicating the code.
This is pure refactoring. NFC.
2017-01-27 13:53:13 -08:00
Han Sangjin
b8dd577693 [swiftc] Fixed for Cygwin
Fixed for the difference of Cygwin with other Windows variants (MSVC,
Itanium, MinGW).

- The platform name is renamed to "cygwin" from "windows" which is used
  for searching the standard libraries.

- The consideration for DLL storage class (DllExport/DllImport) is not
  required for Cygwin and MinGW. There is no problem when linking in
  these environment.

- Cygwin should use large memory model as default.(This may be changed
  if someone ports to 32bit)

- Cygwin and MinGW should use the autolink feature in the sameway of
  Linux due to the linker's limit.
2017-01-19 05:48:24 +09:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Michael Gottesman
59c6a64f5a [gardening] 0 => nullptr. Fixed with clang-tidy. 2016-12-06 23:14:13 -08:00
Hugh Bellamy
1aa951dfb2 Fix errors and warnings building swift/IRGen on Windows using MSVC (#5958) 2016-11-30 13:27:02 -08:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
practicalswift
4552fc8f88 [gardening] Use American English: "behaviour" → "behavior" 2016-11-05 20:33:57 +01:00
Michael Gottesman
b018645418 [semantic-arc] Add __swift_endBorrow support to LLVMPasses and make sure it is removed by LLVMARCContract.cpp. 2016-10-17 14:43:28 -07:00
Michael Gottesman
1ed04f8d94 [semantic-arc] Use BaseModRef effects from LLVMSwift.def in LLVMSwiftAA instead of a switch. 2016-10-17 14:43:28 -07:00
Michael Gottesman
7f45e39af6 [semantic-arc] Update parsing of Swift function names in LLVM to use LLVMSwift.def. 2016-10-17 14:43:28 -07:00
Michael Gottesman
21ec1109fa [semantic-arc] Add LLVMSwift.def for metaprogramming Swift Operations in LLVM.
For semantic ARC I need to add an endBorrow entrypoint that will be removed by
ARCContract.cpp. In the process I am doing a little bit of cleanup.

In this commit, I only use this to generate the enum RT_Kind in LLVMARCOpts.h. I
verified it was the same using a diff tool. I am going to do further updates in
subsequent commits to make the diff easy to see.
2016-10-17 14:43:28 -07:00
Saleem Abdulrasool
8e1a88e985 LLVMPasses: fix DLL storage for merged functions
When constructing the body of the merged function, the internal function is
given internal linkage always.  It is only accessible through the adjusting
thunks which retain the original DLL storage.  Ensure that we reset the DLL
storage which it inherited from the first function.
2016-10-06 08:09:23 -07:00
Erik Eckstein
bd0d2bfed4 Remove the LLVM stack promotion pass and related SIL optimization logic.
It's not needed anymore because array buffers are now allocated with alloc_ref instead of a swift_bufferAllocate runtime call.
2016-09-16 11:02:19 -07:00