@@ -318,24 +318,32 @@ ClangRepresentation DeclAndTypeClangFunctionPrinter::printFunctionSignature(
318
318
const AbstractFunctionDecl *FD, StringRef name, Type resultTy,
319
319
FunctionSignatureKind kind, ArrayRef<AdditionalParam> additionalParams,
320
320
FunctionSignatureModifiers modifiers) {
321
- if (kind == FunctionSignatureKind::CxxInlineThunk && FD->isGeneric ()) {
322
- os << " template<" ;
323
- llvm::interleaveComma (FD->getGenericParams ()->getParams (), os,
324
- [&](const GenericTypeParamDecl *genericParam) {
325
- os << " class " ;
326
- ClangSyntaxPrinter (os).printBaseName (genericParam);
327
- });
328
- os << " >\n " ;
329
- os << " requires " ;
330
- llvm::interleave (
331
- FD->getGenericParams ()->getParams (), os,
332
- [&](const GenericTypeParamDecl *genericParam) {
333
- os << " swift::isUsableInGenericContext<" ;
334
- ClangSyntaxPrinter (os).printBaseName (genericParam);
335
- os << " >" ;
336
- },
337
- " && " );
338
- os << " \n " ;
321
+ if (FD->isGeneric ()) {
322
+ auto Signature = FD->getGenericSignature ();
323
+ auto Requirements = Signature.getRequirements ();
324
+ // FIXME: Support generic requirements.
325
+ if (!Requirements.empty ())
326
+ return ClangRepresentation::unsupported;
327
+ if (kind == FunctionSignatureKind::CxxInlineThunk) {
328
+ os << " template<" ;
329
+ llvm::interleaveComma (FD->getGenericParams ()->getParams (), os,
330
+ [&](const GenericTypeParamDecl *genericParam) {
331
+ os << " class " ;
332
+ ClangSyntaxPrinter (os).printBaseName (
333
+ genericParam);
334
+ });
335
+ os << " >\n " ;
336
+ os << " requires " ;
337
+ llvm::interleave (
338
+ FD->getGenericParams ()->getParams (), os,
339
+ [&](const GenericTypeParamDecl *genericParam) {
340
+ os << " swift::isUsableInGenericContext<" ;
341
+ ClangSyntaxPrinter (os).printBaseName (genericParam);
342
+ os << " >" ;
343
+ },
344
+ " && " );
345
+ os << " \n " ;
346
+ }
339
347
}
340
348
auto emittedModule = FD->getModuleContext ();
341
349
OutputLanguageMode outputLang = kind == FunctionSignatureKind::CFunctionProto
0 commit comments