[PATCH] D123304: [clang][extract-api] Emit "functionSignature" in SGF for ObjC methods.
Zixu Wang via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 11 10:00:52 PDT 2022
zixuw added inline comments.
================
Comment at: clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp:495
+ if (const auto *Method = dyn_cast<ObjCMethodRecord>(Member.get()))
+ serializeObject(*MemberRecord, "functionSignature",
----------------
dang wrote:
> zixuw wrote:
> > I'd prefer not to use `dyn_cast` as `MemberTy` here is a concrete type. So maybe a type trait `has_function_signature` and a `if constexpr`?
> `if constexpr` is c++17 which we don't support yet? Anyway I added the type trait and implemented this a bit lower down the "stack" (in serializeAPIRecord) as there are multiple record types that have signatures. This is done using tag dispatch based on the trait.
Hmm.. That's a bummer. Didn't realize that when I made the suggestion. I actually don't have that strong an opinion regarding the `dyn_cast`.
What do you think? Do you think it's still worth going through all these to get the type trait working?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D123304/new/
https://reviews.llvm.org/D123304
More information about the cfe-commits
mailing list