Skip to content

Commit

Permalink
Remove -apinotes entry point
Browse files Browse the repository at this point in the history
First step in removing the notion of "compiled" API notes altogether.

apple-llvm-split-commit: c59c1a43b592fd63ebe960a5cd698be3bebfa76b
apple-llvm-split-dir: clang/
  • Loading branch information
jrose-apple committed Jan 17, 2019
1 parent c470552 commit 30fc70f
Show file tree
Hide file tree
Showing 13 changed files with 9 additions and 602 deletions.
53 changes: 0 additions & 53 deletions clang/test/APINotes/Inputs/os-availability.apinotes

This file was deleted.

197 changes: 0 additions & 197 deletions clang/test/APINotes/Inputs/roundtrip.apinotes

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,44 +1,27 @@
# RUN: not %clang -cc1apinotes -yaml-to-binary -target i386-apple-ios7 -o %t.apinotesc %s > %t.err 2>&1
# RUN: FileCheck %s < %t.err

---
Name: UIKit
Availability: iOS
AvailabilityMsg: iOSOnly
Classes:
- Name: UIFont
Availability: iOS
AvailabilityMsg: iOSOnly
Methods:
- Selector: 'fontWithName:size:'
MethodKind: Instance
Nullability: [ N ]
NullabilityOfRet: O
Availability: iOS
AvailabilityMsg: iOSOnly
DesignatedInit: true
# CHECK: duplicate definition of method '-[UIFont fontWithName:size:]'
- Selector: 'fontWithName:size:'
MethodKind: Instance
Nullability: [ N ]
NullabilityOfRet: O
Availability: iOS
AvailabilityMsg: iOSOnly
DesignatedInit: true
Properties:
- Name: familyName
Nullability: N
Availability: iOS
AvailabilityMsg: iOSOnly
- Name: fontName
Nullability: N
Availability: iOS
AvailabilityMsg: iOSOnly
# CHECK: duplicate definition of instance property 'UIFont.familyName'
- Name: familyName
Nullability: N
Availability: iOS
AvailabilityMsg: iOSOnly
# CHECK: multiple definitions of class 'UIFont'
- Name: UIFont
Protocols:
Expand All @@ -51,16 +34,12 @@ AvailabilityMsg: iOSOnly
- Name: 'globalFoo'
Nullability: [ N, N, O, S ]
NullabilityOfRet: O
Availability: iOS
AvailabilityMsg: iOSOnly
- Name: 'globalFoo2'
Nullability: [ N, N, O, S ]
NullabilityOfRet: O
Globals:
- Name: globalVar
Nullability: O
Availability: iOS
AvailabilityMsg: iOSOnly
- Name: globalVar2
Nullability: O
Tags:
Expand Down
1 change: 1 addition & 0 deletions clang/test/APINotes/Inputs/yaml-reader-errors/UIKit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extern int yesOfCourseThisIsWhatUIKitLooksLike;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module UIKit {
header "UIKit.h"
}
35 changes: 0 additions & 35 deletions clang/test/APINotes/module-cache.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,41 +46,6 @@
// RUN: FileCheck -check-prefix=CHECK-WITHOUT-REBUILD %s < %t/after.log
// RUN: FileCheck -check-prefix=CHECK-TWO-ERRORS %s < %t/after.log

// Set up a directory with pre-compiled API notes.
// RUN: mkdir -p %t/CompiledAPINotes
// RUN: rm -rf %t/ModulesCache
// RUN: rm -rf %t/APINotesCache
// RUN: %clang -cc1apinotes -yaml-to-binary -o %t/CompiledAPINotes/SomeOtherKit.apinotesc %S/Inputs/APINotes/SomeOtherKit.apinotes

// First build: check that 'methodB' is unavailable but 'methodA' is available.
// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -Rmodule-build -fmodules-cache-path=%t/ModulesCache -iapinotes-modules %t/CompiledAPINotes -F %t/Frameworks %s > %t/compiled-before.log 2>&1
// RUN: FileCheck -check-prefix=CHECK-METHODB %s < %t/compiled-before.log
// RUN: FileCheck -check-prefix=CHECK-REBUILD %s < %t/compiled-before.log
// RUN: FileCheck -check-prefix=CHECK-ONE-ERROR %s < %t/compiled-before.log

// Do it again; now we're using caches.
// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -Rmodule-build -fmodules-cache-path=%t/ModulesCache -iapinotes-modules %t/CompiledAPINotes -F %t/Frameworks %s > %t/compiled-before.log 2>&1
// RUN: FileCheck -check-prefix=CHECK-METHODB %s < %t/compiled-before.log
// RUN: FileCheck -check-prefix=CHECK-WITHOUT-REBUILD %s < %t/compiled-before.log
// RUN: FileCheck -check-prefix=CHECK-ONE-ERROR %s < %t/compiled-before.log

// Compile a new API notes file to replace the old one.
// RUN: %clang -cc1apinotes -yaml-to-binary -o %t/CompiledAPINotes/SomeOtherKit.apinotesc %t/APINotes/SomeOtherKit.apinotes

// Build again: check that both methods are now unavailable and that the module rebuilt.
// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -Rmodule-build -fmodules-cache-path=%t/ModulesCache -iapinotes-modules %t/CompiledAPINotes -F %t/Frameworks %s > %t/compiled-after.log 2>&1
// RUN: FileCheck -check-prefix=CHECK-METHODA %s < %t/compiled-after.log
// RUN: FileCheck -check-prefix=CHECK-METHODB %s < %t/compiled-after.log
// RUN: FileCheck -check-prefix=CHECK-REBUILD %s < %t/compiled-after.log
// RUN: FileCheck -check-prefix=CHECK-TWO-ERRORS %s < %t/compiled-after.log

// Run the build again: check that both methods are now unavailable
// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -Rmodule-build -fmodules-cache-path=%t/ModulesCache -iapinotes-modules %t/CompiledAPINotes -F %t/Frameworks %s > %t/compiled-after.log 2>&1
// RUN: FileCheck -check-prefix=CHECK-METHODA %s < %t/compiled-after.log
// RUN: FileCheck -check-prefix=CHECK-METHODB %s < %t/compiled-after.log
// RUN: FileCheck -check-prefix=CHECK-WITHOUT-REBUILD %s < %t/compiled-after.log
// RUN: FileCheck -check-prefix=CHECK-TWO-ERRORS %s < %t/compiled-after.log

@import SomeOtherKit;

void test(A *a) {
Expand Down
31 changes: 0 additions & 31 deletions clang/test/APINotes/yaml-os-availability.c

This file was deleted.

5 changes: 5 additions & 0 deletions clang/test/APINotes/yaml-reader-errors.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// RUN: rm -rf %t
// RUN: not %clang_cc1 -fmodules -fimplicit-module-maps -fapinotes -fapinotes-modules -fmodules-cache-path=%t -I %S/Inputs/yaml-reader-errors/ -fsyntax-only %s > %t.err 2>&1
// RUN: FileCheck %S/Inputs/yaml-reader-errors/UIKit.apinotes < %t.err

@import UIKit;

0 comments on commit 30fc70f

Please sign in to comment.