PeiLIU via llvm-dev
2016-May-12 13:09 UTC
[llvm-dev] How to determine it is a function pointer or not?
The .ll file snippet like this: %call162 = call i32 @pthread_create(i64* %arrayidx159, %union.pthread_attr_t* null, i8* (i8*)* bitcast (i32 (i8*)* @bs_thread to i8* (i8*)*), i8* %121) #9, !dbg !264 The function is pthread_create, the 3rd argument is a function that is bs_thread(the function name), but how to determine it is a function pointer or not? The 3rd argument's type only is a PointerType, then I don't know how to determine it is a function pointer or not? Thank you! I am very appreciate your help. :) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160512/3b032dfb/attachment.html>
Tim Northover via llvm-dev
2016-May-12 16:39 UTC
[llvm-dev] How to determine it is a function pointer or not?
On 12 May 2016 at 06:09, PeiLIU via llvm-dev <llvm-dev at lists.llvm.org> wrote:> The 3rd argument's type only is a PointerType, then I don't know how to > determine it is a function pointer or not?PointerType inherits from SequentialType so you'd use Ty->getElementType()->isFunctionType(). Cheers. Tim.