Commit Graph

36 Commits

Author SHA1 Message Date
Rintaro Ishizaki
c9785d955d [SourceKit] Stop printing normal comments in clang generated interface
Generated interfaces for Clang modules used to try printing normal
comments between decls extracted from the header text. That was because
doc-comment was not common in C/ObjC headers. But mainly because of
"import as member feature" Clang decls aren't printed in the order as
they appear in the header file, the logic determinig which comment
belongs to which decl was not working property. We've decided to remove
that feature and only print the proper doc-comments as it has been
getting common.

rdar://93731287
2024-03-21 11:52:32 +09:00
Anthony Latsis
7f6d3bcd41 ASTPrinter: Turn on explicit any printing for everything and remove the option to disable it 2023-05-13 02:55:49 +03:00
Dmitri Gribenko
984210aa53 tests: replace '// RUN: rm -rf' '// RUN: mkdir' pairs with '%empty-directory(...)'
These changes were made using a script.
2017-06-04 11:08:39 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Joe Groff
1e8dd0e34b ClangImporter: Import unbounded NSSets and NSDictionaries using AnyHashable. 2016-07-26 13:36:05 -07:00
Joe Groff
5cef9eacca Update IDE tests for id-as-Any. 2016-07-25 06:40:34 -07:00
Doug Gregor
823c24b355 [SE-0112] Rename ErrorProtocol to Error.
This is bullet (5) of the proposed solution in SE-0112, and the last
major piece to be implemented.
2016-07-12 10:53:52 -07:00
Doug Gregor
ca4a32b5a9 [SE-0112] Bridge NSError to ErrorProtocol.
Introduce bridging of NSError to ErrorProtocol, so an Objective-C API
expressed via an "NSError *" will be imported using ErrorProtocol in
the Swift. For example, the Objective-C method:

  - (void)handleError:(NSError *)error userInteractionPermitted:(BOOL)userInteractionPermitted;

will now be imported as:

  func handleError(_ error: ErrorProtocol, userInteractionPermitted: Bool)

This is bullet (3) under the proposed solution of SE-0112. Note that
we made one semantic change here: instead of removing the conformance
of NSError to ErrorProtocol, which caused numerous problems both
theoretical and actual because the model expects that an NSError
conforms to ErrorProtocol without requiring wrapping, we instead limit
the ErrorProtocol -> NSError conversion that would be implied by
bridging. This is defensible in the short term because it also
eliminates the implicit conversion, and aligns with SE-0072, which
eliminates implicit bridging conversions altogether.
2016-07-12 10:53:52 -07:00
Mishal Shah
87b7bcfd3e Update master to build with Xcode 8 beta 1, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2016-06-14 14:53:55 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Doug Gregor
06c5e9cd5b Enable "omit needless words" by default.
Most of this is in updating the standard library, SDK overlays, and
piles of test cases to use the new names. No surprises here, although
this shows us some potential heuristic tweaks.

There is one substantive compiler change that needs to be factored out
involving synthesizing calls to copyWithZone()/copy(zone:). Aside from
that, there are four failing tests:

    Swift :: ClangModules/objc_parse.swift
    Swift :: Interpreter/SDK/Foundation_test.swift
    Swift :: Interpreter/SDK/archiving_generic_swift_class.swift
    Swift :: Interpreter/SDK/objc_currying.swift

due to two independent remaining compiler bugs:
  * We're not getting partial ordering between NSCoder's
  encode(AnyObject, forKey: String) and NSKeyedArchiver's version of
  that method, and
  * Dynamic lookup (into AnyObject) doesn't know how to find the new
  names. We need the Swift name lookup tables enabled to address this.
2015-12-11 14:46:50 -08:00
Argyrios Kyrtzidis
54519ea896 [test] Update test/IDE/print_clang_foundation.swift for error handling.
Swift SVN r28063
2015-05-02 01:17:46 +00:00
Argyrios Kyrtzidis
2931543a2f Revert "XFAIL failing IDE tests while BenL investigates. rdar://20245658."
This reverts commits r26369 & r26381.
After upstream clang changes, reverted r25843 which was compensating for a previous upstream clang change.

But keep test/IDE/complete_from_clang_framework.swift disabled for further investigation, because it
seems to have some duplications in a code-completion test.

rdar://20245658&20247922

Swift SVN r26430
2015-03-23 07:24:27 +00:00
Michael Gottesman
60b02a5c46 XFAIL failing IDE tests while BenL investigates. rdar://20245658.
Swift SVN r26369
2015-03-20 22:38:47 +00:00
Graham Batty
83b4384fac Update test flags for linux failures and support.
Also removed the sdk 'feature' in favour of the more specific
objc_interop.

Swift SVN r24856
2015-01-30 21:31:48 +00:00
Argyrios Kyrtzidis
c1984e15e7 [IDE] Make sure we don't print duplicate imports, due to getting imports for both a clang module and its overlay.
rdar://16608500

