[LLVMdev] LLVM segmentation fault / need use Instruction instead of Instruction*

Alexandru Ionut Diaconescu alexandruionutdiaconescu at gmail.com
Thu Dec 20 04:16:13 PST 2012


I solved by checking

if(BB->size()>1)

Thank you all for the help !

Now debugging the next segfault.

On Thu, Dec 20, 2012 at 12:59 PM, Alexandru Ionut Diaconescu <
alexandruionutdiaconescu at gmail.com> wrote:

> getPrevNode<http://llvm.org/docs/doxygen/html/classllvm_1_1ilist__node.html#a77b897207ef0a1ae95c404695aed9a4b>()
>  Get the previous node, or 0 for the list head. I don't see any method
> like hasPrevNode.
> It can be a weird problem because "current->getPrevNode()" is indicating
> to "current" itself (the problem appears for the BB with only one element)?
>
>
>
>
>
> On Thu, Dec 20, 2012 at 12:42 PM, Alexandru Ionut Diaconescu <
> alexandruionutdiaconescu at gmail.com> wrote:
>
>> Hello,
>>
>> Thank you for your answer. If I want to use
>>
>> then I have
>>
>> error: ‘NodeTy* llvm::ilist_half_node<NodeTy>::getPrev() [with NodeTy =
>> llvm::Instruction]’ is protected
>> error: ‘llvm::ilist_half_node<llvm::Instruction>’ is not an accessible
>> base of ‘llvm::Instruction’
>>
>> Do you know any other method to access the previous instruction of a
>> terminator instruction? PS: back() is not an option.
>>
>> On Thu, Dec 20, 2012 at 12:06 PM, Stephen McGruer <
>> stephen.mcgruer at gmail.com> wrote:
>>
>>> current->getPrev()
>>
>>
>>
>>
>> --
>> Best regards,
>> Alexandru Ionut Diaconescu
>>
>
>
>
> --
> Best regards,
> Alexandru Ionut Diaconescu
>



-- 
Best regards,
Alexandru Ionut Diaconescu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121220/b0f727a1/attachment.html>


More information about the llvm-dev mailing list