In the LLVM version 3.6 they have changed the metadata class a lot and they have split the metadata from value. so my previous code based on 3.5 version doesn't work anymore. I am having difficulties upgrading my code. Can anybody help.
e.g. : previous code :
MDNode *record;
Value *undVal = record->getOperand(1);
Type *type_hint = undVal->getType();
Does anyone know how to upgrade this code to make it 3.6 compatible ?
I tried this :
MDNode *record;
const MDOperand &undVal = record->getOperand(1);
Type *type_hint = undVal->getType();
But it doesn't work. Results in compile errors saying
'getType' : is not a member of 'llvm::Metadata'
Any help is appreciated.
MDNode *record;
Value *undVal = dyn_cast<ValueAsMetadata>(record->getOperand(1))->getValue();
@sadeq suggestion wasn't compiling for me, but was definitely as step in the right direction.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With