<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 3/6/12 8:42 AM, Buse Yilmaz wrote:
<blockquote
cite="mid:CAABuHQWrXfOasU5iusN+3ftXHfK+hAPjwRuWPzKMFOL3qz7m-A@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
Hi all,<br>
I wrote a pass (attached). But I get a runtime error:<br>
</blockquote>
<br>
It looks like you're using a Release build of LLVM. I recommend
compiling LLVM and your pass in a Debug build; that will generate
asserts and provide source line information so that you can more
easily debug the problem.<br>
<br>
I don't have time to look at your code in detail (and chances are
good that nobody else on the list does, either), but if I had to
guess, you're probably assuming that a value is always non-NULL when
it can be NULL. I'd double check that F and other critical values
are non-NULL by adding assert statements.<br>
<br>
-- John T.<br>
<br>
<blockquote
cite="mid:CAABuHQWrXfOasU5iusN+3ftXHfK+hAPjwRuWPzKMFOL3qz7m-A@mail.gmail.com"
type="cite"><br>
<a class="moz-txt-link-abbreviated" href="mailto:buse@buse-VB:~/Desktop/llvm-2.7/lib/Transforms/CG_CFG$">buse@buse-VB:~/Desktop/llvm-2.7/lib/Transforms/CG_CFG$</a> opt-2.7
-load ../../../Release/lib/_CG_CFGGen.so -CG_CFGGen <
../../../buse/simpleCode.bc > /dev/null<br>
0xa7bae0:<br>
0 libLLVM-2.7.so.1 0x00007f4a8b6add1f<br>
1 libLLVM-2.7.so.1 0x00007f4a8b6ae36d<br>
2 libpthread.so.0 0x00007f4a8aa98b40<br>
3 _CG_CFGGen.so 0x00007f4a8995891f<br>
4 libLLVM-2.7.so.1 0x00007f4a8b329608
llvm::MPPassManager::runOnModule(llvm::Module&) + 376<br>
5 libLLVM-2.7.so.1 0x00007f4a8b32972b
llvm::PassManagerImpl::run(llvm::Module&) + 107<br>
6 opt-2.7 0x0000000000415df3 main + 2035<br>
7 libc.so.6 0x00007f4a89b79d8e __libc_start_main + 254<br>
8 opt-2.7 0x0000000000409569<br>
Stack dump:<br>
0. Program arguments: opt-2.7 -load
../../../Release/lib/_CG_CFGGen.so -CG_CFGGen <br>
1. Running pass 'Unnamed pass: implement Pass::getPassName()'
on module '<stdin>'.<br>
Segmentation fault<br>
<a class="moz-txt-link-abbreviated" href="mailto:buse@buse-VB:~/Desktop/llvm-2.7/lib/Transforms/CG_CFG$">buse@buse-VB:~/Desktop/llvm-2.7/lib/Transforms/CG_CFG$</a> <br>
<br clear="all">
I couldn't diagnose the problem. Any ideas?<br>
-- <br>
Buse<br>
<div><br>
</div>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</body>
</html>