Commit Graph

58361 Commits

Author SHA1 Message Date
AG
85c4e01e4d Merge pull request #30447 from bitjammer/acgarland/rdar-60541965-sgf-040
[SymbolGraph] Bump format version to 0.4.0 NFC
2020-03-17 14:14:50 -07:00
swift-ci
3fa4840561 Merge pull request #30395 from brentdax/two-revisions-for-two-revisions-for-slashing 2020-03-17 14:11:02 -07:00
swift-ci
9073eea775 Merge pull request #30441 from zoecarver/fix/mand-combine-made-change 2020-03-17 13:51:27 -07:00
Ben Langmuir
d62b070c83 Merge pull request #30451 from benlangmuir/master-next-str-again
[outputfilemap] Fix another StringRef -> std::string conversion
2020-03-17 13:35:49 -07:00
swift-ci
cbcc377259 Merge pull request #30453 from gribozavr/simplify-append 2020-03-17 13:18:43 -07:00
swift-ci
5e63905031 Merge pull request #30452 from gribozavr/GSB-direct-alloc 2020-03-17 13:18:36 -07:00
Dmitri Gribenko
b2164f238a Simplified SmallString::append calls 2020-03-17 19:33:42 +01:00
Dmitri Gribenko
80e4a705fe Call placement new directly on the allocator
... avoiding handling a pointer to raw memory.
2020-03-17 19:24:09 +01:00
Ben Langmuir
9e2d7ca053 [outputfilemap] Fix another StringRef -> std::string conversion
This fix affects master-next, but it's safe to put on master.
2020-03-17 11:11:23 -07:00
Saleem Abdulrasool
c7a198bc03 Driver: honour -no-toolchain-stdlib-rpath on Unices
Handle `-no-toolchain-stdlib-rpath` on Linux/android as well as Darwin.  This
enables the flags on other Unix platforms as it can be useful to control the
embedded rpath for the library.
2020-03-17 17:38:24 +00:00
Arnold Schwaighofer
0082682b0d IRGen: Refactor getObjCEncodingForMethod and getObjectEncodingFromClangNode into one
NFC.
2020-03-17 10:32:03 -07:00
Ashley Garland
ac6132a2c0 [SymbolGraph] Bump format version to 0.4.0 NFC
rdar://60541965
2020-03-17 09:49:21 -07:00
Arnold Schwaighofer
eeb7fa52b2 Merge pull request #30438 from aschwaighofer/irgen_prefer_clang_type_encoding
IRGen: Use clang's objc encoding for types when there is a ClangNode
2020-03-17 07:39:33 -07:00
Arnold Schwaighofer
77af77fa8a Merge pull request #30433 from aschwaighofer/irgen_no_duplicate_objc_method_descriptor_entries
IRGen: Unique method descriptors in objc method lists
2020-03-17 06:52:20 -07:00
Dmitri Gribenko
841eeb05b0 Merge pull request #30403 from MForster/forster/string-fixes
Cherry-pick StringRef->std::string conversion fixes into `master`
2020-03-17 12:09:36 +01:00
zoecarver
9be29baebe Set madeChange = true when adding, removing, or replacing instructions 2020-03-16 21:34:40 -07:00
Robert Widmann
ecb58a12d7 Merge pull request #30439 from CodaFi/swift-is-an-untyped-languge-now-i-dont-make-the-rules
[NFC] Break TypeChecker Down Into a Namespace
2020-03-16 21:17:45 -07:00
Robert Widmann
91a5ceb56c Merge pull request #29631 from CodaFi/irgen-bru
IRGen Requests
2020-03-16 21:07:53 -07:00
Robert Widmann
44ec753893 Remove outdated documentation 2020-03-16 19:20:23 -07:00
Robert Widmann
70b6bbcb13 Remove swift::createTypeChecker
Replace it with the "legacy semantic queries" bit. The remaining client
of this bit is SourceKit, which appears to require this bit be set
conditionally so certain semantic property wrapper requests return
a sentinel value.

We should migrate these requests to a syntactic interface as soon as
possible.

rdar://60516325
2020-03-16 19:20:22 -07:00
Robert Widmann
e79ac7e611 Break TypeChecker down into a namespace 2020-03-16 19:20:22 -07:00
Robert Widmann
14c073ba0b Remove friend references to TypeChecker
TypeChecker has no friends
2020-03-16 19:19:02 -07:00
Robert Widmann
4be0e4a2bd Strip Forward-Declararations of TypeChecker 2020-03-16 19:19:02 -07:00
Robert Widmann
c3c490efb0 Remove the ability to reference instances of TypeChecker 2020-03-16 19:19:02 -07:00
Robert Widmann
52c808648f Move the defined functions list onto SourceFile 2020-03-16 19:19:01 -07:00
Robert Widmann
5d37c9b568 Merge pull request #30431 from gribozavr/LookUpConformance
Updated a comment on LookUpConformance to reflect current implementation
2020-03-16 19:18:28 -07:00
Luciano Almeida
1cccbc8f94 [CSSimplify] Difavor function type overload when trying to match no arg function type with a closure with a anonimous implicit var closure 2020-03-16 22:59:40 -03:00
Robert Widmann
52f4aba784 IRGen Requests
Implement the IRGen Request infrastructure and provide the first
request: generating IR from a given SourceFile.
2020-03-16 18:00:33 -07:00
Arnold Schwaighofer
259c9884ac IRGen: Use clang's objc encoding for types when there is a ClangNode
We do this because the swift code does not support all attributes and
does not support generics.

