Commit Graph

1066 Commits

Author SHA1 Message Date
swift-ci
916301772e Merge pull request #7819 from jrose-apple/time-for-an-update 2017-02-28 12:33:23 -08:00
Jordan Rose
c5f452b443 -debug-time-compilation: Fix 2f21735 to actually distinguish phases.
https://bugs.swift.org/browse/SR-4100
2017-02-28 11:31:13 -08:00
practicalswift
99ceb78c7d Merge pull request #7723 from practicalswift/gardening-20170223
[gardening] Shell fixes. Consistent headers. a-vs-an typos. Python fixes. Unused variables and methods.
2017-02-27 14:05:05 +01:00
Mark Lacey
0d356d7674 Merge pull request #7738 from rudkx/constraint-propagation
Add an empty constraint propagation pass.
2017-02-26 21:56:10 -08:00
Erik Eckstein
2f8b626e8b Demangler: fix a wrong alignment assert
It broke the 32-bit library build
2017-02-25 07:55:32 -08:00
Erik Eckstein
7d7dc5aaac Demangler: Use a bump-pointer allocator for node allocation.
This makes the demangler about 10 times faster.
It also changes the lifetimes of nodes. Previously nodes were reference-counted.
Now the returned demangle  node-tree is owned by the Demangler class and it’s lifetime ends with the lifetime of the Demangler.

Therefore the old (and already deprecated) global functions demangleSymbolAsNode and demangleTypeAsNode are no longer available.

Another change is that the demangling for reflection now only supports the new mangling (which should be no problem because
we are generating only new mangled names for reflection).
2017-02-24 19:04:13 -08:00
Erik Eckstein
437d4da38d Demangling: Remove StringRef-versions of demangling functions from demangle_wrappers because they are now available in Demangle itself.
This is just refactoring. NFC.
2017-02-24 15:19:18 -08:00
practicalswift
246cfa6c16 [gardening] Use consistent headers 2017-02-24 09:37:37 +01:00
Mark Lacey
f32824296a Add an empty constraint propagation pass.
This is disabled by default but enabled under the frontend option
-propagate-constraints.

The idea here is to have a pass that enforces local consistency in our
constraint system, in order to reduce the domains of constraint
variables, speeding up the solving of the constraint system.

The initial focus will be on reducing the size of the disjunctions for
function overloads with the hope that it substantially improves the
performance of type checking many expressions.
2017-02-23 15:04:07 -08:00
Hugh Bellamy
32260e6475 Merge pull request #7588 from hughbe/swiftSyntax-win32
Port swiftSyntax to Windows
2017-02-22 10:26:24 +07:00
practicalswift
e44af328fb [gardening] Fix incorrect Swift URLs. 2017-02-21 14:20:34 +01:00
Hugh Bellamy
b564a917be Port swiftSyntax to Windows 2017-02-21 08:24:56 +07:00
Erik Eckstein
a35cd0e36c Demangler: fix the function specialization de-mangling
The order in which the argument parameters were de-mangled was wrong.

rdar://problem/30592808
2017-02-20 16:39:37 -08:00
Xi Ge
7a791862f5 Clean-up: fix a unused private field warning. 2017-02-18 11:32:33 -08:00
David Farler
3645736ac0 Merge pull request #7393 from bitjammer/syntax-tree
Start the Syntax structured editing library
2017-02-17 15:26:00 -08:00
David Farler
7ee42994c8 Start the Syntax library and optional full token lexing
Add an option to the lexer to go back and get a list of "full"
tokens, which include their leading and trailing trivia, which
we can index into from SourceLocs in the current AST.

This starts the Syntax sublibrary, which will support structured
editing APIs. Some skeleton support and basic implementations are
in place for types and generics in the grammar. Yes, it's slightly
redundant with what we have right now. lib/AST conflates syntax
and semantics in the same place(s); this is a first step in changing
that to separate the two concepts for clarity and also to get closer
to incremental parsing and type-checking. The goal is to eventually
extract all of the syntactic information from lib/AST and change that
to be more of a semantic/symbolic model.

Stub out a Semantics manager. This ought to eventually be used as a hub
for encapsulating lazily computed semantic information for syntax nodes.
For the time being, it can serve as a temporary place for mapping from
Syntax nodes to semantically full lib/AST nodes.

