[LLVMdev] how to know whether a function is a declaration or definition

Hui Zhang wayne.huizhang at gmail.com
Wed Mar 11 11:36:14 PDT 2015


Thank you all, guys !

On Wed, Mar 11, 2015 at 2:28 PM, Victor Campos <vhscampos at gmail.com> wrote:

> Hi,
>
> isDeclaration() now belongs to the GlobalValue class. Since Function is a
> subclass of GlobalValue, you can use this function as usual.
>
> Regards,
> Victor.
>
> 2015-03-11 15:18 GMT-03:00 Hui Zhang <wayne.huizhang at gmail.com>:
>
>> Hello,
>>
>> I found a function call Function::isDeclaration() in llvm 2.5 (I know
>> that's ancient...), which is useful to me, but I can't find it in the later
>> version 3.3, nor the latest 3.7.....Therefore, is there an alternative way
>> to check whether the function is just a declaration or a definition ?
>>
>>
>> PS:  I read the source code of llvm 2.5, and found isDeclaration is
>> simply to check if the private member "basicblocks" in a function is empty,
>> but since it's private, I can't call it outside the class...
>>
>> Thanks
>>
>> --
>> Best regards
>>
>>
>> Hui Zhang
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>>
>


-- 
Best regards


Hui Zhang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150311/d1516ded/attachment.html>


More information about the llvm-dev mailing list