LLVM Discussion Forums

How to get function signature from function pointer?

I am dealing with function pointers in LowerCall and able to detect if call is an indirect call. I want to list candidate callees give the type of function pointer at call site. I am not able to find any usable info in CallBase or CLI which can dump type of function pointer.

For example, in LLVM IR if I have “call void %fptr(i32 123)” then how I print/dump type of %fptr as void(i32)*?

1 Like

Answering myself. For now, I think I should iterate over IR instruction than DAG to get all necessary info.