Commit Graph

85 Commits

Author SHA1 Message Date
Saleem Abdulrasool
635bb00d61 runtime: make LLP64 clean
This is a blanket pass replacing use of `__LP64__` with
`__POINTER_WIDTH__ == 64`.  The latter is more expressive and also LLP64
clean.  This change is needed to enable support for Windows x86_64 which
is a LLP64 environment.
2017-09-17 18:41:10 -07:00
practicalswift
861f70e13d [gardening] Use consistent spacing 2017-04-25 21:03:43 +02:00
Hugh Bellamy
5b017954be Don't use swift calling convention for now with clang-cl on Windows to work around a crasher 2017-03-21 19:18:36 +07:00
Hugh Bellamy
4d45092c34 Cleanup uses of __asm__ in the runtime 2017-03-08 17:32:44 +07:00
practicalswift
1475ab63fb [gardening] Remove duplicate #include:s 2017-03-02 16:19:57 +01:00
Hugh Bellamy
bb34e2a959 Fix attribute fallout from new refcount representation 2017-03-02 19:44:37 +07:00
practicalswift
5b4bf0f74c [gardening] Remove duplicate include. 2017-02-21 14:20:34 +01:00
Hugh Bellamy
a6515200f4 Attempt to fix Linux build - __has_attribute(swiftcall) doesn't work on Linux 2017-02-20 17:58:58 +07:00
Hugh Bellamy
bddebc58b8 Don't define SWIFT_USE_SWIFTCALL if there is no such attribute 2017-02-20 10:16:30 +07:00
Hugh Bellamy
a570f6b87b Merge pull request #7405 from hughbe/visual-studio-bug
Work around Visual Studio bug inferring type of auto
2017-02-18 09:26:40 +07:00
Arnold Schwaighofer
6c35202565 Conditionalize usage of llvm::CallingConv::Swift on SWIFT_USE_SWIFTCALL macro 2017-02-14 12:17:57 -08:00
Arnold Schwaighofer
39fa2f0228 Use the swift calling convention for swift functions
Use the generic type lowering algorithm described in
"docs/CallingConvention.rst#physical-lowering" to map from IRGen's explosion
type to the type expected by the ABI.

Change IRGen to use the swift calling convention (swiftcc) for native swift
functions.

Use the 'swiftself' attribute on self parameters and for closures contexts.

Use the 'swifterror' parameter for swift error parameters.

Change functions in the runtime that are called as native swift functions to use
the swift calling convention.

rdar://19978563
2017-02-14 12:17:57 -08:00
Hugh Bellamy
a94f65cb5e Include llvm/Support/Compiler.h wherever we use __has_attribute 2017-02-12 09:30:22 +07:00
Hugh Bellamy
cdb73ae193 Fix undefined __USER_LABEL_PREFIX compiling swift/LLVMPasses 2017-01-09 21:17:18 +00:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01: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
Roman Levenstein
56d55dec2b [swift-runtime] Rename rt_swift_* to swift_rt_*. NFC
Swift uses rt_swift_* functions to call the Swift runtime without using dyld's stubs. These functions are renamed to swift_rt_* to reduce namespace pollution.

rdar://28706212
2016-10-11 09:49:06 -07:00
Dmitri Gribenko
dfb4f56e55 runtime: rename _TMps8Hashable to HashableProtocolDescriptor 2016-08-31 09:53:39 -07:00
Bryan Chan
85fde8b1fb Add support for Linux s390x. LLVM's Swift calling convention support is used to ensure correct operations of C++ code in the runtime. This patch also includes some (incomplete) changes to enum handling to make enums work in most common cases. 2016-05-24 20:03:28 -04:00
John McCall
50d58b2732 Add a lot of calling-convention annotations to the standard library / runtime.
The general rule here is that something needs to be SWIFT_CC(swift)
if it's just declared in Swift code using _silgen_name, as opposed to
importing something via a header.

Of course, SWIFT_CC(swift) expands to nothing by default for now, and
I haven't made an effort yet to add the indirect-result / context
parameter ABI attributes.  This is just a best-effort first pass.

