mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Import as member] Bring up to date with fixes from master
This commit is contained in:
@@ -877,7 +877,7 @@ static bool ParseClangImporterArgs(ClangImporterOptions &Opts,
|
||||
});
|
||||
}
|
||||
|
||||
Opts.InferDefaultArguments |= Args.hasArg(OPT_enable_infer_default_arguments);
|
||||
Opts.InferImportAsMember |= Args.hasArg(OPT_enable_infer_import_as_member);
|
||||
Opts.DumpClangDiagnostics |= Args.hasArg(OPT_dump_clang_diagnostics);
|
||||
|
||||
if (Args.hasArg(OPT_embed_bitcode))
|
||||
|
||||
@@ -12,20 +12,17 @@ typedef NSObject<ImportedProtocolBase> * ImportedProtocolBase_t;
|
||||
@protocol IAMProto <ImportedProtocolBase>
|
||||
@end
|
||||
|
||||
// HACK HACK HACK: There is a bug in the importer where we can't begin with the type name...
|
||||
typedef NSObject<IAMProto> * zIAMProto_t;
|
||||
typedef NSObject<IAMProto> * Dummy;
|
||||
typedef NSObject<IAMProto> * IAMProto_t;
|
||||
|
||||
|
||||
void mutateSomeState(zIAMProto_t)
|
||||
void mutateSomeState(IAMProto_t)
|
||||
__attribute__((swift_name("IAMProto.mutateSomeState(self:)")));
|
||||
|
||||
void mutateSomeStateWithOtherProto(zIAMProto_t, zIAMProto_t other)
|
||||
void mutateSomeStateWithOtherProto(IAMProto_t, IAMProto_t other)
|
||||
__attribute__((swift_name("IAMProto.mutateSomeState(self:otherProto:)")));
|
||||
|
||||
int getSomeValue(zIAMProto_t)
|
||||
int getSomeValue(IAMProto_t)
|
||||
__attribute__((swift_name("getter:IAMProto.someValue(self:)")));
|
||||
int setSomeValue(zIAMProto_t, int v)
|
||||
int setSomeValue(IAMProto_t, int v)
|
||||
__attribute__((swift_name("setter:IAMProto.someValue(self:_:)")));
|
||||
|
||||
#endif // IMPORT_AS_MEMBER_PROTO_H
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// RUN: %target-swift-ide-test(mock-sdk: %clang-importer-sdk) -I %t -I %S/Inputs/custom-modules -print-module -source-filename %s -module-to-print=ImportAsMember.A -enable-omit-needless-words -always-argument-labels > %t.printed.A.txt
|
||||
// RUN: %target-swift-ide-test(mock-sdk: %clang-importer-sdk) -I %t -I %S/Inputs/custom-modules -print-module -source-filename %s -module-to-print=ImportAsMember.B -enable-omit-needless-words -always-argument-labels > %t.printed.B.txt
|
||||
// RUN: %target-swift-ide-test(mock-sdk: %clang-importer-sdk) -I %t -I %S/Inputs/custom-modules -print-module -source-filename %s -module-to-print=ImportAsMember.Proto -enable-omit-needless-words -always-argument-labels > %t.printed.Proto.txt
|
||||
// RUN: %target-swift-ide-test(mock-sdk: %clang-importer-sdk) -I %t -I %S/Inputs/custom-modules -print-module -source-filename %s -module-to-print=ImportAsMember.A -always-argument-labels > %t.printed.A.txt
|
||||
// RUN: %target-swift-ide-test(mock-sdk: %clang-importer-sdk) -I %t -I %S/Inputs/custom-modules -print-module -source-filename %s -module-to-print=ImportAsMember.B -always-argument-labels > %t.printed.B.txt
|
||||
// RUN: %target-swift-ide-test(mock-sdk: %clang-importer-sdk) -I %t -I %S/Inputs/custom-modules -print-module -source-filename %s -module-to-print=ImportAsMember.Proto -always-argument-labels > %t.printed.Proto.txt
|
||||
|
||||
// RUN: FileCheck %s -check-prefix=PRINT -strict-whitespace < %t.printed.A.txt
|
||||
// RUN: FileCheck %s -check-prefix=PRINTB -strict-whitespace < %t.printed.B.txt
|
||||
@@ -55,11 +55,10 @@
|
||||
// PRINT-PROTO-NEXT: typealias ImportedProtocolBase_t = ImportedProtocolBase
|
||||
// PRINT-PROTO-NEXT: protocol IAMProto : ImportedProtocolBase {
|
||||
// PRINT-PROTO-NEXT: }
|
||||
// PRINT-PROTO-NEXT: typealias zIAMProto_t = IAMProto
|
||||
// PRINT-PROTO-NEXT: typealias Dummy = NSObject
|
||||
// PRINT-PROTO-NEXT: typealias IAMProto_t = IAMProto
|
||||
// PRINT-PROTO-NEXT: extension IAMProto {
|
||||
// PRINT-PROTO-NEXT: func mutateSomeState()
|
||||
// PRINT-PROTO-NEXT: func mutateSomeState(otherProto other: zIAMProto_t!)
|
||||
// PRINT-PROTO-NEXT: func mutateSomeState(otherProto other: IAMProto_t!)
|
||||
// PRINT-PROTO-NEXT: var someValue: Int32
|
||||
// PRINT-PROTO-NEXT: }
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %target-swift-ide-test(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t -I %S/Inputs/custom-modules) -print-module -source-filename %s -module-to-print=ImportAsMember.C -enable-omit-needless-words -always-argument-labels > %t.printed.C.txt
|
||||
// RUN: %target-swift-ide-test(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t -I %S/Inputs/custom-modules) -print-module -source-filename %s -module-to-print=ImportAsMember.C -always-argument-labels > %t.printed.C.txt
|
||||
|
||||
// REQUIRES: objc_interop
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %target-swift-ide-test(mock-sdk: -sdk %S/../Inputs/clang-importer-sdk -I %t -I %S/Inputs/custom-modules) -print-module -source-filename %s -module-to-print=InferImportAsMember -enable-omit-needless-words -always-argument-labels -enable-infer-import-as-member > %t.printed.A.txt
|
||||
// RUN: %target-swift-ide-test(mock-sdk: %clang-importer-sdk) -I %t -I %S/Inputs/custom-modules -print-module -source-filename %s -module-to-print=InferImportAsMember -always-argument-labels -enable-infer-import-as-member > %t.printed.A.txt
|
||||
// RUN: FileCheck %s -check-prefix=PRINT -strict-whitespace < %t.printed.A.txt
|
||||
|
||||
import InferImportAsMember
|
||||
|
||||
Reference in New Issue
Block a user