Commit Graph

19 Commits

Author SHA1 Message Date
Egor Zhdan
84a1ffcb33 [Shims] Include SwiftShims headers without ../
This replaces a number of `#include`-s like this:
```
#include "../../../stdlib/public/SwiftShims/Visibility.h"
```
with this:
```
#include "swift/shims/Visibility.h"
```

This is needed to allow SwiftCompilerSources to use C++ headers which include SwiftShims headers. Currently trying to do that results in errors:
```
swift/swift/include/swift/Demangling/../../../stdlib/public/SwiftShims/module.modulemap:1:8: error: redefinition of module 'SwiftShims'
module SwiftShims {
       ^
Builds.noindex/swift/swift/bootstrapping0/lib/swift/shims/module.modulemap:1:8: note: previously defined here
module SwiftShims {
       ^
```
This happens because the headers in both the source dir and the build dir refer to SwiftShims headers by relative path, and both the source root and the build root contain SwiftShims headers (which are equivalent, but since they are located in different dirs, Clang treats them as different modules).
2022-09-14 11:14:50 +01:00
Saleem Abdulrasool
04eeff5b8d runtime: remove llvm/Support header usage
This reduces the dependency on `LLVMSupport`.  This is the first step
towards helping move towards a local fork of the LLVM ADT to ensure that
static linking of the Swift runtime and core library does not result in
ODR violations.
2020-05-07 13:36:13 -07:00
Saleem Abdulrasool
b74f42602a runtime: add and switch to SWIFT_USED (NFC)
This further trims dependencies to LLVMSupport by introducing the
equivalent `SWIFT_USED` macro.
2020-05-06 21:19:14 -07:00
Saleem Abdulrasool
f465ec0345 runtime: add and switch to SWIFT_NOINLINE (NFC)
This switches the `LLVM_ATTRIBUTE_NOINLINE` to a local copy which is
namespaced in Swift.
2020-05-06 14:07:20 -07:00
Greg Parker
58c9b45c78 [runtime] Clean up symbols in StdlibUnittest and the internal leak checker.
* Export fewer symbols.
* Prefix exported but not-public symbols with `_swift_`.
2017-10-24 13:13:43 -07:00
Arnold Schwaighofer
d0810fcce8 Add missing terminating quotation character in include line 2017-02-16 06:48:06 -08:00
Arnold Schwaighofer
1af4fb401c Add missing include
The leaks bot complains about not knowning what SWIFT_CC is.
2017-02-15 10:55:50 -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
00b7c2ed70 Use LLVM_* attributes in the runtime 2017-02-11 17:30:01 +07:00
Hugh Bellamy
63cf2d561e Remove extern "C" from uses of SWIFT_RUNTIME_EXPORT 2017-01-22 18:32:17 +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
Robert Widmann
dc88e51321 Nuke entry-point-based process args
Provides a new fallback for Process arguments for those instances where we do
not own main (e.g. Frameworks, Objective-C owns main.m or main.c, etc.). This
includes a number of platform-specific specializations of argument grabbing
logic and a new thread-safe interface to Process.unsafeArgv.

main()  | _NSGetArgc/_NSGetArgv    | /proc/self/cmdline     | __argc/__argv
--------|--------------------------|------------------------|---------------
Scripts | OS X, iOS, tvOS, watchOS | Linux, FreeBSD, Cygwin | Windows

For interpreted Swift where we must filter out the arguments we now do so by
loading the standard library and calling into new SPI to override the arguments
that would have been grabbed by the runtime. This implementation completely
subsumes the use of the entry point  '_stdlib_didEnterMain' and it will be
removed in a future commit.
2016-07-14 01:06:19 -07:00
Saleem Abdulrasool
81661fca61 stdlib: use the reserved attribute spellings
This is a purely mechanical change replacing the attributes with the reserved
spelling.  Compilers are to not error when they encounter a reserved spelling
for an attribute which they do not support.
2016-05-11 11:30:24 -07:00
Michael Gottesman
1b7ecf5fc7 Fix the leaks checker bot.
Sadly it looks like someone took down my leaks checking bot a couple of months
ago. =--(. This updates the code to compile with Swift today.
2016-03-08 18:31:11 -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
a3f857ca7b [gardening] Add "-*- C++ -*-" to header files currently missing it 2016-01-23 11:53:05 +01:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Dmitri Hrybenko
350248dae5 Reorganize the directory structure under 'stdlib'
The standard library has grown significantly, and we need a new
directory structure that clearly reflects the role of the APIs, and
allows future growth.

See stdlib/{public,internal,private}/README.txt for more information.

Swift SVN r25876
2015-03-09 05:26:05 +00:00