[driver] Allow -force-single-frontend-invocation and -emit-objc-header[-path] to be used together.

Added support in Driver which allows -force-single-frontend-invocation and
-emit-objc-header[-path] to be used together in a single invocation.

Added support in tools::Swift to pass -emit-objc-header-path if an Objective-C
header was requested; this is only valid in OutputInfo::Mode::SingleCompile
mode, and an assertion enforces this.

Added a test which ensures that the same header is emitted in with
-force-single-frontend-invocation and without it.

Swift SVN r20185
This commit is contained in:
Connor Wakamo
2014-07-18 22:04:29 +00:00
parent ae0dfd4676
commit 497eeffa55
6 changed files with 32 additions and 17 deletions

View File

@@ -0,0 +1,13 @@
// RUN: %swift_driver -Xfrontend %clang-importer-sdk -emit-module -o %t.1.swiftmodule -emit-objc-header -emit-objc-header-path %t.1.h -module-name ThisModule %s %S/Inputs/main.swift %S/Inputs/lib.swift
// RUN: %swift_driver -Xfrontend %clang-importer-sdk -emit-module -o %t.2.swiftmodule -emit-objc-header -emit-objc-header-path %t.2.h -module-name ThisModule %s %S/Inputs/main.swift %S/Inputs/lib.swift -force-single-frontend-invocation
// RUN: diff %t.1.h %t.2.h
import Foundation
public class A: NSObject {
func foo() {}
@objc func bar(x: Int, baz y: Int) -> Int { return 1 }
}
public class B: A {
func doSomething() {}
}