SIL: Add type lowering APIs to SILFunction

For now these just forward to methods on the module's TypeLowering,
but soon they will use the SILFunction's resilience expansion.
This commit is contained in:
Slava Pestov
2019-02-28 20:48:32 -05:00
parent c5cf5c2c4b
commit d1cf8c9cf6
4 changed files with 68 additions and 11 deletions

View File

@@ -38,6 +38,11 @@ class SILModule;
class SILFunctionBuilder;
class SILProfiler;
namespace Lowering {
class TypeLowering;
class AbstractionPattern;
}
enum IsBare_t { IsNotBare, IsBare };
enum IsTransparent_t { IsNotTransparent, IsTransparent };
enum Inline_t { InlineDefault, NoInline, AlwaysInline };
@@ -464,6 +469,19 @@ public:
: ResilienceExpansion::Maximal);
}
const Lowering::TypeLowering &
getTypeLowering(Lowering::AbstractionPattern orig, Type subst);
const Lowering::TypeLowering &getTypeLowering(Type t) const;
SILType getLoweredType(Lowering::AbstractionPattern orig, Type subst) const;
SILType getLoweredType(Type t) const;
SILType getLoweredLoadableType(Type t) const;
const Lowering::TypeLowering &getTypeLowering(SILType type) const;
/// Returns true if this function has a calling convention that has a self
/// argument.
bool hasSelfParam() const {