Swift SVN r23730
2014-12-05 06:01:06 +00:00
Dmitri Hrybenko
1eea220932 Use one module cache directory for all the lit tests to speed them up
Doing so is safe even though we have mock SDK.  The include paths for
modules with the same name in the real and mock SDKs are different, and
the module files will be distinct (because they will have a different
hash).

This reduces test runtime on OS X by 30% and brings it under a minute on
a 16-core machine.

This also uncovered some problems with some tests -- even when run for
iOS configurations, some tests would still run with macosx triple.  I
fixed the tests where I noticed this issue.

rdar://problem/19125022

Swift SVN r23683
2014-12-04 11:21:48 +00:00
Graham Batty
83f27a8af7 Revert "Mark tests that don't pass on linux as XFAIL."
This reverts commit 2711ca86de7bf6a7885ccea24219a48a590b1e95.

Swift SVN r23577
2014-11-24 17:42:13 +00:00
Graham Batty
198402dcfe Mark tests that don't pass on linux as XFAIL.
Swift SVN r23573
2014-11-24 17:40:37 +00:00
Dmitri Hrybenko
0a2593527e Add a target triple to all tests that use %sdk
These tests would assume OS X otherwise, and will fail because the SDK
is a non-OSX one.

Swift SVN r23110
2014-11-05 04:18:06 +00:00
Dmitri Hrybenko
1347b446c9 Stop using the MODULES_SDK variable in -D flags for the C++ compiler
Swift SVN r23097
2014-11-04 05:44:12 +00:00
Doug Gregor
b6248c8342 Remove the -enable-objc-failable-initializers option.
As part of this, failable initializers get enabled by default for
swift-ide-test.


Swift SVN r21704
2014-09-04 15:31:02 +00:00
Anna Zaks
3997db5349 API Notes: Commit API Notes v13 (with copyWithZone returning N)
This drop adds 3 new frameworks: Metal, SceneKit, and SpriteKit.
The other frameworks (Foundation, CoreData, ObjectiveC, UIKit) have been refined:
 - conflicting items went to unknowns,
 - bugs got fixed,
 - more auditing has been performed.

Swift SVN r21443
2014-08-25 20:31:21 +00:00
Doug Gregor
5709a86f2f Start importing Objective-C initializers and factory methods using failable initializers.
In this mode, use nullability information on the result type of the
initializer or factory method to determine failability of the
initializer. This is behind the flag
-enable-objc-failable-initializers until we have the SILGen support in
place.



Swift SVN r21341
2014-08-21 04:50:20 +00:00
Anna Zaks
14355baf7f API Notes File: 3d drop of Foundation, CoreData, UIKit
At this point, most of these frameworks have been fully audited.

Swift SVN r21318
2014-08-20 21:15:31 +00:00
Anna Zaks
ca03e527c3 API Notes File: Add the notes generated as the product of the first nullability audit of Foundation
As well as the required test modifications.

Swift SVN r21126
2014-08-09 01:40:48 +00:00
Doug Gregor
e9037bcfa7 Default swift-ide-test to -implicit-objc-with like the rest of the world.
We require some level of consistency between the way the overlays were
built and what we work with in our mock SDK. The IDE/sdk_sugar.swift
test failure was because the overlay referenced "init(coder:)" while
the test was looking for "init(withCoder:)". Hilarity ensued
<rdar://problem/17791048>.

This only impacts testing.

Swift SVN r20564
2014-07-25 22:13:43 +00:00
Argyrios Kyrtzidis
9fe6a99986 [test] Add a test-specific module cache path for test/IDE/print_clang_foundation.swift.
Swift SVN r20116
2014-07-17 22:56:12 +00:00
Joe Groff
b80f401204 ClangImporter: Restore the NSErrorPointer importer sugar for NSError** params.
Swift SVN r19288
2014-06-27 04:07:29 +00:00
Joe Groff
cb48fbd24b Enable pointer conversions.
Swift SVN r19274
2014-06-26 23:26:31 +00:00
Doug Gregor
95e8331953 Import NSDictionary using the sugar type [NSObject : AnyObject].
Swift SVN r19254
2014-06-26 21:17:09 +00:00
Doug Gregor
55df89aabe Print array types as [T] instead of T[].
Swift SVN r19195
2014-06-25 23:59:51 +00:00
Dmitri Hrybenko
d1a2a2ab39 AST printer: don't qualify names from system overlays
rdar://17003635


Swift SVN r18566
2014-05-22 19:21:11 +00:00
Doug Gregor
c4622014f8 Start importing NSArray* with the sugar AnyObject[]! rather than Array<AnyObject>!.
... and simplify type printing so we don't overparenthesize such types.



Swift SVN r18183
2014-05-16 06:17:38 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Argyrios Kyrtzidis
e0209fd540 [ClangImporter] Don't update the clang node of the swift decl if one already exists.
If it already has a node it should be the node we want the swift decl to point to,
e.g. the @interface definition. Otherwise we may replace it with a @class forward declaration.

rdar://16560290

Swift SVN r16254
2014-04-12 16:33:40 +00:00