This is still in a molten state - don't get too close, wear appropriate
proximity suits, etc.
2017-02-17 12:57:04 -08:00
Erik Eckstein
8a6a9461d3 Only mangle non-private top-level classes and protocol with the old-style for the ObjC metadata.
Only those types can be de-mangled by the ObjC runtime anyway.
Also move this mangling logic into the ASTMangler class. This avoids keeping the old mangler around just for that purpose.
2017-02-16 18:20:05 -08:00
Erik Eckstein
2df8d5e8ad Let the demangler handle old-style mangled ObjC runtime type names.
This avoids linking the full old demangler into the swift runtime.
2017-02-16 18:20:05 -08:00
Erik Eckstein
2d127e4192 Reinstate ”Use the new mangling for reflection."
It also uses the new mangling for type names in meta-data (except for top-level non-generic classes).
lldb has now support for new mangled metadata type names.

This reinstates commit 21ba292943.
2017-02-15 09:47:22 -08:00
Erik Eckstein
86e7bdeed8 Demangler: Use a fixed-size array for Word substitutions.
There can be at most 26 word substitutions.
This avoids some memory allocations and is a work-around for the asan problem rdar://problem/30406870
2017-02-15 09:47:22 -08:00
practicalswift
8af31961b2 Merge pull request #7464 from practicalswift/gardening-20170214b
[gardening] Fix recently introduced typos
2017-02-14 21:10:52 +01:00
Michael Gottesman
de47e4fe3a [diverse-stack] Add some more helper methods to diverse stack and unittests for that functionality.
rdar://29791263
2017-02-14 11:14:16 -08:00
practicalswift
65b0219f7b [gardening] Fix typos 2017-02-14 20:04:08 +01:00
Doug Gregor
dca8553615 [Mangling] Remove "archetype" mangling node.
The mangler never produces a mangling here, the demangler doesn't
demangle anything here, the remangler punted or asserted, and type
reconstruction did something very wrong. Delete this code.
2017-02-13 15:56:30 -08:00
Hugh Bellamy
f001b7562b Use relatively new LLVM_FALLLTHROUGH instead of our own SWIFT_FALLTHROUGH 2017-02-12 10:47:03 +07:00
Doug Gregor
2495f17ff5 Merge pull request #7388 from DougGregor/rename-archetype-builder
Rename ArchetypeBuilder -> GenericSignatureBuilder
2017-02-10 14:44:34 -08:00
Doug Gregor
579af863c5 Rename ArchetypeBuilder -> GenericSignatureBuilder 2017-02-10 12:46:34 -08:00
Erik Eckstein
ebe19757e1 Demangler: add a new API for the demangler which enables bump-pointer allocation of demangling nodes.
Instead of a global demangleSymbolAsNode, which returns a reference-counted NodePointer, there is now a Context class which owns the nodes.
So now demangleSymbolAsNode is a member of Context and the returned NodePointer is alive as long as the Context is alive.

This is still a NFC: the new ABI still maps to the old functions.
The purpose of this change is to let lldb adapt to the new API and then we can switch to the new implementation.
2017-02-10 12:25:58 -08:00
Michael Gottesman
2872ef382b [gardening] Fix doxygen diverse stack header. 2017-02-09 21:45:03 -08:00
Erik Eckstein
479237b9ac Mangling: isSwiftSymbol should get a null terminated string rather than a char pointer + length
This avoids doing a strlen in lldb when calling this function.

rdar://problem/30062026
2017-02-09 14:05:00 -08:00
Hugh Bellamy
9ea5934618 Merge pull request #7335 from hughbe/clang-warnings
Fix unknown command tag name warnings
2017-02-09 08:06:56 +07:00
Erik Eckstein
254f36aba5 Revert "Use the new mangling for reflection."
This needs some changes in lldb.
Disabled for now until lldb supports the new mangling.

This reverts commit 21ba292943.
2017-02-08 09:01:51 -08:00
Hugh Bellamy
c65b49f52e Fix unknown command tag name warnings 2017-02-08 21:37:48 +07:00
Erik Eckstein
21ba292943 Use the new mangling for reflection.
For this we are linking the new re-mangler instead of the old one into the swift runtime library.
Also we are linking the new de-mangling into the swift runtime library.

It also switches to the new mangling for class names of generic swift classes in the metadata.
Note that for non-generic class we still have to use the old mangling, because the ObjC runtime in the OS depends on it (it de-mangles the class names).
But names of generic classes are not handled by the ObjC runtime anyway, so there should be no problem to change the mangling for those.
The reason for this change is that it avoids linking the old re-mangler into the runtime library.
2017-02-07 08:36:21 -08:00
Erik Eckstein
e6f2e7bc88 Mangling: add a few utility functions in the new mangler and demangler which will be used by reflection mangling 2017-02-07 08:36:21 -08:00
swift-ci
5d2a18560c Merge pull request #7197 from rintaro/diagverify-unknown 2017-02-06 17:47:04 -08:00
swift-ci
014abc3b4f Merge pull request #7088 from graydon/rdar-29684330-count-constraint-solving-memory-more-precisely 2017-02-06 14:55:55 -08:00
Graydon Hoare
9cb1c52fd8 Count constraint-solving memory more precisely, rdar://29684330 2017-02-06 13:04:19 -08:00
Michael Gottesman
e192b56a88 [silgen] Create CleanupManager::dump and the relevant dump methods to dump the current cleanups.
This is useful to discover when a specific cleanup is being eliminated while
debugging. The implementation is compiled out when assertions are disabled.

