[Import as member] Bring up to date with fixes from master

This commit is contained in:
Michael Ilseman
2016-03-23 17:02:03 -07:00
parent 47e73ad4f1
commit bb43d88792
5 changed files with 13 additions and 17 deletions

View File

@@ -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))

View File

@@ -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

View File

@@ -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: }

View File

@@ -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

View File

@@ -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