Details
- Reviewers
pcc
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Hi, I modified triples to aarch64 ones in https://github.com/llvm/llvm-project/blob/main/clang/test/CodeGenCXX/type-metadata.cpp, and was able to get type metadata on the generated IR.
So send out this patch which seems outdated.
The code where vtable type metadata is annotated (https://github.com/llvm/llvm-project/blob/c9d14b23292979a9b3846cd55e2fc4d96b20f33f/clang/lib/CodeGen/CGVTables.cpp#L1328) doesn't seem to rely on target-specific information. May I get some input on where the x86_64 limitation is initially added (even if it's just an implementation artifact)?
A best-effort exhaustive test would tell the list of supported architectures currently but could become stale; so if there is no target-specific dependency, i wonder if 'the type metadata is generated on arch1, arch2.. and could be extended at <pointer> for other archs' (which I would need input with).
This is function type metadata, which uses a separate implementation to vtable type metadata that is platform-dependent. See LowerTypeTestsModule::createJumpTableEntry for the list of supported architectures.
thanks! Just to make sure my understanding is correct,
- LowerTypeTests.cpp makes use of function type metadata to emit jump tables, and the support for jump table is platform-dependent (which makes sense).
- Assuming that function type metadata is generated in Clang (at this place https://github.com/llvm/llvm-project/blob/7dc5635d71ea919c933a6dc7c204d7bcfb8711b8/clang/lib/CodeGen/CodeGenModule.cpp#L2177), the generation of function type metadata doesn't seem to be platform dependent.
The reason to update this part is that type metadata exist in non x86-64 IR, and used in places more than creating jump-table entries. So I thought the update would be useful for availability of the metadata (more than the platform-dependent use of it).
What are we using function type metadata for besides CFI? I couldn't find any evidence of it being used for anything else.