You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #147181 - Zalathar:fixed-metadata, r=petrochenkov
cg_llvm: Replace enum `MetadataType` with a list of `MetadataKindId` constants
The metadata kind ID values declared in `MetadataType` are not part of the LLVM-C API, and are not machine-checked. If a value that we use ever goes out of sync with LLVM, the resulting bugs could be difficult to track down. And the existing values lack any clear indication of what LLVM declarations they correspond to.
On top of that, we currently have another way of expressing metadata kind IDs in the form of `MetadataKindId`, which creates confusing inconsistency in LLVM bindings.
This PR therefore consolidates all usage of “fixed” metadata kind IDs into one list of `MetadataKindId` constants, which is backed by static assertions in our C++ code that match them up with named anonymous-enum variants in `llvm::LLVMContext`.
0 commit comments