I also took the opportunity to shift a few files to just implement
their shims header and to demote a few things to be private stdlib
interfaces.
2016-05-04 10:31:23 -07:00
Roman Levenstein
b985794992 Prepare IRGen and LLVM passes to use the new preserve_most calling convention, but do not enable it yet.
The convention should be enabled once we can properly build the runtime library using Siwft's own clang/llvm binaries.
2016-04-01 14:19:47 -07:00
Peter Cooper
7ec0e7348f Add more calls to the objc runtime for getting an object’s ISA.
Be more conservative in terms of masking ISAs.  This reduces tight coupling with the objc runtime.  This commit adds the required calls to IRGen and the runtime, and a test case to make sure IRGen is correct.
2016-03-10 15:07:20 -08:00
practicalswift
35dbeef034 [gardening] Fix recently introduced typos
* currnet → current
* accidental double space ("  ") → intentional single space (" ")
* recordinf → recording
2016-03-02 22:25:46 +01:00
practicalswift
3a4968192b [gardening] Fix recently introduced typo: "enrty" → "entry" 2016-03-02 09:33:45 +01:00
Roman Levenstein
b3e60afcc7 Even if we use wrappers, runtime functions should be visible.
In principle, runtime entries could have a hidden visibility, because they are
never called directly from the code produced by IRGen.
But some of the runtime entries are invoked directly from the foundation.
Therefore they should be visible.
2016-02-25 08:51:19 -08:00
Roman Levenstein
2ff5755dc3 Use the "rt_" prefix for all generated wrappers to distinguish them from the actual runtime functions. 2016-02-25 06:00:30 -08:00
Roman Levenstein
99fd8b6080 Rename some macros based on the PR review comments.
- use  the SWIFT prefix for all macros
- make names of some macros shorter
2016-02-25 05:31:00 -08:00
Roman Levenstein
de3b850ce8 Use more descriptive names for calling conventions.
Rename RuntimeCC into DefaultCC
Rename RuntimeCC1 into RegisterPreservingCC
Remove RuntimeCC0 because it was identical to DefaultCC.
2016-02-25 05:31:00 -08:00
Roman Levenstein
fd9a22aca1 Prepare the configuration parameters needed for implementing a new runtime calling convention.
Define a number of macro definitions that will be used for:
- proper auto-generation of LLVM IR level declarations of runtime function using RuntimeFunctions.def
- generation of wrappers for runtime functions
- setting proper calling conventions, visibility and other attributes of runtime functions inside the runtime library.
2016-02-25 05:30:58 -08:00
Joe Groff
f7291b21ec Runtime: Build with -fvisibility=hidden.
...and explicitly mark symbols we export, either for use by executables or for runtime-stdlib interaction. Until the stdlib supports resilience we have to allow programs to link to these SPI symbols.
2016-02-08 08:06:02 -08:00
practicalswift
f91525a10f Consistent placement of "-*- [language] -*-===//" in header. 2016-01-04 09:46:20 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Joe Groff
9b4dc24721 Runtime: (Almost) cleanse of global constructors and destructors.
Configure the runtime to build with -Wglobal-constructors, and Lazy-fy almost everything that gets flagged. (I gave "swift_isaMask" a pass since that's almost definitely hot enough to warrant a static initialization.) Make some improvements to the Lazy wrapper, using aligned_storage to ensure that it's trivially constructed and destructed.

Swift SVN r28199
2015-05-06 04:59:56 +00:00
John McCall
590c25479d Use isa-masking to read the class object pointer from
instances of Swift subclasses of ObjC classes.

We were already doing this in the runtime.  This patch
unhides the runtime's mask word (swift_isaMask) and makes
IR-gen take advantage of it when it can.

Swift SVN r21592
2014-08-29 21:36:53 +00:00
John McCall
7b86817b3c Basic value structure for [weak] and [unowned] references.
Add a bunch of new entrypoints and give them terrible
implementations.

Swift SVN r6322
2013-07-17 09:20:20 +00:00