Add the ability to lookup/link a SILFunction in the SILModule by its mangled name.

This feature is required for the implementation of pre-specialization, because one needs to check if a specialized SIL function with a given name exists in the standard library.

Swift SVN r30307
This commit is contained in:
Roman Levenstein
2015-07-17 06:52:04 +00:00
parent bd1c3ba0fc
commit f69c17568b
7 changed files with 65 additions and 1 deletions

View File

@@ -502,6 +502,12 @@ bool SILModule::linkFunction(SILDeclRef Decl, SILModule::LinkingMode Mode,
ExternalSource, Callback).processDeclRef(Decl);
}
bool SILModule::linkFunction(StringRef Name, SILModule::LinkingMode Mode,
std::function<void(SILFunction *)> Callback) {
return SILLinkerVisitor(*this, getSILLoader(), Mode,
ExternalSource, Callback).processFunction(Name);
}
void SILModule::linkAllWitnessTables() {
getSILLoader()->getAllWitnessTables();
}