rdar://60474785
2020-03-16 16:47:13 -07:00
Pavel Yaskevich
01073be9d6 Merge pull request #30436 from xedin/rdar-60501780
[CSBindings] Refactor a check to produce follow-up direct supertype b…
2020-03-16 16:22:05 -07:00
Michael Gottesman
7ac7620c78 Merge pull request #30425 from gottesmm/pr-a62f3926b9e0b421c35408e66cf592f84295cd24
[ownership] Treat open_existential_box as an interior pointer producting instruction.
2020-03-16 14:06:15 -07:00
AG
4f84517c0c Merge pull request #30428 from bitjammer/acgarland/rdar-60499122-location-uri-position-together
[SymbolGraph] Serialize Location uri and position together
2020-03-16 12:55:17 -07:00
Xi Ge
63d6e7f8ec Merge pull request #30424 from nkcsgexi/available-context
TBDGen: don't emit $ld$previous$ symbols for added members to a moved decl
2020-03-16 12:53:38 -07:00
Pavel Yaskevich
059a3602f8 [CSBindings] Refactor a check to produce follow-up direct supertype bindings
This is a follow-up to https://github.com/apple/swift/pull/30113
which cased a regression because it was placed under a check which
allows direct supertypes to be inferred if previous (failing) binding
has a supertype as well which has nothing to do with collection
inference.

Let's combine supertype check and inference logic to avoid such
confusion in the future.

Resolves: rdar://problem/60501780
2020-03-16 12:17:55 -07:00
Robert Widmann
7926880268 Merge pull request #30427 from CodaFi/an-enumeration-of-grievances
Do a little extra validation of RawRepresentable.RawValue
2020-03-16 12:09:42 -07:00
Arnold Schwaighofer
a5b277b5e0 IRGen: Unique method descriptors in objc method lists
Before this patch we used to get duplicate entries because we would
define implicit function delcarations, e.g for

(func_decl "perform(_:)" interface type='<Self where Self : NSObjectProtocol> (Self) -> (Selector?) -> Unmanaged<AnyObject>?' access=public @objc
  (parameter "self")
  (parameter_list
    (parameter "aSelector" type='Selector?' interface type='Selector?')))

we will define:

(func_decl implicit "performSelector(_:)" access=public @objc
  (parameter "self")
  (parameter_list
    (parameter "aSelector" type='Selector?' interface type='Selector?')))

rdar://60461850
2020-03-16 11:22:04 -07:00
Dmitri Gribenko
97855c9e29 Updated a comment on LookUpConformance to reflect current implementation
LookUpConformance does not depend on a type checker instance anymore.
2020-03-16 19:05:58 +01:00
Ashley Garland
eaad8a7241 [SymbolGraph] Serialize Location uri and position together
or not at all. This information comes as one unit from .swiftsourceinfo so the
code should reflect that.

rdar://60499122
2020-03-16 10:10:10 -07:00
Robert Widmann
2966a38ee1 Do a little extra validation of RawRepresentable.RawValue
* In the DeclChecker, duplicate the check that we have a reasonable
RawValue type so we do not attempt to form an invalid key. The interface
to the autoincrementer has this as invariant, but it was not previously
checked as a precondition.

* In the deriver, try to check for the case where the user has written
a mismatched explicit declaration of RawValue, or a type sharing that
name, and check type equality with the declared raw type to make this
pass resilient to mismatches as well.

Resolves rdar://57072148, rdar://59703784
2020-03-16 09:59:09 -07:00
eeckstein
b5c0b6de9d Merge pull request #30381 from eeckstein/lazy_properties
Improve optimization of lazy properties.
2020-03-16 08:32:19 +01:00
Michael Gottesman
f3df836652 [ownership] Treat open_existential_box as an interior pointer producting instruction.
This means that it can only have a guaranteed object as an operandand that we
validate that all uses of the result address of open_existential_box occur only
within the lifetime of said object's borrow scope.
2020-03-15 23:21:45 -07:00
Xi Ge
251edf3765 TBDGen: don't emit $ld$previous$ symbols for added members to a moved decl
When a top-level decl is marked with @_originallyDefinedIn, some of its members
may also be newly added after the top-level decl has been moved to the current module.
For these members, we don't need emit $ld$previous$ symbols for them.

rdar://60478650
2020-03-15 19:02:31 -07:00
Anthony Latsis
d688710fb3 [Diag] Move invalid where clause on top-level decl diagnostic to Sema 2020-03-15 13:38:49 +03:00
Andrew Trick
ca686a58ec Merge pull request #30414 from atrick/fix-escape-unreachable
Fix EscapeAnalysis verification assert at unreachable blocks
2020-03-14 17:53:09 -07:00
Andrew Trick
bebbe370e8 Fix EscapeAnalysis verification assert at unreachable blocks
If EscapeAnalysis verification runs on unreachable code, it asserts
with "Missing escape connection graph mapping" because the connection
graph builder only runs on reachable blocks.

Add a ReachableBlocks utility and use it during verification.

Fixes <rdar://problem/60373501> EscapeAnalysis crashes with CFG with
unreachable blocks
2020-03-14 14:31:41 -07:00
Pavel Yaskevich
5bb2a62b70 Merge pull request #30409 from HassanElDesouky/SR-12309
[CSGen] Force unwrapping 'nil' compiles without warning
2020-03-14 11:41:02 -07:00
Owen Voorhees
592ce68c55 Support the combination of -enable-educational-notes and -enable-experimental-diagnostic-formatting 2020-03-14 09:21:06 -07:00
Brent Royal-Gordon
5b7a13cf69 Merge pull request #30410 from brentdax/futures-end
Improve diagnostic for broken module interfaces
2020-03-14 01:25:58 -07:00
HassanElDesouky
e747dc25b1 Resolve issues 2020-03-14 08:02:23 +02:00
HassanElDesouky
8d5a33ee89 Move to visitNilLiteralExpr 2020-03-14 07:39:44 +02:00