Skip to content

Commit

Permalink
Clang importer SDK: separate out CoreFoundation.h so we can build it up.
Browse files Browse the repository at this point in the history
Swift SVN r21375
  • Loading branch information
DougGregor committed Aug 21, 2014
1 parent 4a45129 commit 2886625
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
3 changes: 2 additions & 1 deletion test/ClangModules/ctypes_parse.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import ctypes
import CoreGraphics
import Foundation
import CoreFoundation

var cgPointVar: CGPoint

Expand Down Expand Up @@ -177,7 +178,7 @@ func testImportSysTypesTypes() {

func testImportCFTypes() {
var t1_unqual: Int = CFIndex_test
var t1_qual: ctypes.CFIndex = t1_unqual
var t1_qual: CoreFoundation.CFIndex = t1_unqual
}

func testImportOSTypesTypes() {
Expand Down
7 changes: 7 additions & 0 deletions test/Inputs/clang-importer-sdk/usr/include/CoreFoundation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
typedef const void *CFTypeRef;
typedef struct __CFString *CFMutableStringRef;
typedef struct __CFString const *CFStringRef;
typedef struct __CFTree *CFTreeRef;

typedef signed long CFIndex;
extern CFIndex CFIndex_test;
8 changes: 0 additions & 8 deletions test/Inputs/clang-importer-sdk/usr/include/ctypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ typedef struct {
};
} AnonStructs;

typedef const void *CFTypeRef;
typedef void const *HWND;
typedef struct __CFString *CFMutableStringRef;
typedef struct __CFString const *CFStringRef;
typedef struct __CFTree *CFTreeRef;

struct StructWithBitfields {
unsigned First;
Expand Down Expand Up @@ -143,10 +139,6 @@ STDLIB_TYPEDEF(__UINT64_TYPE__, u_int64_t);
STDLIB_TYPEDEF(signed int, SInt);
STDLIB_TYPEDEF(unsigned int, UInt);

// Types from CoreFoundation.
STDLIB_TYPEDEF(signed long, CFIndex);


void noreturnFunction() __attribute__((noreturn));
void couldReturnFunction() __attribute__((noreturn));

Expand Down
4 changes: 4 additions & 0 deletions test/Inputs/clang-importer-sdk/usr/include/module.map
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ module CoreGraphics {
header "CoreGraphics.h"
export *
}
module CoreFoundation {
header "CoreFoundation.h"
export *
}
module Foundation {
header "Foundation.h"
export *
Expand Down
3 changes: 2 additions & 1 deletion test/PrintAsObjC/classes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// RUN: FileCheck --check-prefix=NEGATIVE %s < %t/classes.h
// RUN: %check-in-clang %t/classes.h
// RUN: not %check-in-clang -fno-modules %t/classes.h
// RUN: %check-in-clang -fno-modules %t/classes.h -include Foundation.h -include ctypes.h
// RUN: %check-in-clang -fno-modules %t/classes.h -include Foundation.h -include ctypes.h -include CoreFoundation.h

// CHECK-NOT: AppKit;
// CHECK-NOT: Properties;
Expand All @@ -23,6 +23,7 @@ import Foundation
import AppKit // only used in implementations
import ctypes
import Properties // completely unused
import CoreFoundation

// CHECK-LABEL: @interface A1{{$}}
// CHECK-NEXT: init
Expand Down

0 comments on commit 2886625

Please sign in to comment.