Commit Graph

814 Commits

Author SHA1 Message Date
Joe Groff
825e02e2f1 Remove -enable-import-objc-generics staging flag. 2016-04-25 14:25:11 -07:00
Joe Groff
c49a992598 Turn on import of ObjC generics. 2016-04-25 11:56:13 -07:00
Zhuowei Zhang
7c502b6344 Port to Android
This adds an Android target for the stdlib. It is also the first
example of cross-compiling outside of Darwin.

Mailing list discussions:

1. https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151207/000171.html
2. https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000492.html

The Android variant of Swift may be built using the following `build-script`
invocation:

```
$ utils/build-script \
  -R \                                           # Build in ReleaseAssert mode.
  --android \                                    # Build for Android.
  --android-ndk ~/android-ndk-r10e \             # Path to an Android NDK.
  --android-ndk-version 21 \
  --android-icu-uc ~/libicu-android/armeabi-v7a/libicuuc.so \
  --android-icu-uc-include ~/libicu-android/armeabi-v7a/icu/source/common \
  --android-icu-i18n ~/libicu-android/armeabi-v7a/libicui18n.so \
  --android-icu-i18n-include ~/libicu-android/armeabi-v7a/icu/source/i18n/
```

Android builds have the following dependencies, as can be seen in
the build script invocation:

1. An Android NDK of version 21 or greater, available to download
   here: http://developer.android.com/ndk/downloads/index.html.
2. A libicu compatible with android-armv7.
2016-04-12 19:26:21 -04:00
Slava Pestov
a3d5d5cc2c Add mangling for externally inlineable specializations
An upcoming change has the SIL Optimizer drop the [fragile]
attribute from the specialized callee, unless the caller
is itself [fragile].

Since we need to distinguish specializations from fragile
and non-fragile contexts, add a new mangling node to
represent this concept.
2016-04-08 02:10:31 -07:00
Anna Zaks
92fae2e9a4 Add experimental support for Thread Sanitizer.
This patch threads the TSan option through the front end.
2016-04-06 11:53:43 -07:00
practicalswift
abfecfde17 [gardening] if ([space]…[space]) → if (…), for(…) → for (…), while(…) → while (…), [[space]x, y[space]] → [x, y] 2016-04-04 16:22:11 +02:00
swift-ci
48543ed7e7 Merge pull request #1986 from danra/use_algorithm_max 2016-03-31 18:57:11 -07:00
Dan Raviv
5082ae7f3b Use constexpr max from Swift/Basic/Algorithm instead of reimplementing it 2016-03-31 21:05:34 +03:00
Chris Lattner
821c2cb98f Merge pull request #1796 from danra/swift_basic_sanitize
Canonicalize swift header files headers and footers
2016-03-29 17:31:53 -07:00
danra
0c84db9507 Fix methods return type ampersand location (NFC) 2016-03-30 00:19:33 +03:00
practicalswift
c015b6eb47 Merge pull request #1906 from practicalswift/gardening-20160328b
[gardening] Remove unused code, fix PEP 8 regression, fix typos.
2016-03-28 23:16:28 +02:00
practicalswift
ce62c46207 [gardening] Fix recently introduced typo: "desireable" → "desirable" 2016-03-28 21:52:02 +02:00
Chris Willmore
3bcb169f0b Import lightweight Objective-C generics as Swift generic type
parameters.
2016-03-28 09:50:30 -07:00
Ted Kremenek
cc9d134e0e Merge pull request #1872 from danra/demangle-printer-no-dangling-ref
Refactor DemanglePrinter to eliminate the possibility of storing a da…
2016-03-26 13:47:07 -07:00
Michael Gottesman
cef48078d7 Merge pull request #1863 from danra/patch-45
Add constexpr version of maximum
2016-03-26 12:35:46 -07:00
Dmitri Gribenko
79a6f33213 Merge pull request #1868 from danra/patch-32-fix
operator!= DRY
2016-03-25 22:36:23 -07:00
Jordan Rose
90f91a4219 Merge pull request #1842 from danra/patch-37
Fix includes order - system should follow local
2016-03-25 16:47:12 -07:00
Michael Ilseman
b01caa01c6 Merge remote-tracking branch 'origin/master' into import-as-member 2016-03-25 15:47:47 -07:00
Dan Raviv
703cd37067 Add missing periods in comments (NFC) 2016-03-25 14:14:19 -07:00
danra
17dc943081 Fix includes order 2016-03-25 14:14:19 -07:00
Dan Raviv
8b2028d630 Add missing word in DiverseListImpl comment 2016-03-25 14:14:19 -07:00
John McCall
0afd09eaf3 Only use metadata patterns for generic types; perform other
initialization in-place on demand.  Initialize parent metadata
references correctly on struct and enum metadata.

Also includes several minor improvements related to relative
pointers that I was using before deciding to simply switch the
parent reference to an absolute reference to get better access
patterns.

Includes a fix since the earlier commit to make enum metadata
writable if they have an unfilled payload size.  This didn't show
up on Darwin because "constant" is currently unenforced there in
global data containing relocations.

