diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-11-01 00:10:31 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-11-01 00:10:31 +0000 |
commit | 3872d0084c4f479020ce01b4db5d1bd414c57fb8 (patch) | |
tree | fd1a9e83666fa84a3916b46a94cca32978b34794 /llvm/lib/IR/Instructions.cpp | |
parent | 7c4fc4e5ae4c8145974397da295587e77c770f62 (diff) | |
download | bcm5719-llvm-3872d0084c4f479020ce01b4db5d1bd414c57fb8.tar.gz bcm5719-llvm-3872d0084c4f479020ce01b4db5d1bd414c57fb8.zip |
IR: MDNode => Value: Instruction::getMetadata()
Change `Instruction::getMetadata()` to return `Value` as part of
PR21433.
Update most callers to use `Instruction::getMDNode()`, which wraps the
result in a `cast_or_null<MDNode>`.
llvm-svn: 221024
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r-- | llvm/lib/IR/Instructions.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index 1497aa885c5..6aaea75896e 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -791,7 +791,7 @@ void BranchInst::swapSuccessors() { // Update profile metadata if present and it matches our structural // expectations. - MDNode *ProfileData = getMetadata(LLVMContext::MD_prof); + MDNode *ProfileData = getMDNode(LLVMContext::MD_prof); if (!ProfileData || ProfileData->getNumOperands() != 3) return; @@ -2072,8 +2072,7 @@ void BinaryOperator::andIRFlags(const Value *V) { /// An accuracy of 0.0 means that the operation should be performed with the /// default precision. float FPMathOperator::getFPAccuracy() const { - const MDNode *MD = - cast<Instruction>(this)->getMetadata(LLVMContext::MD_fpmath); + const MDNode *MD = cast<Instruction>(this)->getMDNode(LLVMContext::MD_fpmath); if (!MD) return 0.0; ConstantFP *Accuracy = cast<ConstantFP>(MD->getOperand(0)); |