mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221375 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -55,7 +55,7 @@ struct BreakpointPrinter : public ModulePass {
|
||||
if (NamedMDNode *NMD = M.getNamedMetadata("llvm.dbg.sp"))
|
||||
for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) {
|
||||
std::string Name;
|
||||
DISubprogram SP(NMD->getOperand(i));
|
||||
DISubprogram SP(cast_or_null<MDNode>(NMD->getOperand(i)));
|
||||
assert((!SP || SP.isSubprogram()) &&
|
||||
"A MDNode in llvm.dbg.sp should be null or a DISubprogram.");
|
||||
if (!SP)
|
||||
|
Reference in New Issue
Block a user