Commit Graph

919 Commits

Author SHA1 Message Date
Saleem Abdulrasool
ac6edab22e Merge pull request #6025 from hughbe/remote-msvc
Port swift/remote to Windows and MSVC
2016-12-10 12:54:35 -08:00
Hugh Bellamy
53744b9b5a Fix errors and warnings building swift/remote on Windows using MSVC 2016-12-10 16:05:01 +00:00
Erik Eckstein
7dbab5a54e Mangling: symbol macro for objc partial apply forwarder 2016-12-09 09:05:19 -08:00
Erik Eckstein
af24045941 Mangling: correct mangling of partial apply forwarders
Plus some refactoring in the demangler
2016-12-09 09:05:18 -08:00
Erik Eckstein
d94dd580f6 Mangling: de- and re-mangling of GenericTypeParamDecl
This is also missing in the old mangling
2016-12-09 09:05:17 -08:00
Erik Eckstein
11d8207d0e Mangling: Select the correct mangling scheme for the re-mangler in the compiler 2016-12-09 09:05:15 -08:00
Joe Groff
15a2432efb Merge pull request #6135 from jckarter/use-sil-box-field-accessors-4
Mangle SILBoxTypes with their layout.
2016-12-08 21:09:31 -08:00
Joe Groff
7429ffb228 Mangle SILBoxTypes with their layout.
Use a new mangling scheme that describes the layout of compound boxes. For compatibility with reflection-based clients, continue to use the legacy mangling for single-field boxes when emitting reflection TypeRefs until we fully support reflection for the new box implementation.
2016-12-08 20:02:44 -08:00
Michael Gottesman
0bfda96ace [sil-func-extractor] Teach sil-extract to extract a list of functions and the inverse of a list of functions. Also rename to sil-func-extractor to make it clearer what it is doing.
This will allow for modules to be split from the command line using a script.

The one thing that is missing from this still is that it does not handle shared
functions in IMO a satisfactory way. Given that we are splitting a module, my
feeling that the correct way to do this is to create a public shim for the
shared function in the module that the shared function gets put in and let all
other users use that entry point.

But I need to think about this a bit more.
2016-12-08 18:29:33 -08:00
practicalswift
3e31a3ade4 [gardening] Fix typos. 2016-12-06 21:42:01 +01:00
practicalswift
cfdaf9f14a [gardening] Fix invalid Swift URLs. 2016-12-06 20:12:20 +01:00
Erik Eckstein
280f908554 Mangling: fix symbol mangling macros 2016-12-05 12:34:25 -08:00
Michael Gottesman
35edd1364a [gardening] Remove unneeded implementations of none_of/count_if/count.
These are now provided upstream by LLVM.
2016-12-04 03:50:00 -08:00
Erik Eckstein
684092d7d1 Mangling: mangler, demangler and remangler classes for the new mangling scheme.
Following classes provide symbol mangling for specific purposes:
*) Mangler: the base mangler class, just providing some basic utilities
*) ASTMangler: for mangling AST declarations
*) SpecializationMangler: to be used in the optimizer for mangling specialized function names
*) IRGenMangler: mangling all kind of symbols in IRGen

All those classes are not used yet, so it’s basically a NFC.

Another change is that some demangler node types are added (either because they were missing or the new demangler needs them).
Those new nodes also need to be handled in the old demangler, but this should also be a NFC as those nodes are not created by the old demangler.

