summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Core.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-11-05 18:16:03 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-11-05 18:16:03 +0000
commitc5754a65e64126743644aec2631f165a0ac3ffe4 (patch)
treeb35cb05d283e1a11cf2012f2ff4b44116725a2cd /llvm/lib/IR/Core.cpp
parent8f093f4138e1ffafb7ee5344e012ba8dd952a055 (diff)
downloadbcm5719-llvm-c5754a65e64126743644aec2631f165a0ac3ffe4.tar.gz
bcm5719-llvm-c5754a65e64126743644aec2631f165a0ac3ffe4.zip
IR: MDNode => Value: NamedMDNode::getOperator()
Change `NamedMDNode::getOperator()` from returning `MDNode *` to returning `Value *`. To reduce boilerplate at some call sites, add a `getOperatorAsMDNode()` for named metadata that's expected to only return `MDNode` -- for now, that's everything, but debug node named metadata (such as llvm.dbg.cu and llvm.dbg.sp) will soon change. This is part of PR21433. Note that there's a follow-up patch to clang for the API change. llvm-svn: 221375
Diffstat (limited to 'llvm/lib/IR/Core.cpp')
-rw-r--r--llvm/lib/IR/Core.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index f6ab9197244..7e60e05fd00 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -560,8 +560,8 @@ LLVMValueRef LLVMGetMetadata(LLVMValueRef Inst, unsigned KindID) {
}
void LLVMSetMetadata(LLVMValueRef Inst, unsigned KindID, LLVMValueRef MD) {
- unwrap<Instruction>(Inst)->setMetadata(KindID,
- MD ? unwrap<MDNode>(MD) : nullptr);
+ unwrap<Instruction>(Inst)
+ ->setMetadata(KindID, MD ? unwrap<Value>(MD) : nullptr);
}
/*--.. Conversion functions ................................................--*/
@@ -720,7 +720,7 @@ void LLVMAddNamedMetadataOperand(LLVMModuleRef M, const char* name,
NamedMDNode *N = unwrap(M)->getOrInsertNamedMetadata(name);
if (!N)
return;
- MDNode *Op = Val ? unwrap<MDNode>(Val) : nullptr;
+ Value *Op = Val ? unwrap<Value>(Val) : nullptr;
if (Op)
N->addOperand(Op);
}
OpenPOWER on IntegriCloud