<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 5/27/15 3:28 PM, Hui Zhang wrote:<br>
</div>
<blockquote
cite="mid:CAHUsaRFC2Nm6qCEnD-BqxarY+tNf6GxScHW0kXH+9aRw5q9z=A@mail.gmail.com"
type="cite">
<meta http-equiv="Context-Type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div class="gmail_default">Hello, John</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, May 27, 2015 at 3:37 PM, John
Criswell <span dir="ltr"><<a moz-do-not-send="true" href="mailto:jtcriswel@gmail.com" target="_blank">jtcriswel@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote">
<div><span class="">
<div>On 5/27/15 8:12 AM, Hui Zhang wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>Hello, Everyone<br>
<br>
</div>
<div>I'm using llvm 3.6 DIBuilder module to build
the debug information for Chapel language(the
Chapel-llvm front end works fine). When I run
the test program, I got these assertions failed:<br>
!718<br>
Expected no forward declarations!<br>
!719<br>
Expected no forward declarations!<br>
!720<br>
Expected no forward declarations!<br>
!721<br>
Expected no forward declarations!<br>
!722<br>
All nodes should be resolved!<br>
!716<br>
<br>
</div>
<div>How should I debug it since the bitcode file
isn't generated and I can't see what exactly
those MDNodes represent...<br>
</div>
</div>
</blockquote>
<br>
</span> You can probably disable the pass that verifies
the LLVM bitcode. If you're using opt, there's a
command-line option for that (use --help-hidden to find
it). If you're using a custom tool, you'll either need
to f
<div class="gmail_default"></div>
ind the option or modify its source code to disable it.<br>
</div>
</blockquote>
<div><br>
<div class="gmail_default">Here, "ind the option or
modify its source code to disable it", you mean change
the source code of the custom tool(I'm not using opt)
that trigger this assertion failure ? The part of code
that cause the failure is below: <br>
#if HAVE_LLVM_VER >= 35<br>
problems = verifyModule(*info->module,
&errs());<br>
#else<br>
problems = verifyModule(*info->module,
PrintMessageAction);<br>
#endif <br>
if(problems) {<br>
INT_FATAL("LLVM module verification failed");<br>
<br>
</div>
<div class="gmail_default">So you think I should just
remove that "verifyModule" line ?<br>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
Yes. If the error isn't too bad, you can probably get a malformed
LLVM bitcode file that you can disassemble with llvm-dis and
examine.<br>
<br>
<blockquote
cite="mid:CAHUsaRFC2Nm6qCEnD-BqxarY+tNf6GxScHW0kXH+9aRw5q9z=A@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div> </div>
<blockquote class="gmail_quote">
<div> <br>
Alternatively, run the program through a debugger so
that you break into the debugger when it hits the
assertion. You can then use the debugger to examine the
IR (using the dump() methods of various LLVM classes)
and see what is causing the problem.<br>
</div>
</blockquote>
<div><br>
<div class="gmail_default">I started it in gdb, but how
to use dump() in gdb ? <br>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
Let's say that gdb stops due to an assertion, and there's a local
variable of type Instruction * called inst. If you use the command
"call inst->dump()" in gdb, it will call Instruction::dump() on
inst, causing it to print out the instruction.<br>
<br>
Most LLVM classes (Instruction, BasicBlock, Function, Constant) have
a dump() method that you can call to print the human-readable
version of the object in the debugger. For more information on
calling C++ methods in gdb, you can consult the gdb documentation.<br>
<br>
Regards,<br>
<br>
John Criswell<br>
<br>
<blockquote
cite="mid:CAHUsaRFC2Nm6qCEnD-BqxarY+tNf6GxScHW0kXH+9aRw5q9z=A@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div>
<div class="gmail_default">Thanks<br>
<br>
</div>
</div>
<blockquote class="gmail_quote">
<div> <br>
Regards,<br>
<br>
John Criswell<br>
<br>
<blockquote type="cite"><span class="">
<div dir="ltr">
<div><br>
</div>
<div>Any information would be great appreciated,
not found any useful posts online yet<br>
<br>
</div>
<div>Thanks a lot !<br>
</div>
<br>
-- <br>
<div>Best regards<br>
<br>
<br>
Hui Zhang<br>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
</span>
<pre>_______________________________________________
LLVM Developers mailing list
<a moz-do-not-send="true" href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a moz-do-not-send="true" href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a>
<a moz-do-not-send="true" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><span class="">
</span></pre>
<span class=""> </span></blockquote>
<span class=""> <br>
<br>
<pre cols="72">--
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a moz-do-not-send="true" href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cs.rochester.edu_u_criswell&d=AwMDaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=-Ic13UVVpfEcTbx-JrVlwOKDyyjWQO_pY9z-KYjNMeM&s=tI3UUxWG9HFTAkw8vuDcXtknfMhZNEUcxV1wirTNiRM&e=" target="_blank">http://www.cs.rochester.edu/u/criswell</a></pre>
</span></div>
</blockquote>
</div>
<br>
<br>
<br>
-- <br>
<div class="gmail_signature">Best regards<br>
<br>
<br>
Hui Zhang<br>
</div>
</div>
</div>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cs.rochester.edu_u_criswell&d=AwMDaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=-Ic13UVVpfEcTbx-JrVlwOKDyyjWQO_pY9z-KYjNMeM&s=tI3UUxWG9HFTAkw8vuDcXtknfMhZNEUcxV1wirTNiRM&e=">http://www.cs.rochester.edu/u/criswell</a></pre>
</body>
</html>