My plan is to keep the old and new mangling implementation in parallel for some time. After that we can remove the old mangler.
Currently the new implementation is scoped in the NewMangling namespace. This namespace should be renamed after the old mangler is removed.
2016-12-02 15:55:30 -08:00
Erik Eckstein
76820edda9 Mangling: support for special encoding ASCII of characters which may not appear in symbol names.
Such characters (like ‘.’) can be punycode-encoded just like non-ASCII unicode characters.
2016-12-02 15:55:30 -08:00
Erik Eckstein
97f1fac11e Mangling: refactoring: use meta-programming for value witness mangling/demangling/remangling
Also add the missing DestructiveInjectEnumTag entry.
2016-12-02 15:55:30 -08:00
Erik Eckstein
f52f3559c8 Mangling: add a dumpNode function to make it easier from the debugger to dump a node tree 2016-12-02 15:55:30 -08:00
Hugh Bellamy
56dfb08727 Port swift/basic to Windows 2016-12-02 16:57:00 +00:00
Xi Ge
7a58f00b6d [utils] Modify writeEdit() to take multiple edits instead of a single one to help preserve the correct json format. NFC 2016-12-01 12:47:09 -08:00
Xi Ge
f1113b2677 [Utils] Expose edit serialization utility for more clients. 2016-11-28 12:55:27 -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
David Farler
f450f0ccdf Revert "Preserve whitespace and comments during lexing as Trivia"
This reverts commit d6e2b58382.
2016-11-18 13:23:31 -08:00
Slava Pestov
a760186505 AST: Remove -enable-experimental-nested-generic-types flag 2016-11-18 00:39:15 -08:00
David Farler
d6e2b58382 Preserve whitespace and comments during lexing as Trivia
Store leading a trailing "trivia" around a token, such as whitespace,
comments, doc comments, and escaping backticks. These are syntactically
important for preserving formatting when printing ASTs but don't
semantically affect the program.

Tokens take all trailing trivia up to, but not including, the next
newline. This is important to maintain checks that statements without
semicolon separators start on a new line, among other things.

Trivia are now data attached to the ends of tokens, not tokens
themselves.

Create a new Syntax sublibrary for upcoming immutable, persistent,
thread-safe ASTs, which will contain only the syntactic information
about source structure, as well as for generating new source code, and
structural editing. Proactively move swift::Token into there.

Since this patch is getting a bit large, a token fuzzer which checks
for round-trip equivlence with the workflow:

fuzzer => token stream => file1
  => Lexer => token stream => file 2 => diff(file1, file2)

Will arrive in a subsequent commit.

This patch does not change the grammar.
2016-11-15 16:11:57 -08:00
practicalswift
38351faefc [gardening] Fix recently introduced typos 2016-11-11 18:35:01 +01:00
EMatejska
1fa8dd45bc Adding getSwiftRevision(). This is to aid cleaning up some lldb code that could use this API. 2016-11-07 00:06:22 -08:00
practicalswift
d58f3cc06a [gardening] Fix inconsistent header 2016-11-05 13:08:36 +01:00
John McCall
d123345689 Provide a frontend option to disable typo correction.
rdar://29003217
2016-11-02 14:08:56 -07:00
Graydon Hoare
0755ca6b6b [Compile perf] Add include/swift/Basic/Statistic.h helper 2016-11-02 09:48:56 -07:00
Michael Ilseman
5d540ababd [Swift version] Note all supported versions when -swift-version is misused. 2016-10-18 14:43:21 -07:00
Michael Ilseman
12efcc9db6 [Version] Don't allow effective sub-versions, only major versions
Also offer a note when the major version is valid on its own.
2016-10-18 14:43:21 -07:00
Mishal Shah
09cbffb3e4 Initialize CachedVFile with nullptr 2016-10-14 15:29:18 -07:00
practicalswift
566bfc0d56 [gardening] Fix typos. 2016-10-13 22:19:08 +02:00
Saleem Abdulrasool
c2617483b7 Merge pull request #5155 from compnerd/ilist-dereference
SIL: Avoid dereferencing sentinel nodes in ilist_iterators
2016-10-12 14:20:08 -07:00
Francis Ricci
66dcad0d34 SIL: Avoid dereferencing sentinel nodes in ilist_iterators
The behaviour of ilist has changed in LLVM.  It is no longer permissible to
dereference the `end()` value.  Add a check to ensure that we do not
accidentally dereference the iterator.
2016-10-12 11:46:31 -07:00
Graydon Hoare
7183f9cc66 Add conversion operator between version::Version and clang::VersionTuple 2016-10-12 11:20:42 -07:00
Michael Ilseman
12fb0bad7b [swift-version] Allow swift-version 4 and tests
The recent @escaping on variadic argument closures back-compat fix is
the first Swift 3.0 compatibility behavior that we don't want to carry
forwards indefinitely into the future. To address this, we
version-gate the diagnostic suppression.

