|
18 | 18 | #include "ClangTypeConverter.h"
|
19 | 19 | #include "ForeignRepresentationInfo.h"
|
20 | 20 | #include "SubstitutionMapStorage.h"
|
21 |
| -#include "swift/AST/ForeignAsyncConvention.h" |
22 | 21 | #include "swift/AST/ClangModuleLoader.h"
|
23 | 22 | #include "swift/AST/ConcreteDeclRef.h"
|
24 | 23 | #include "swift/AST/DiagnosticEngine.h"
|
25 | 24 | #include "swift/AST/DiagnosticsSema.h"
|
26 | 25 | #include "swift/AST/ExistentialLayout.h"
|
27 | 26 | #include "swift/AST/FileUnit.h"
|
| 27 | +#include "swift/AST/ForeignAsyncConvention.h" |
28 | 28 | #include "swift/AST/ForeignErrorConvention.h"
|
29 | 29 | #include "swift/AST/GenericEnvironment.h"
|
30 | 30 | #include "swift/AST/GenericSignature.h"
|
|
41 | 41 | #include "swift/AST/PropertyWrappers.h"
|
42 | 42 | #include "swift/AST/ProtocolConformance.h"
|
43 | 43 | #include "swift/AST/RawComment.h"
|
| 44 | +#include "swift/AST/SILLayout.h" |
44 | 45 | #include "swift/AST/SemanticAttrs.h"
|
45 | 46 | #include "swift/AST/SourceFile.h"
|
46 | 47 | #include "swift/AST/SubstitutionMap.h"
|
47 |
| -#include "swift/AST/SILLayout.h" |
48 | 48 | #include "swift/AST/TypeCheckRequests.h"
|
49 | 49 | #include "swift/Basic/Compiler.h"
|
50 | 50 | #include "swift/Basic/SourceManager.h"
|
51 | 51 | #include "swift/Basic/Statistic.h"
|
52 | 52 | #include "swift/Basic/StringExtras.h"
|
53 |
| -#include "swift/Syntax/References.h" |
54 |
| -#include "swift/Syntax/SyntaxArena.h" |
55 | 53 | #include "swift/Strings.h"
|
56 | 54 | #include "swift/Subsystems.h"
|
| 55 | +#include "swift/Syntax/References.h" |
| 56 | +#include "swift/Syntax/SyntaxArena.h" |
57 | 57 | #include "llvm/ADT/DenseMap.h"
|
58 | 58 | #include "llvm/ADT/Statistic.h"
|
59 | 59 | #include "llvm/ADT/StringMap.h"
|
@@ -4563,6 +4563,21 @@ ASTContext::getCanonicalClangFunctionType(
|
4563 | 4563 | return ty ? ty->getCanonicalTypeInternal().getTypePtr() : nullptr;
|
4564 | 4564 | }
|
4565 | 4565 |
|
| 4566 | +std::unique_ptr<TemplateInstantiationError> |
| 4567 | +ASTContext::getClangTemplateArguments( |
| 4568 | + const clang::TemplateParameterList *templateParams, |
| 4569 | + ArrayRef<Type> genericArgs, |
| 4570 | + SmallVectorImpl<clang::TemplateArgument> &templateArgs) { |
| 4571 | + auto &impl = getImpl(); |
| 4572 | + if (!impl.Converter) { |
| 4573 | + auto *cml = getClangModuleLoader(); |
| 4574 | + impl.Converter.emplace(*this, cml->getClangASTContext(), LangOpts.Target); |
| 4575 | + } |
| 4576 | + |
| 4577 | + return impl.Converter->getClangTemplateArguments(templateParams, genericArgs, |
| 4578 | + templateArgs); |
| 4579 | +} |
| 4580 | + |
4566 | 4581 | const Decl *
|
4567 | 4582 | ASTContext::getSwiftDeclForExportedClangDecl(const clang::Decl *decl) {
|
4568 | 4583 | auto &impl = getImpl();
|
|
0 commit comments