Inferred framework modules automatically export anything they import

(i.e., 'export *'), to better match the semantics of headers.

llvm-svn: 145813
This commit is contained in:
Douglas Gregor 2011-12-05 17:40:25 +00:00
parent 8c7c83522b
commit d8bd7537ec
3 changed files with 12 additions and 0 deletions

View File

@ -197,9 +197,14 @@ ModuleMap::inferFrameworkModule(StringRef ModuleName,
Module *Result = new Module(ModuleName, SourceLocation(),
/*IsFramework=*/true);
// umbrella "umbrella-header-name"
Result->UmbrellaHeader = UmbrellaHeader;
Headers[UmbrellaHeader] = Result;
UmbrellaDirs[FrameworkDir] = Result;
// export *
Result->Exports.push_back(Module::ExportDecl(0, true));
Modules[ModuleName] = Result;
return Result;
}

View File

@ -0,0 +1,2 @@
#import <Module/Module.h> // expected-warning{{treating #import as an import of module 'Module'}}

View File

@ -12,3 +12,8 @@
# error DEPENDS_ON_MODULE should have been hidden
#endif
Module *mod; // expected-error{{unknown type name 'Module'}}
#import <AlsoDependsOnModule/AlsoDependsOnModule.h> // expected-warning{{treating #import as an import of module 'AlsoDependsOnModule'}}
Module *mod2;