rdar://29791263
2017-02-05 18:38:41 -08:00
Rintaro Ishizaki
384ab780e9 [Diagnostic verifier] Make '<unknown>' check optional
Added frontend option '-verify-ignore-unknown'
2017-02-02 10:49:32 +09:00
Erik Eckstein
81384b6f82 demangler: Add API functions for classifying symbols.
To be used by lldb.
Also add a -classify option in swift-demangler to test those new API functions.
2017-01-31 17:27:10 -08:00
Andrew Trick
e9c559b718 [SILGen] Bootstrapping opaque values (#7113)
[NFC] Add -enable-sil-opaque-values frontend option.

This will be used to change the SIL-level calling convention for opaque values,
such as generics and resilient structs, to pass-by-value.  Under this flag,
opaque values have SSA lifetimes, managed by copy_value and destroy_value.

This will make it easier to optimize copies and verify ownership.

* [SILGen] type lowering support for opaque values.

Add OpaqueValueTypeLowering.
Under EnableSILOpaqueValues, lower address-only types as opaque values.

* [SIL] Fix ValueOwnershipKind to support opaque SIL values.

* Test case: SILGen opaque value support for Parameter/ResultConvention.

* [SILGen] opaque value support for function arguments.

* Future Test case: SILGen opaque value specialDest arguments.

* Future Test case: SILGen opaque values: emitOpenExistential.

* Test case: SIL parsing support for EnableSILOpaqueValues.

* SILGen opaque values: prepareArchetypeCallee.

* [SIL Verify] allow copy_value for EnableSILOpaqueValues.

* Test cast: SIL serializer support for opaque values.

* Add a static_assert for ParameterConvention layout.

* Test case: Mandatory SILOpt support for EnableSILOpaqueValues.

* Test case: SILOpt support for EnableSILOpaqueValues.

* SILGen opaque values: TypeLowering emitCopyValue.

* SILBuilder createLoad. Allow loading opaque values.

* SIL Verifier. Allow loading and storing opaque values.

* SILGen emitSemanticStore support for opaque values.

* Test case for SILGen emitSemanticStore.

* Test case for SIL mandatory support for inout assignment.

* Fix SILGen opaque values test case after rebasing.
2017-01-27 18:56:53 -08:00
Hugh Bellamy
a2daee58c6 Merge pull request #7055 from hughbe/unreachable
Cleanup swift_unreachable
2017-01-27 08:55:04 +00:00
Andrew Trick
1abeddcc5d [SILType] SILFunctionConventions API.
Separate formal lowered types from SIL types.
The SIL type of an argument will depend on the SIL module's conventions.
The module conventions are determined by the SIL stage and LangOpts.

Almost NFC, but specialized manglings are broken incidentally as a result of
fixes to the way passes handle book-keeping of aruments. The mangler is fixed in
the subsequent commit.

Otherwise, NFC is intended, but quite possible do to rewriting the logic in many
places.
2017-01-26 15:35:48 -08:00
Hugh Bellamy
5a59971b95 Move Unreachable.h from include/Basic to include/Runtime 2017-01-26 15:31:33 +00:00
Erik Eckstein
4d00ac1bba New mangling: add a -new-mangling-for-tests option.
This option enables the new mangling for everything except the Swift stdlib module.
Used to switch test files explicitly to the new mangling.
2017-01-24 15:27:45 -08:00
Hugh Bellamy
2852512197 Simplify implementation of swift_unreachable (#6941) 2017-01-24 05:38:41 -08:00
Erik Eckstein
a56a97c89f Mangling: prepare for using new mangling for USR and debug-info type generation.
Select between old and new mangling as we already do in other places in the compiler.
NFC as long as the new mangling is not enabled yet.
2017-01-23 17:49:00 -08:00
Robert Widmann
3eba4fd3ab Merge pull request #6787 from matthewcarroll/SR-3175-Include-signal-number-in-parseable-output-message
SR-3175: Include the terminating signal number in the driver output
2017-01-18 11:00:59 -07:00
Bob Wilson
24a61b5b5d Merge branch 'master-next'
This merge contains the changes to accompany the switch to the new stable
branches of llvm, clang, and compiler-rt that are based on swift-4.0-branch.
2017-01-18 09:22:52 -08:00