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:
parent
8156a5dcee
commit
a57e0b8f49
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user