mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add -import-objc-header option, and wire up the basic infrastructure.
THIS IS NOT READY FOR USE YET. The new plan for mixed-source non-framework targets is that the Swift compiler will import an Objective-C header directly, and treat the decls and imports in that header as explicitly visible to the entire target. This means users don't have to modularize their headers before bringing them into Swift. This commit adds the option and introduces the "imported headers" module as an implicit import for the source files being compiled. It also directs the Clang importer to process the given header (using #import, so that it won't somehow get included twice) and watches for any module imports that occur as a result of reading that header. Still to come: import of decls within the header (not within any module), and proper serialization of cross-references to the header and its imports. Part of <rdar://problem/16702101> Swift SVN r17218
This commit is contained in:
@@ -496,6 +496,9 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
|
||||
Opts.LLVMArgs = Args.getAllArgValues(OPT_Xllvm);
|
||||
Opts.ImportUnderlyingModule = Args.hasArg(OPT_import_underlying_module);
|
||||
|
||||
if (const Arg *A = Args.getLastArg(OPT_import_objc_header))
|
||||
Opts.ImplicitObjCHeaderPath = A->getValue();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user