[AST] Add functionality for computing Clang types for SIL functions.

This commit is contained in:
Varun Gandhi
2020-01-15 16:15:37 -08:00
parent feb76eaf18
commit bfa2f98d95
4 changed files with 92 additions and 6 deletions

View File

@@ -576,6 +576,10 @@ public:
Type getBridgedToObjC(const DeclContext *dc, Type type,
Type *bridgedValueType = nullptr) const;
private:
void initializeClangTypeConverter();
public:
/// Get the Clang type corresponding to a Swift function type.
///
/// \param params The function parameters.
@@ -589,6 +593,15 @@ public:
const FunctionType::ExtInfo incompleteExtInfo,
FunctionTypeRepresentation trueRep);
/// Get the canonical Clang type corresponding to a SIL function type.
///
/// SIL analog of \c ASTContext::getClangFunctionType .
const clang::Type *
getCanonicalClangFunctionType(
ArrayRef<SILParameterInfo> params, Optional<SILResultInfo> result,
const SILFunctionType::ExtInfo incompleteExtInfo,
SILFunctionType::Representation trueRep);
/// Determine whether the given Swift type is representable in a
/// given foreign language.
ForeignRepresentationInfo