[LLVMdev] minimum function ir

Pete Couperus pjcoup at gmail.com
Mon Apr 22 08:09:23 PDT 2013


Hello Reed,

Basic blocks need to end with a terminator instruction.
There is an "unreachable" terminator instruction, whose documentation says:
"the presence of this instruction indicates some higher level knowledge
that the end of the block cannot be reached."
(see include/llvm/IR/Instructions.h).
I've been able to suppress the return using this.  I'm not completely clear
if this would be the right use for your scenario.

Pete




On Sat, Apr 20, 2013 at 2:16 PM, Reed Kotler <rkotler at mips.com> wrote:

> On 04/20/2013 02:04 PM, Reed Kotler wrote:
>
>> On 04/20/2013 01:30 PM, reed kotler wrote:
>>
>>> Can I create a "naked" function that has only inline assembler and no
>>> return IR for example?
>>>
>>> If I create just a function will an empty basic block, it's core dumps.
>>>
>>> I'm debugging it now.
>>>
>>
>> Seems that you have to have at least a return instruction.
>>
>> Is that a bug?
>>
>> Why can't I do the return myself if it's all inline assembly code.
>>
>
> It's not hard for me to suppress the return in "naked" functions.
>
>
>
>
> ______________________________**_________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130422/4f7a8965/attachment.html>


More information about the llvm-dev mailing list