mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SILGen: Emit an artificial toplevel for files with @UIApplicationMain classes.
If a source file contains the main class for its module, then implicitly emit a top_level_code that invokes UIApplicationMain with the name of the marked class. Swift SVN r18088
This commit is contained in:
@@ -220,13 +220,12 @@ lookUpWitnessTable(const ProtocolConformance *C, bool deserializeLazily) {
|
||||
return {wT, Subs};
|
||||
}
|
||||
|
||||
SILFunction *SILModule::getOrCreateSharedFunction(SILLocation loc,
|
||||
StringRef name,
|
||||
CanSILFunctionType type,
|
||||
IsBare_t isBareSILFunction,
|
||||
IsTransparent_t isTransparent) {
|
||||
auto linkage = SILLinkage::Shared;
|
||||
|
||||
SILFunction *SILModule::getOrCreateFunction(SILLocation loc,
|
||||
StringRef name,
|
||||
SILLinkage linkage,
|
||||
CanSILFunctionType type,
|
||||
IsBare_t isBareSILFunction,
|
||||
IsTransparent_t isTransparent) {
|
||||
if (auto fn = lookUpFunction(name)) {
|
||||
assert(fn->getLoweredFunctionType() == type);
|
||||
assert(fn->getLinkage() == linkage);
|
||||
@@ -237,6 +236,15 @@ SILFunction *SILModule::getOrCreateSharedFunction(SILLocation loc,
|
||||
loc, isBareSILFunction, isTransparent);
|
||||
}
|
||||
|
||||
SILFunction *SILModule::getOrCreateSharedFunction(SILLocation loc,
|
||||
StringRef name,
|
||||
CanSILFunctionType type,
|
||||
IsBare_t isBareSILFunction,
|
||||
IsTransparent_t isTransparent) {
|
||||
return getOrCreateFunction(loc, name, SILLinkage::Shared,
|
||||
type, isBareSILFunction, isTransparent);
|
||||
}
|
||||
|
||||
ArrayRef<SILType> ValueBase::getTypes() const {
|
||||
// No results.
|
||||
if (TypeOrTypeList.isNull())
|
||||
|
||||
Reference in New Issue
Block a user