Support MetaDataString, and correctly represent MetaData Values in _make_value

This commit is contained in:
Wladimir J. van der Laan 2012-09-12 21:11:33 +02:00
commit e2d8079b93
5 changed files with 31 additions and 3 deletions

View file

@ -159,6 +159,13 @@ unsigned LLVMMetaDataGetNumOperands(LLVMValueRef mdref)
return llvm::unwrap<llvm::MDNode>(mdref)->getNumOperands();
}
LLVMValueRef LLVMMetaDataStringGet(LLVMModuleRef modref, const char *s)
{
LLVMContext & context = unwrap(modref)->getContext();
MDString * const mdstring = MDString::get(context, s);
return wrap(mdstring);
}
const char *LLVMGetConstExprOpcodeName(LLVMValueRef inst)
{
return llvm::unwrap<llvm::ConstantExpr>(inst)->getOpcodeName();