<div dir="ltr">The debug metadata format has changed quite a bit since that code was written. I'd suggest taking a look in top of tree to see the format of how things are working together now. DwarfDebug.cpp will have quite a bit of information as will DIBuilder.h<div><br></div><div>-eric</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jun 26, 2015 at 9:33 AM Peter Finn <<a href="mailto:peterdfinn@icloud.com">peterdfinn@icloud.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I’m trying to debug DebugInstrumentation.cpp, and I got the following errors.  I don’t know what to make of them.  The constructor for DILocation requires 5 arguments, and I don’t know what I would use as the arguments if I were to correct this code.  Also, the type “DIDescriptor” apparently doesn’t exist: has it been renamed?  What’s going on?<div><br></div><div>Thanks,</div><div>Peter Finn</div><div><br></div><div><div style="margin:0px;font-size:11px;font-family:Menlo">llvm[2]: Compiling DebugInstrumentation.cpp for Debug+Asserts build</div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/projects/safecode/lib/DebugInstrumentation/DebugInstrumentation.cpp:170:16: </b><span style="color:#c33720"><b>error: </b></span><b>no matching constructor for</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>      initialization of 'llvm::DILocation'</b></div><div style="margin:0px;font-size:11px;font-family:Menlo">    DILocation Loc (Dbg);</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)"><b>               ^    ~~~</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/include/llvm/IR/DebugInfoMetadata.h:1128:7: note: </b>candidate constructor (the implicit copy constructor) not</div><div style="margin:0px;font-size:11px;font-family:Menlo">      viable: no known conversion from 'llvm::MDNode *' to 'const llvm::DILocation' for 1st argument</div><div style="margin:0px;font-size:11px;font-family:Menlo">class DILocation : public MDNode {</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)"><b>      ^</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/include/llvm/IR/DebugInfoMetadata.h:1132:3: note: </b>candidate constructor not viable: requires 5 arguments, but</div><div style="margin:0px;font-size:11px;font-family:Menlo">      1 was provided</div><div style="margin:0px;font-size:11px;font-family:Menlo">  DILocation(LLVMContext &C, StorageType Storage, unsigned Line,</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)"><b>  ^</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/projects/safecode/lib/DebugInstrumentation/DebugInstrumentation.cpp:243:9: </b><span style="color:#c33720"><b>error: </b></span><b>unknown type name</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>      'DIDescriptor'; did you mean 'Intrinsic::IITDescriptor'?</b></div><div style="margin:0px;font-size:11px;font-family:Menlo">        DIDescriptor DIG(cast<MDNode>(NMD->getOperand(i)));</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)"><b>        ^~~~~~~~~~~~</b></div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)">        Intrinsic::IITDescriptor</div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/include/llvm/IR/Intrinsics.h:80:10: note: </b>'Intrinsic::IITDescriptor' declared here</div><div style="margin:0px;font-size:11px;font-family:Menlo">  struct IITDescriptor {</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)"><b>         ^</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/projects/safecode/lib/DebugInstrumentation/DebugInstrumentation.cpp:243:22: </b><span style="color:#c33720"><b>error: </b></span><b>no matching constructor for</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>      initialization of 'llvm::Intrinsic::IITDescriptor'</b></div><div style="margin:0px;font-size:11px;font-family:Menlo">        DIDescriptor DIG(cast<MDNode>(NMD->getOperand(i)));</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)"><b>                     ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/include/llvm/IR/Intrinsics.h:80:10: note: </b>candidate constructor (the implicit copy constructor) not viable: no</div><div style="margin:0px;font-size:11px;font-family:Menlo">      known conversion from 'typename cast_retty<MDNode, MDNode *>::ret_type' (aka 'llvm::MDNode *') to 'const llvm::Intrinsic::IITDescriptor' for</div><div style="margin:0px;font-size:11px;font-family:Menlo">      1st argument</div><div style="margin:0px;font-size:11px;font-family:Menlo">  struct IITDescriptor {</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)"><b>         ^</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/include/llvm/IR/Intrinsics.h:80:10: note: </b>candidate constructor (the implicit move constructor) not viable: no</div><div style="margin:0px;font-size:11px;font-family:Menlo">      known conversion from 'typename cast_retty<MDNode, MDNode *>::ret_type' (aka 'llvm::MDNode *') to 'llvm::Intrinsic::IITDescriptor' for 1st</div><div style="margin:0px;font-size:11px;font-family:Menlo">      argument</div><div style="margin:0px;font-size:11px;font-family:Menlo">  struct IITDescriptor {</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)"><b>         ^</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/include/llvm/IR/Intrinsics.h:80:10: note: </b>candidate constructor (the implicit default constructor) not viable:</div><div style="margin:0px;font-size:11px;font-family:Menlo">      requires 0 arguments, but 1 was provided</div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/projects/safecode/lib/DebugInstrumentation/DebugInstrumentation.cpp:246:13: </b><span style="color:#c33720"><b>error: </b></span><b>no matching conversion for</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>      functional-style cast from 'llvm::MDNode *' to 'llvm::DIGlobalVariable'</b></div><div style="margin:0px;font-size:11px;font-family:Menlo">        if (DIGlobalVariable(NMD->getOperand(i)).getGlobal() == GV) {</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)"><b>            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/include/llvm/IR/DebugInfoMetadata.h:1772:7: note: </b>candidate constructor (the implicit copy constructor) not</div><div style="margin:0px;font-size:11px;font-family:Menlo">      viable: no known conversion from 'llvm::MDNode *' to 'const llvm::DIGlobalVariable' for 1st argument</div><div style="margin:0px;font-size:11px;font-family:Menlo">class DIGlobalVariable : public DIVariable {</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)"><b>      ^</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/include/llvm/IR/DebugInfoMetadata.h:1779:3: note: </b>candidate constructor not viable: requires 6 arguments, but</div><div style="margin:0px;font-size:11px;font-family:Menlo">      1 was provided</div><div style="margin:0px;font-size:11px;font-family:Menlo">  DIGlobalVariable(LLVMContext &C, StorageType Storage, unsigned Line,</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)"><b>  ^</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/projects/safecode/lib/DebugInstrumentation/DebugInstrumentation.cpp:247:28: </b><span style="color:#c33720"><b>error: </b></span><b>no matching constructor for</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>      initialization of 'llvm::DIGlobalVariable'</b></div><div style="margin:0px;font-size:11px;font-family:Menlo">          DIGlobalVariable Var(NMD->getOperand(i));</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)"><b>                           ^   ~~~~~~~~~~~~~~~~~~</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/include/llvm/IR/DebugInfoMetadata.h:1772:7: note: </b>candidate constructor (the implicit copy constructor) not</div><div style="margin:0px;font-size:11px;font-family:Menlo">      viable: no known conversion from 'llvm::MDNode *' to 'const llvm::DIGlobalVariable' for 1st argument</div><div style="margin:0px;font-size:11px;font-family:Menlo">class DIGlobalVariable : public DIVariable {</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)"><b>      ^</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/include/llvm/IR/DebugInfoMetadata.h:1779:3: note: </b>candidate constructor not viable: requires 6 arguments, but</div><div style="margin:0px;font-size:11px;font-family:Menlo">      1 was provided</div><div style="margin:0px;font-size:11px;font-family:Menlo">  DIGlobalVariable(LLVMContext &C, StorageType Storage, unsigned Line,</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)"><b>  ^</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/projects/safecode/lib/DebugInstrumentation/DebugInstrumentation.cpp:256:20: </b><span style="color:#c33720"><b>error: </b></span><b>no matching constructor for</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>      initialization of 'llvm::DILocation'</b></div><div style="margin:0px;font-size:11px;font-family:Menlo">        DILocation Loc (Dbg);</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)"><b>                   ^    ~~~</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/include/llvm/IR/DebugInfoMetadata.h:1128:7: note: </b>candidate constructor (the implicit copy constructor) not</div><div style="margin:0px;font-size:11px;font-family:Menlo">      viable: no known conversion from 'llvm::MDNode *' to 'const llvm::DILocation' for 1st argument</div><div style="margin:0px;font-size:11px;font-family:Menlo">class DILocation : public MDNode {</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)"><b>      ^</b></div><div style="margin:0px;font-size:11px;font-family:Menlo"><b>/Users/peterfinn/Desktop/llvm_trunk_2/include/llvm/IR/DebugInfoMetadata.h:1132:3: note: </b>candidate constructor not viable: requires 5 arguments, but</div><div style="margin:0px;font-size:11px;font-family:Menlo">      1 was provided</div><div style="margin:0px;font-size:11px;font-family:Menlo">  DILocation(LLVMContext &C, StorageType Storage, unsigned Line,</div><div style="margin:0px;font-size:11px;font-family:Menlo;color:rgb(52,189,38)"><b>  ^</b></div><div style="margin:0px;font-size:11px;font-family:Menlo">6 errors generated.</div></div></div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" rel="noreferrer" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div>