Commit Graph

19813 Commits

Author SHA1 Message Date
Rintaro Ishizaki
6872f6c0cb Merge pull request #19742 from AnthonyLatsis/class-var-override-compl
[CodeCompletion][Parser] Completions for overridable static members
2019-02-26 09:52:37 -08:00
swift-ci
aea757a6e9 Merge pull request #22910 from DougGregor/objc-renamed-protocol-metadata 2019-02-25 23:41:50 -08:00
Doug Gregor
b5f45f8f72 [IRGen] Mangle Swift @objc(renamed) protocols as Objective-C in metadata.
When emitting metadata for a Swift-defined @objc protocol that has
provided a specific Objective-C name (e.g., via @objc(renamed)),
mangle such protocols using their Objective-C names so they can be
found at runtime.

Only do this for metadata, because doing it anywhere else would cause
an ABI break. Fixes rdar://problem/47877748.
2019-02-25 17:31:08 -08:00
Saleem Abdulrasool
ed871d508b Merge pull request #22884 from compnerd/weak_cast
Remote: loosen a cast
2019-02-25 15:46:22 -08:00
Saleem Abdulrasool
b37d640c5d Merge pull request #22886 from compnerd/c++-from-c-is-sadness
Runtime: remove keypath functions in the compiler build
2019-02-25 15:45:46 -08:00
Rintaro Ishizaki
3c970418c3 [Gardening][AST] Eliminate 'numParameterLists'. (#22824)
Leftover from bfc4121971
2019-02-25 13:33:26 -08:00
Joe Groff
bb67cf815c Merge pull request #21355 from technicated/tuple-keypaths-2
Tuple KeyPaths
2019-02-25 12:56:05 -08:00
Saleem Abdulrasool
5066729677 Runtime: remove keypath functions in the compiler build
The host tools may be built with the host compiler.  cl objects to the
"extern C" function returning a C++ type which the keypath functions do.
However, these declarations are needed only in the runtime, which is
always built with clang.  Preprocess away the declarations during the
build of the compiler.  This allows us to build with cl once more.
2019-02-25 11:21:28 -08:00
Saleem Abdulrasool
40c3655838 Remote: loosen a cast
cl objects to the use of the reinterpret_cast for the casting between
integral types.  Loosen to a static_cast.
2019-02-25 11:19:47 -08:00
swift-ci
0e4f95ebbf Merge pull request #22870 from compnerd/old-school-cool 2019-02-24 19:50:11 -08:00
swift-ci
f166af1150 Merge pull request #22866 from compnerd/a-narrow-path 2019-02-24 18:44:50 -08:00
Saleem Abdulrasool
650ebeb14b ABI: use a c-style cast in the header (NFC)
Use a C-style cast to appease cl depending on the template type
parameters used.  It does not like a reinterpret_cast between integral
types.
2019-02-24 16:47:30 -08:00
Saleem Abdulrasool
0f20c486e0 Reflection: prevent address truncation on ELF64
Ensure that we use the address type as specified by ELF rather than
truncate to a 32-bit value.
2019-02-24 15:40:48 -08:00
Slava Pestov
84fbd0271a Merge pull request #22825 from slavapestov/remove-old-type-reconstruction
Remove TypeReconstruction.cpp
2019-02-23 01:26:54 -05:00
Slava Pestov
88bc29a511 Merge pull request #22775 from slavapestov/resilient-witness-table-cleanup
Resilient witness table emission cleanup
2019-02-22 21:55:52 -05:00
Arnold Schwaighofer
222a7546f9 Merge pull request #22712 from aschwaighofer/silgen_fix_superclass_init_dynamic_replacement
SILGen: Fix the logic of dynamic replacements for class constructors
2019-02-22 13:28:07 -08:00
Slava Pestov
6972c41d17 IDE: Remove TypeReconstruction.cpp! 2019-02-22 16:13:03 -05:00
Slava Pestov
4e55714376 ASTDemangler: Introduce new getTypeDeclForUSR() 2019-02-22 16:13:02 -05:00
Slava Pestov
d0d5fbdf39 ASTDemangler: Introduce new getTypeDeclForMangling()
This will replace getDeclFromMangledSymbolName().

Progress on <rdar://problem/47819208>.
2019-02-22 16:13:02 -05:00
Saleem Abdulrasool
3df60b4a84 SwiftRemoteMirror: fix static library builds for Windows
We were previously treating all the builds as shared, which is not the
case for the host library build of SwiftRemoteMirror.  The warnings were
lost in the interminable spew from the build which is now fixed and this
stands out.
2019-02-22 10:46:32 -08:00
Arnold Schwaighofer
8d9b9f328b SILGen: Fix the logic of dynamic replacements for class constructors
To correctly call designated super class initializers the designated
intializer (and not the allocator) is dynamically replaceable.
Convenience allocators are dynamically replaceable as before.
2019-02-22 10:15:06 -08:00
Arnold Schwaighofer
f820c6eb23 Merge pull request #22784 from aschwaighofer/diagnostic_objc_mismatch_dynamic_replacement
Diagnostic: dynamic replacement and replaced function's @objc attribu…
2019-02-22 09:24:08 -08:00
Slava Pestov
f6cb10b9fa SIL: Plumb ResilienceExpansion through TypeLowering more carefully
The basic theory here is as follows:

- The resilience expansion never changes the lowered type, only the
  SIL type category (object or address). This means that function
  types always pass resilient values indirectly regardless of
  expansion, etc.

- The getTypeLowering() methods all take an optional 'forExpansion'
  parameter. Soon, these will become non-optional and I'll audit all
  call sites to pass the right expansion; for convenience, the
  entry points on SILFunction will pass the right expansion.

Places I need to revisit and pass the right expansion in are marked
as 'FIXME: Expansion'.

For now, this just fixes a SILCombiner bug. After some more plumbing
this will enable SILGen to produce better code.

Progress on <rdar://problem/24057844>,
<https://bugs.swift.org/browse/SR-261>.
2019-02-22 02:34:36 -05:00
Slava Pestov
4d5a691090 SIL: Remove some obsolete mentions of 'uncurry level' from TypeLowering 2019-02-22 02:34:36 -05:00
Slava Pestov
a1b75cac54 SIL: Remove unused getSemanticType{,Lowering}() 2019-02-22 02:34:36 -05:00
Slava Pestov
5b3056cc28 SILBuilder: Fix incorrect logic in isLoadableOrOpaque() 2019-02-22 02:34:36 -05:00
Slava Pestov
a5e4fd555b Merge pull request #22801 from slavapestov/let-optimization-sillyness
Fix problems with resilient global optimization
2019-02-22 02:23:43 -05:00
Xi Ge
29dd7f81fa Merge pull request #22791 from nkcsgexi/serialization-group-diag
doc-serialization: diagnose missing group-info file or corrupted one.
2019-02-21 20:20:20 -08:00
Slava Pestov
23f7c4f6ee SILOptimizer: Fix potential crashes with uses of replaceLoadSequence()
This utility is generally a horrible idea but even worse the
callers were not doing anything to ensure the required
invariants actually held.

Add a new canReplaceLoadSequence() method and chek it in the
right places.
2019-02-21 23:06:21 -05:00
Xi Ge
ecd1e84526 doc-serialization: diagnose missing group-info file or corrupted one.
rdar://45903094
2019-02-21 15:28:35 -08:00
Daniel Rodríguez Troitiño
942d68e4eb Merge pull request #22632 from drodriguez/swift-reflection-dump-elf-32
[swift-reflection-dump] Support for ELF32.
2019-02-21 10:48:24 -08:00
Arnold Schwaighofer
315f47d19d Diagnostic: dynamic replacement and replaced function's @objc attribute must match
rdar://48259565
2019-02-21 08:12:51 -08:00
Mike Ash
82c33dc031 Merge pull request #22590 from mikeash/remote-mirror-interop-is-swift-mask
[RemoteMirror] Add a call to the interop header to set the upcoming classIsSwiftMask value.
2019-02-21 09:39:34 -05:00
Michael Gottesman
6ddc8589e8 [ownership] Treat mark_dependence as forwarding in its first parameter.
Previously, we only did this for the first parameter if it was converting from
escape to no-escape. We want to /always/ do this.
2019-02-20 21:44:18 -08:00
Slava Pestov
6ebd9929ea Runtime: Clarify meaning of a flag bit in GenericWitnessTable 2019-02-21 00:02:25 -05:00
swift-ci
1a66c77110 Merge pull request #21067 from ravikandhadai/yieldcheck 2019-02-20 17:27:08 -08:00
Joe Groff
d032a9a539 Merge pull request #22758 from jckarter/opened-archetype-generic-environment
Generic environments for opened archetypes
2019-02-20 16:19:48 -08:00
Erik Eckstein
95587fb8dd Demangler: fix compiler warning 2019-02-20 13:32:12 -08:00
Joe Groff
64488b19f9 Serialization: Rework serialization of nested archetypes.
Explicitly serialize the parent archetype so that it can be any kind of root archetype.
2019-02-20 12:53:18 -08:00
Joe Groff
0cfca9496a Give opened archetypes a generic environment.
And maybe allow nested types to live on them.
2019-02-20 12:52:48 -08:00
Mishal Shah
345e9881d1 Merge pull request #22699 from apple/stable-update-5.1
Update Swift:master to work with new stable re-branch from swift-5.1-branch
2019-02-20 12:22:00 -08:00
Jason Mittertreiner
9eeabc9875 Allow Arguments in -driver-use-frontend-path (#22596)
Windows doesn't know what a shebang is, so it's unable to run tests that
use -driver-use-frontend-path with a script. This allows the script
interpreter to be run as the executable with the script as its first
argument. e.g. --driver-use-frontend-path "python;my-script.py"
2019-02-20 11:20:21 -08:00
eeckstein
0b32db04ae Merge pull request #22715 from eeckstein/demangler-get-module
Demangler library: add a function swift_demangle_getModuleName  to get the module name of a mangled symbol.
2019-02-20 10:14:22 -08:00
Ravi Kandhadai
a9b0ebe542 [SIL Diagnostics] Create a mandatory pass to check correct usage of
yields in generalized accessors: _read and _modify, which are
yield-once corountines. This pass is based on the existing SIL verifier
checks but diagnoses only those errors that can be introduced by programmers
when using yields.

<rdar://43578476>
2019-02-19 18:25:47 -08:00
Slava Pestov
69d1cafd1c AST: Add AvailabilityContext parameter to Decl::isWeakImported()
For now, it's not used, but we do try to pass the right value down from
our various call sites.

Progress on <rdar://problem/46674512>.
2019-02-19 18:58:44 -05:00
Slava Pestov
7ffa09557d AST: Introduce AvailabilityContext::forDeploymentTarget() 2019-02-19 18:57:30 -05:00
Daniel Rodríguez Troitiño
ec86064209 [swift-reflection-dump] Support for ELF32.
Split the addImage method for ELF into two branches for ELF32 and for
ELF64 depending on the value stored in the identifier of the image.

Most of the code of the previous function moves into readELFSections,
which is build similar to the already existing readMachOSections. The
code is only modified to use the types from the template parameter.

This fixes a couple of reflection tests in Android armv7 (and I suppose
it should also fix the same problem in other 32 bits platforms which use
ELF).
2019-02-19 13:06:10 -08:00
Erik Eckstein
706f4c8622 Demangler library: add a function swift_demangle_getModuleName to get the module name of a mangled symbol.
rdar://problem/47560963
2019-02-19 11:26:42 -08:00
Saleem Abdulrasool
d30a2ababd FrontendTool: fix escaping of filenames in Makefile
The dependency file that is being generated should not escape : and # in
the filename.  This makes the behaviour of the filename escaping similar
to clang and GCC and fixes incorrect quoting of paths on Windows.
2019-02-19 10:51:26 -08:00
Slava Pestov
5ad306aae1 Merge pull request #22634 from slavapestov/update-callback-new-runtime
Always use update callback for classes when the deployment target is sufficiently new
2019-02-18 23:50:24 -05:00