Fixes for a lookup of functions by name

Among other things it fixes a bug in the function signature optimization where it would use an already existing mangled name for a different function
This commit is contained in:
Roman Levenstein
2017-02-09 17:54:11 -08:00
parent e4af4e1c42
commit 199e76d6d4
11 changed files with 66 additions and 31 deletions

View File

@@ -430,12 +430,19 @@ public:
bool linkFunction(StringRef Name,
LinkingMode LinkAll = LinkingMode::LinkNormal);
/// Check if a given function exists in the module,
/// i.e. it can be linked by linkFunction.
/// Check if a given function exists in any of the modules with a
/// required linkage, i.e. it can be linked by linkFunction.
///
/// If linkage parameter is none, then the linkage of the function
/// with a given name does not matter.
///
/// \return null if this module has no such function. Otherwise
/// the declaration of a function.
SILFunction *hasFunction(StringRef Name, SILLinkage Linkage);
SILFunction *findFunction(StringRef Name, Optional<SILLinkage> Linkage);
/// Check if a given function exists in the module,
/// i.e. it can be linked by linkFunction.
bool hasFunction(StringRef Name);
/// Link in all Witness Tables in the module.
void linkAllWitnessTables();