This patch requires an associated LLDB change which is being
submitted in parallel.
2016-03-25 14:14:19 -07:00
danra
f2a339386c Use auto instead of repeating explicit class names 2016-03-25 14:14:19 -07:00
danra
4e11ce58c5 Use auto instead of repeating explicit class names 2016-03-25 14:14:19 -07:00
danra
c76cd68811 operator!= DRY 2016-03-25 14:14:19 -07:00
danra
bb3631dbd0 Remove redundant else 2016-03-25 14:14:19 -07:00
danra
d1250857fd Add missing period in comment 2016-03-25 14:14:19 -07:00
danra
5a1da59741 Compact getEnd implementation 2016-03-25 14:14:19 -07:00
danra
ed31834229 isInvalid methods DRY 2016-03-25 14:14:19 -07:00
danra
d8cb0b664a Remove extra spaces in empty-body ctors
Currently some empty-body ctors in the file have a space, some don't. Canonized it.
2016-03-25 14:14:19 -07:00
danra
f77393c06b operator!= DRY 2016-03-25 14:14:19 -07:00
danra
6f195f025a move copy-append before move-append overload
This is consistent with the usual convention of having copy methods before move methods (which is also used in this file in previous methods).
2016-03-25 14:14:19 -07:00
danra
2272897c5d Improve template typenames consistency
Rename BlotMapVector's template typenames: MapTy -> MapT and VectorTy -> VectorT. This is consistent both with BlotMapVector's other template typename KeyT and ValueT, and with SmallBlotMapVector's MapT and VectorT template typenames.
2016-03-25 14:14:19 -07:00
Dan Raviv
89545329b5 Consistently name stacks as 'stack' instead of 'queue'
Currently some stacks are named 'stack' and some are named 'queue' with a comment saying 'actually a stack'. Just call these a 'stack' as well.
2016-03-25 21:26:45 +03:00
Dan Raviv
3948212413 Refactor DemanglePrinter to eliminate the possibility of storing a dangling reference.
Before the refactor, a dangling reference to a string may be stored in a DemanglePrinter in at least the following cases:
1) If an lvalue DemanglePrinter is initialized with an rvalue string:
DemanglePrinter printer("abc");
2) If an lvalue DemanglePrinter is initialized with an lvalue string which doesn't live as long as the printer:
unique_ptr<DemanglePrinter> printer;
{
  std::string s = "abc";
  printer = make_unique<DemanglePrinter>(s);
}
// Reference stored in printer is dangling

In addition, in all existing cases in the code where an lvalue DemanglePrinter is used, an empty string is initialized just before it, which isn't DRY, and is related to the previous problem - the coder shouldn't be expected to maintain the lifetime of a string separate from the DemanglePrinter which references it.

In addition, before the refactor, in any in-line use of DemanglePrinter it is constructed with an empty string parameter (in which to construct the string), but this doesn't look very clean.

The refactor solves the above issues by maintaining its own string as a member, while still enabling the original intent of being able to use DemanglePrinter both as an lvalue constructively before getting its value, and in-line as an rvalue.
2016-03-25 16:11:53 +03:00
Dan Raviv
28491f3f03 Add missing periods in comments (NFC) 2016-03-25 12:02:13 +03:00
Dan Raviv
3a46559c1b operator!= DRY 2016-03-25 11:55:49 +03:00
Dmitri Gribenko
e9ab667e3a Merge pull request #1811 from danra/patch-21
move copy-append before move-append overload (NFC)
2016-03-25 00:51:27 -07:00
Dmitri Gribenko
70e4354868 Merge pull request #1787 from danra/patch-13
Improve template typenames consistency
2016-03-25 00:51:06 -07:00
Dmitri Gribenko
47fe51ddd0 Merge pull request #1836 from danra/patch-31
operator!= DRY
2016-03-25 00:48:54 -07:00
Chris Lattner
833f73a00b Merge pull request #1838 from danra/patch-33
Remove extra spaces in empty-body ctors
2016-03-24 22:52:59 -07:00
Chris Lattner
e0c9c1a163 Merge pull request #1840 from danra/patch-35
Compact getEnd implementation
2016-03-24 22:52:22 -07:00
Chris Lattner
d968c4dbf6 Merge pull request #1841 from danra/patch-36
Add missing period in comment
2016-03-24 22:50:49 -07:00
Chris Lattner
96dea07bdd Merge pull request #1848 from danra/patch-42
Use auto instead of repeating explicit class names
2016-03-24 22:38:54 -07:00
Chris Lattner
a4a0118e38 Merge pull request #1855 from danra/patch-43
Use auto instead of repeating explicit class names
2016-03-24 22:37:40 -07:00
Chris Lattner
2753606c3e Merge pull request #1843 from danra/patch-38
Remove redundant else
2016-03-24 22:37:26 -07:00
Chris Lattner
4d64953776 Merge pull request #1862 from danra/patch-44
Fix includes order
2016-03-24 22:27:17 -07:00
Ted Kremenek
93e518c167 Merge pull request #1839 from danra/patch-34
isInvalid methods DRY
2016-03-24 22:09:21 -07:00
swift-ci
ecf1e10e5a Merge pull request #1844 from danra/patch-39
Merge pull request #${ghprbPullId} from ${ghprbPullAuthorLogin}/${ghprbSourceBranch} requested by ${ghprbTriggerAuthorLogin}
2016-03-24 17:33:26 -07:00
danra
978e851a0e Add constexpr version of maximum to algorithm
Add the constexpr version of max which is only available in std since c++14.
Besides being a logical addition next to the already implemented constexpr version of min, there are actually other files, even in Swift/Basic itself, which re-implement this functionality, such as PrefixMap.h. Once this is implemented here, the functionality can be re-used in those other locations, instead of re-implemented each time.
2016-03-25 00:58:09 +02:00