Swift would like to use clang's abis to emit protocol declarations.
It needs to a hook to register when inherited protocols are emitted.
This commits adds the public API:
emitProtocolDecl(CodeGenModule &CGM, const ObjCProtocolDecl *p,
llvm::function_ref<llvm::Constant *(const ObjCProtocolDecl *)> createProtocolReference);
rdar://60888524
I would call this emitObjCProtocolObject or something, and maybe say in the comment:
Can you explain the need for the callback? Are you expecting to use this for Swift-declared protocols by synthesizing an ObjC protocol declaration for them? I can see why you'd need a callback in that case.