Allow SILGen to emit only a specific set of SILDeclRefs

Extend ASTLoweringDescriptor to store a set of
SILDeclRefs to emit through `emitFunctionDefinition`.
This commit is contained in:
Hamish Knight
2020-09-15 19:20:11 +01:00
parent 44a8b56168
commit cb099454d6
6 changed files with 47 additions and 14 deletions

View File

@@ -277,10 +277,10 @@ struct SILDeclRef {
SILLinkage getLinkage(ForDefinition_t forDefinition) const;
/// Return the hash code for the SIL declaration.
llvm::hash_code getHashCode() const {
return llvm::hash_combine(loc.getOpaqueValue(),
static_cast<int>(kind),
isForeign, defaultArgIndex);
friend llvm::hash_code hash_value(const SILDeclRef &ref) {
return llvm::hash_combine(ref.loc.getOpaqueValue(),
static_cast<int>(ref.kind),
ref.isForeign, ref.defaultArgIndex);
}
bool operator==(SILDeclRef rhs) const {