[llvm] XCOFF associated metadata (PR #159096)
Sean Fertile via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 30 12:12:32 PDT 2025
================
@@ -766,6 +766,30 @@ void Verifier::visitGlobalValue(const GlobalValue &GV) {
DL.getIntPtrType(GO->getType()),
RangeLikeMetadataKind::AbsoluteSymbol);
}
+
+ if (GO->hasMetadata(LLVMContext::MD_ref)) {
+ SmallVector<MDNode *> MDs;
+ GO->getMetadata(LLVMContext::MD_ref, MDs);
+ for (const MDNode *MD : MDs) {
+ Check(MD->getNumOperands() == 1, "ref metadata must have one operand",
----------------
mandlebug wrote:
One difference with the callees metadata though is it is added in one place and never modified afterwards. For this metadata it is possible you could have 2 different features that require implicit references to be added. In that case would you have to get the existing array of refs, duplicate and append to it, then create a new metadata node with that array? Or are you suggesting we support both arrays of refs, and multiple individual refs as well? I'm not sure I'm particularly fond of either approach.
https://github.com/llvm/llvm-project/pull/159096
More information about the llvm-commits
mailing list