[PATCH] D77077: [clang] CodeGen: Make getOrEmitProtocol public for Swift

2020-04-01 Thread Arnold Schwaighofer via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG153dadf3a3ca: [clang] CodeGen: Make getOrEmitProtocol public for Swift (authored by aschwaighofer). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77077/new/

[PATCH] D77077: [clang] CodeGen: Make getOrEmitProtocol public for Swift

2020-04-01 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. Thanks, LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77077/new/ https://reviews.llvm.org/D77077 __

[PATCH] D77077: [clang] CodeGen: Make getOrEmitProtocol public for Swift

2020-04-01 Thread Arnold Schwaighofer via Phabricator via cfe-commits
aschwaighofer marked an inline comment as done. aschwaighofer added inline comments. Comment at: clang/lib/CodeGen/CGObjCRuntime.h:217 + /// ProtocolPtrTy. + virtual llvm::Constant *GetOrEmitProtocol(const ObjCProtocolDecl *PD) = 0; + rjmccall wrote: > aschwaig

[PATCH] D77077: [clang] CodeGen: Make getOrEmitProtocol public for Swift

2020-04-01 Thread Arnold Schwaighofer via Phabricator via cfe-commits
aschwaighofer updated this revision to Diff 254171. aschwaighofer added a comment. - Implement for the GNU runtimes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77077/new/ https://reviews.llvm.org/D77077 Files: clang/include/clang/CodeGen/CodeG

[PATCH] D77077: [clang] CodeGen: Make getOrEmitProtocol public for Swift

2020-03-31 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/lib/CodeGen/CGObjCRuntime.h:217 + /// ProtocolPtrTy. + virtual llvm::Constant *GetOrEmitProtocol(const ObjCProtocolDecl *PD) = 0; + aschwaighofer wrote: > aschwaighofer wrote: > > rjmccall wrote: > > > Can this

[PATCH] D77077: [clang] CodeGen: Make getOrEmitProtocol public for Swift

2020-03-31 Thread Arnold Schwaighofer via Phabricator via cfe-commits
aschwaighofer marked an inline comment as done. aschwaighofer added inline comments. Comment at: clang/lib/CodeGen/CGObjCRuntime.h:217 + /// ProtocolPtrTy. + virtual llvm::Constant *GetOrEmitProtocol(const ObjCProtocolDecl *PD) = 0; + aschwaighofer wrote: > rjm

[PATCH] D77077: [clang] CodeGen: Make getOrEmitProtocol public for Swift

2020-03-31 Thread Arnold Schwaighofer via Phabricator via cfe-commits
aschwaighofer marked an inline comment as done. aschwaighofer added inline comments. Comment at: clang/lib/CodeGen/CGObjCRuntime.h:217 + /// ProtocolPtrTy. + virtual llvm::Constant *GetOrEmitProtocol(const ObjCProtocolDecl *PD) = 0; + rjmccall wrote: > Can this

[PATCH] D77077: [clang] CodeGen: Make getOrEmitProtocol public for Swift

2020-03-31 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/lib/CodeGen/CGObjCGNU.cpp:623 +llvm_unreachable("not implemented"); + } + I think this is just the (unfortunately-named) `GenerateProtocolRef` (the one that just takes a protocol and not a CGF). ==

[PATCH] D77077: [clang] CodeGen: Make getOrEmitProtocol public for Swift

2020-03-31 Thread Arnold Schwaighofer via Phabricator via cfe-commits
aschwaighofer marked an inline comment as done. aschwaighofer added inline comments. Comment at: clang/include/clang/CodeGen/CodeGenABITypes.h:148 + llvm::function_ref + createProtocolReference); } // end namespace CodeGen rj

[PATCH] D77077: [clang] CodeGen: Make getOrEmitProtocol public for Swift

2020-03-31 Thread Arnold Schwaighofer via Phabricator via cfe-commits
aschwaighofer updated this revision to Diff 253938. aschwaighofer added a comment. - Remove callback. Swift can inspect the generated IR and update it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77077/new/ https://reviews.llvm.org/D77077 Files:

[PATCH] D77077: [clang] CodeGen: Make getOrEmitProtocol public for Swift

2020-03-30 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/include/clang/CodeGen/CodeGenABITypes.h:148 + llvm::function_ref + createProtocolReference); } // end namespace CodeGen aschwaighofer wrote: > rjmccall wrote: > > I would call

[PATCH] D77077: [clang] CodeGen: Make getOrEmitProtocol public for Swift

2020-03-30 Thread Arnold Schwaighofer via Phabricator via cfe-commits
aschwaighofer updated this revision to Diff 253712. aschwaighofer added a comment. - Change API name to emitObjCProtocolObject. - Make stuff compile on current ToT. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77077/new/ https://reviews.llvm.org/D

[PATCH] D77077: [clang] CodeGen: Make getOrEmitProtocol public for Swift

2020-03-30 Thread Arnold Schwaighofer via Phabricator via cfe-commits
aschwaighofer marked an inline comment as done. aschwaighofer added inline comments. Comment at: clang/include/clang/CodeGen/CodeGenABITypes.h:148 + llvm::function_ref + createProtocolReference); } // end namespace CodeGen rj

[PATCH] D77077: [clang] CodeGen: Make getOrEmitProtocol public for Swift

2020-03-30 Thread Arnold Schwaighofer via Phabricator via cfe-commits
aschwaighofer added a 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. The objective C protocol references other protocols

[PATCH] D77077: [clang] CodeGen: Make getOrEmitProtocol public for Swift

2020-03-30 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: clang/include/clang/CodeGen/CodeGenABITypes.h:148 + llvm::function_ref + createProtocolReference); } // end namespace CodeGen I would call this `emitObjCProtocolObject` or something

[PATCH] D77077: [clang] CodeGen: Make getOrEmitProtocol public for Swift

2020-03-30 Thread Arnold Schwaighofer via Phabricator via cfe-commits
aschwaighofer created this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. 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