Accessing metadata on instructions

I’m traversing instructions in a function and when I find a GEP I want to test to see if it has some custom metadata I’m attaching. I would think the obvious methods to call here would be .hasMetadata and .getMetadata, but these are protected classes on Value, meaning Instruction can’t call them. What am I supposed to do here instead?

Thanks.

Instruction provides hasMetadata and getMetadata as public member functions: LLVM: llvm::Instruction Class Reference

Oh, my LSP was giving me an error that they were protected functions but this was because I was accidentally storing them as Value *'s, my bad - thanks.