Makes it an official compatibility check. Creates new test directory
for compatibility testing. Allow -swift-version 4 so that we can test
it both ways.
2016-10-11 17:42:25 -07:00
Michael Gottesman
9884c7a0b7 Fix small obvious typo. Thanks for catching this Bob! 2016-10-07 17:20:29 -07:00
Slava Pestov
ca28cf6488 AST: Remove special mangling for Self archetype of a protocol
With a bit of work, we can re-purpose the existing
QualifiedArchetype mangling to cover this case.

This allows us to get rid of a usage of
ArchetypeType::getSelfProtocol(), which we want to remove.
2016-10-04 03:54:01 -04:00
Slava Pestov
745a4a3974 IRGen: Disable resilient class metadata unless -enable-class-resilience is passed in
Resilient classes are not fully implemented yet, and can cause
crashes at runtime; add a flag disabling them until the code is
done, to unblock standard library testing with resilience
enabled.
2016-09-30 18:28:11 -07:00
Graydon Hoare
8970d44675 Add "-swift-version <n>" that sets LangOpts.EffectiveLanguageVersion.
This flag switches the "effective language version" of the compiler,
at least to any version supported (as of this change: "3" or "3.0").

At the moment nothing uses it except the language version build
configuration statements (#if swift(...)) and various other places
that report, encode, or otherwise check version numbers.

In the future, it's intended as scaffolding for backwards compatibility.

Fixes SR-2582
2016-09-20 15:11:37 -07:00
Jordan Rose
81284f5756 Merge pull request #4777 from jrose-apple/fix-it-trailing-closure-ambiguity
Offer fix-its to disambiguate based on a trailing closure's label.
2016-09-15 13:03:47 -07:00
Jordan Rose
5746671a19 Add -verify-apply-fixes to accompany -verify.
Enables Chris's auto-apply-fixes mode for -verify: if an expected-*
annotation has the wrong message, or if the expected fix-its are
incorrect, this option will **edit the original file** to update them.

This is a tool for compiler developers only; it doesn't affect
normal diagnostic printing or normal fix-its.
2016-09-15 10:38:43 -07:00
practicalswift
9185c052a9 [gardening] Fix inconsistent headers 2016-09-14 20:48:28 +02:00
adrian-prantl
d0f16bf9f9 Merge pull request #4697 from adrian-prantl/28231982
Bump the DWARF format to version 4 on Darwin.
2016-09-13 10:13:51 -07:00
Adrian Prantl
9f060dc5b7 Bump the DWARF format to version 4 on all platforms.
This unifies the output across all supported platforms and
brings swiftc in sync with clang.

<rdar://problem/28231982>
2016-09-12 09:31:38 -07:00
Michael Gottesman
b48b4d96fe Merge remote-tracking branch 'origin/master' into master-next 2016-09-07 15:35:07 -07:00
Xi Ge
a901fc4a88 [utils] Add a util to help printing with colors. NFC (#4665)
* [utils] Add a util to help printing with colors. NFC

* Update macro guard for consistency.

* add some doc-comments.
2016-09-07 13:58:15 -07:00
Doug Gregor
2552f41556 [Name lookup] Add a staging flag for ASTScope-based name lookup. 2016-09-06 09:05:11 -07:00
Michael Gottesman
fa1bb95923 Merge remote-tracking branch 'origin/master' into master-next 2016-08-30 19:50:12 -07:00