From 3872d0084c4f479020ce01b4db5d1bd414c57fb8 Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Sat, 1 Nov 2014 00:10:31 +0000 Subject: 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`. llvm-svn: 221024 --- llvm/lib/IR/Verifier.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/IR/Verifier.cpp') diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index b7c2ee24111..e2fb62fdeef 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -2267,7 +2267,7 @@ void Verifier::visitInstruction(Instruction &I) { } } - if (MDNode *MD = I.getMetadata(LLVMContext::MD_fpmath)) { + if (MDNode *MD = I.getMDNode(LLVMContext::MD_fpmath)) { Assert1(I.getType()->isFPOrFPVectorTy(), "fpmath requires a floating point result!", &I); Assert1(MD->getNumOperands() == 1, "fpmath takes one operand!", &I); @@ -2281,7 +2281,7 @@ void Verifier::visitInstruction(Instruction &I) { } } - if (MDNode *Range = I.getMetadata(LLVMContext::MD_range)) { + if (MDNode *Range = I.getMDNode(LLVMContext::MD_range)) { Assert1(isa(I) || isa(I) || isa(I), "Ranges are only for loads, calls and invokes!", &I); visitRangeMetadata(I, Range, I.getType()); @@ -2587,7 +2587,7 @@ void DebugInfoVerifier::verifyDebugInfo() { void DebugInfoVerifier::processInstructions(DebugInfoFinder &Finder) { for (const Function &F : *M) for (auto I = inst_begin(&F), E = inst_end(&F); I != E; ++I) { - if (MDNode *MD = I->getMetadata(LLVMContext::MD_dbg)) + if (MDNode *MD = I->getMDNode(LLVMContext::MD_dbg)) Finder.processLocation(*M, DILocation(MD)); if (const CallInst *CI = dyn_cast(&*I)) processCallInst(Finder, *CI); -- cgit v1.2.3