Commit Graph

1737 Commits

Author SHA1 Message Date
Doug Gregor
d2cb7a607f [Omit needless words] "Scale" is a verb.
Fixes rdar://problem/24817973.
2016-04-26 17:11:04 -07:00
Doug Gregor
b6c68449a7 [Omit needless words] Don't avoid keywords that will be allowed after '.'.
In anticipation of SE-0071, teach the Clang importer to only avoid
dynamicType/self/Protocol/init as base names. Fixes
rdar://problem/25399965.
2016-04-26 17:02:35 -07:00
Doug Gregor
a82cc07ee0 [Omit needless words] Strip context from "set" methods.
Fixes rdar://problem/25750367.
2016-04-26 16:42:35 -07:00
Doug Gregor
6e680798ae [Omit needless words] Treat "separated by" as a single preposition.
Fixes rdar://problem/25883450.
2016-04-26 16:05:08 -07:00
Doug Gregor
97e89471fe [Omit needless words] Treat "bound by" as a preposition.
Fixes rdar://problem/25729953.
2016-04-26 15:23:55 -07:00
Michael Gottesman
46296aa190 Merge remote-tracking branch 'origin/master' into master-next 2016-04-20 14:03:03 -07:00
Saleem Abdulrasool
0c32cb3972 Basic: include missing header (#2239)
We use SmallVector, but do not include the header.  Include it explicitly.  NFC.
2016-04-18 19:50:17 -07:00
Michael Gottesman
0c1f6db23b [upstream-update] Add our own LLVM global context now that llvm::getGlobalContext() was removed upstream.
Swift relies on this for now. So create our own. This makes more sense
than trying to add back in the API (which is dead besides the c api) or
use the c api itself. We should probably consider not using a global
context like this.
2016-04-18 07:29:58 -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
practicalswift
ea0ac3ac67 [gardening] Remove all tabs in C++ code 2016-04-08 21:22:57 +02: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
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
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
Michael Ilseman
47e73ad4f1 Merge branch 'master' of github.com:apple/swift into import-as-member 2016-03-23 17:01:47 -07:00
Michael Ilseman
d7581d1b36 Merge commit 'a31edf53d0580efe47f4e9ef89dccc4429c056e8' into import-as-member 2016-03-23 13:05:57 -07:00
David Farler
5ca4b428eb [TypeRef] Add isStruct, isClass, isEnum accessors
These will be used during layout calculation and for nicer
printing.
2016-03-17 19:03:13 -07:00
Michael Ilseman
71e5b17efb [String Extras] fix escaping value bug 2016-03-10 10:49:19 -08:00
Michael Ilseman
32faa62502 [Import as member] Lower case initialisms 2016-03-09 14:26:43 -08:00
Ted Kremenek
b796305846 Merge pull request #1371 from hpux735/thumb
Added thumb to supported platforms conditions
2016-03-08 22:10:13 -08:00
David Farler
e958f99acf Revert "Mangle declared interface type into NominalTypeDescriptor's Name"
This reverts commit 2262bd579a.

This information isn't necessary for field descriptor lookup,
after all. It's only the fields that need to have generic information,
which is already in the field descriptor.
2016-03-03 12:55:35 -08:00
David Farler
2262bd579a Mangle declared interface type into NominalTypeDescriptor's Name
Previously, the mangling didn't include generics, but these are
needed to key off of the new field descriptor metadata, as well
as to construct type references for the nominal type.
2016-03-03 12:14:38 -08:00
AnnaZaks
767d9ca914 Merge pull request #1434 from apple/asan
[asan] Add basic support for Address Sanitizer function instrumentation
2016-02-29 18:58:40 -08:00
Doug Gregor
87f1d577a3 [Omit needless words] Retain "with" after splitting more regularly.
The verb-based heuristic was unpredictable and not clearly
better. Back off to something more obvious.
2016-02-29 13:14:24 -08:00
Doug Gregor
b890e4c29f [Omit needless words] Use the property lists to restrict BaseNameSelf pruning.
This eliminates some apparent inconsistencies in the translation,
fixing rdar://problem/24860176.
2016-02-29 13:14:23 -08:00
practicalswift
34188788a1 [gardening] Sort file listings in CMakeLists.txt files 2016-02-27 19:50:30 +01:00
zaks
2110235fd3 [asan] Cleanup based on Jordan's review comments 2016-02-26 16:02:40 -08:00
zaks
d727c68fde [asan] Add "unsupported option .. for target" error message
ASan support for Linux does not exist at this point.
2016-02-25 15:20:51 -08:00
zaks
ef925f8fb3 [asan] Add basic support for Address Sanitizer function instrumentation
ASan allows to catch and diagnose memory corruption errors, which are possible
when using unsafe pointers.

This patch introduces a new driver/frontend option -sanitize=address to enable
ASan. When option is passed in, the ASan llvm passes will be turned on and
all functions will gain SanitizeAddress llvm attribute.
2016-02-24 09:45:38 -08:00
zaks
f049c24a02 Introduce a helper to make switching on darwin platforms less error prone
Introduce DarwinPlatformKind, which would allow us to switch on darwin
platforms instead of copying and pasting the brittle logic in several places.
Use the helper method to simplify ClangImporter.
2016-02-23 19:09:25 -08:00
Doug Gregor
5290a381b4 [Omit needless words] Stop moving "of" onto the base name.
The benefits from moving "of" onto the base name were outweighed by
the complications to the API guidelines.
2016-02-23 10:24:03 -08:00
Dmitri Gribenko
7235595264 Merge pull request #1108 from tinysun212/porting-to-cygwin
Porting to cygwin
2016-02-22 18:53:30 -08:00
Doug Gregor
4e16f625b1 [Omit needless words] "de-" is a verb prefix.
... and handle verb prefixes properly.
2016-02-22 14:11:09 -08:00
Erik Eckstein
27929cba2a Support for mangling of generic specializations with different reabstraction.
This will be needed when the generic specializer will be able to change indirect arguments/results to direct arguments/results.
2016-02-22 13:58:10 -08:00
Doug Gregor
24cede9543 [Omit needless words] Treat "Mask" as a skippable type suffix.
Fixes rdar://problem/23751733.
2016-02-22 11:39:20 -08:00
Doug Gregor
03fe1d0a35 [Omit needless words] More Cocoa verbs: activate, deactivate, reattach.
Fixes rdar://problem/23556916.
2016-02-22 11:22:09 -08:00
Han Sangjin
e06c7136cb Porting to Cygwin. rebased and squashed 2016-02-22 13:20:21 +09:00
William Dillon
390e50c999 Added thumb to supported platforms conditions 2016-02-21 16:56:02 +00:00
Doug Gregor
4b116d0e26 [Omit needless words] enqueue/dequeue are verbs 2016-02-16 16:17:56 -08:00
Doug Gregor
bc18e4521b [Omit needless words] After "by", recognize gerunds more liberally. 2016-02-12 16:40:10 -08:00
Jordan Rose
c90511a74e Merge pull request #1289 from jrose-apple/conditional-compilation-blocks
Rename "build configurations" to "conditional compilation blocks".
2016-02-12 14:02:21 -08:00
Doug Gregor
1cd7a8611d [Omit needless words] Introduce set-specific verbs. 2016-02-12 12:52:13 -08:00
Doug Gregor
0e46850a66 [Omit needless words] "ObjectValue" in the name matches "Object" in the type.
Fixes rdar://problem/24618946.
2016-02-12 12:41:40 -08:00
Jordan Rose
6272941c5c Rename "build configurations" to "conditional compilation blocks".
...because "build configuration" is already the name of an Xcode feature.

- '#if' et al are "conditional compilation directives".
- The condition is a "conditional compilation expression", or just
  "condition" if it's obvious.
- The predicates are "platform conditions" (including 'swift(>=...)')
- The options set with -D are "custom conditional compilation flags".
  (Thanks, Kevin!)

I left "IfConfigDecl" as is, as well as SourceKit's various "BuildConfig"
settings because some of them are part of the SourceKit request format.
We can change these in follow-up commits, or not.

rdar://problem/19812930
2016-02-12 11:09:26 -08:00
Doug Gregor
bdfedf70ed [Omit needless words] Treat "passing" as a preposition 2016-02-12 10:53:35 -08:00
Doug Gregor
a87782e414 [Omit needless words] Handle "extended prepositions" like "compatible with".
Also, be more careful not to produce base names that are keywords.
2016-02-12 10:33:59 -08:00
Doug Gregor
f61aa7a86e [Omit needless words] Prepend is a verb. 2016-02-11 16:44:06 -08:00
Doug Gregor
90af7e60e7 [Omit needless words] "Of" associates left except when determining properties of the result. 2016-02-11 16:44:05 -08:00
Doug Gregor
4bbdec1cfc [Omit needless words] "update" is a verb. 2016-02-11 16:44:05 -08:00
Doug Gregor
e720333032 [Omit needless words] Only move "lonely of" arguments back to the base name.
If the first argument label would end up as "of" following splitting
and pruning, move that "of" onto the base name.
2016-02-11 16:44:05 -08:00
Doug Gregor
643725f75a [Omit needless words] The preposition "of" binds to the word preceding it. 2016-02-11 16:44:05 -08:00