1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

Add support to add named metadata operand.

Patch by Andrew Wilkins!

llvm-svn: 146984
This commit is contained in:
Devang Patel 2011-12-20 19:29:36 +00:00
parent 8156a5dcee
commit a57e0b8f49
2 changed files with 13 additions and 0 deletions

View File

@ -567,6 +567,8 @@ LLVMValueRef LLVMMDNode(LLVMValueRef *Vals, unsigned Count);
const char *LLVMGetMDString(LLVMValueRef V, unsigned* Len);
unsigned LLVMGetNamedMetadataNumOperands(LLVMModuleRef M, const char* name);
void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char* name, LLVMValueRef *Dest);
void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char* name,
LLVMValueRef Val);
/* Operations on scalar constants */
LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,

View File

@ -566,6 +566,17 @@ void LLVMGetNamedMetadataOperands(LLVMModuleRef M, const char* name, LLVMValueRe
Dest[i] = wrap(N->getOperand(i));
}
void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char* name,
LLVMValueRef Val)
{
NamedMDNode *N = unwrap(M)->getOrInsertNamedMetadata(name);
if (!N)
return;
MDNode *Op = Val ? unwrap<MDNode>(Val) : NULL;
if (Op)
N->addOperand(Op);
}
/*--.. Operations on scalar constants ......................................--*/
LLVMValueRef LLVMConstInt(LLVMTypeRef IntTy, unsigned long long N,