search for: _find_all_call_sites_of_a_function

Displaying 9 results from an estimated 9 matches for "_find_all_call_sites_of_a_function".

2009 Sep 10
0
[LLVMdev] Finding call points to a function
...The only way I can think > of is to iterate over the BasicBlocks of each Function, look for all the > Call Instructions and check if the called function is foo. I was > wondering if there is any other better way to do this. Iterate over @foo's use list. http://wiki.llvm.org/HowTo:_Find_all_call_sites_of_a_function > 2. Is it possible to distinguish a class method from a non class method > while analyzing the emitted LLVM code for a C++ program? Because, I need > to interpret the calls made to foo differently in a class method and in > a non class method. No. Methods turn into functions that...
2011 Jan 17
5
[LLVMdev] How to get the name and argument of a function
Hi everyone: The code I am analyzing is : int main() { int i = 0; printf("hello world!"); printf( "%d" , i ); } I want to get each place where printf is called, and the argument used during that call. so I write llvm pass code like: void Myfunction( Function & F){ for( Function::iterator b = F.begin() , be = F.end() ;
2011 Jan 18
0
[LLVMdev] How to get the name and argument of a function
...ument > //used here > } > } > > } > } > > > How could I get the function name and the arguments when I know an > Instruction is a function call? There's a worked example at http://wiki.llvm.org/HowTo:_Find_all_call_sites_of_a_function . With the CallInst/InvokeInst you can query getArgOperand() to get the arguments or getCallee() which return a Function -- or it might not. If the call is an indirect call (ie., function pointer) then you don't know what it's calling. Ignoring indirect calls, you can call getName() on...
2009 Aug 28
0
[LLVMdev] A create-distinct-item function with no (other) side effects
...> 2. Doesn't need to be called at all if its return value from that call > isn't used, and > 3. Doesn't even need to be declared if its return value is *never* used. Thus far these still need a custom pass. It shouldn't be too hard though. See http://wiki.llvm.org/HowTo:_Find_all_call_sites_of_a_function You're the second user I know of to ask for this. We should probably come up with a general solution of some sort. Nick > If I happen to know about CreateDistinctItem at build time, I can > write a custom pass, of course, but I was wondering if there was an > easier way to get the...
2009 Sep 10
3
[LLVMdev] Finding call points to a function
Hi, I am writing an LLVM Pass and I would like to know how would I do the following: 1. I have a function foo, and I need to get all the call points calling this function in each Function of the Module. The only way I can think of is to iterate over the BasicBlocks of each Function, look for all the Call Instructions and check if the called function is foo. I was wondering if there is any other
2009 Aug 29
4
[LLVMdev] A create-distinct-item function with no (other) side effects
...need to be called at all if its return value from that call >> isn't used, and >> 3. Doesn't even need to be declared if its return value is *never* used. > > Thus far these still need a custom pass. It shouldn't be too hard though. > See http://wiki.llvm.org/HowTo:_Find_all_call_sites_of_a_function > > You're the second user I know of to ask for this. We should probably come up > with a general solution of some sort. Conceptually, it's the same as "readonly" except that the requirement that it return the same value each time is dropped. It would also help optimize...
2009 Aug 28
2
[LLVMdev] A create-distinct-item function with no (other) side effects
Suppose I have some LLVM assembly like this: declare i8* @CreateDistinctItem() nounwind declare void @dumpBoolean(i1 %val) define i32 @main() {  %var1 = call i8* CreateDistinctItem()  %var2 = call i8* CreateDistinctItem()  %isEqual = icmp eq i8* %val1, %val2  call void @dumpBoolean(i1 %isEqual)  ret i32 0 } So far so good.  But if I take out the "call @dumpBoolean", the optimizer
2009 Aug 29
0
[LLVMdev] A create-distinct-item function with no (other) side effects
...called at all if its return value from that call >>> isn't used, and >>> 3. Doesn't even need to be declared if its return value is *never* used. >> Thus far these still need a custom pass. It shouldn't be too hard though. >> See http://wiki.llvm.org/HowTo:_Find_all_call_sites_of_a_function >> >> You're the second user I know of to ask for this. We should probably come up >> with a general solution of some sort. > > Conceptually, it's the same as "readonly" except that the requirement > that it return the same value each time is dropped....
2011 Jan 19
0
[LLVMdev] How to get the name and argument of a function
...} >>>> } >>>> >>>> >>>> How could I get the function name and the arguments when I know >>>> an >>>> Instruction is a function call? >>> There's a worked example at >>> http://wiki.llvm.org/HowTo:_Find_all_call_sites_of_a_function . >>> >>> With the CallInst/InvokeInst you can query getArgOperand() to get the >>> arguments or getCallee() which return a Function -- or it might not. If >>> the call is an indirect call (ie., function pointer) then you don't >>> know >>>...