Displaying 2 results from an estimated 2 matches for "stack_abc".
2010 Jul 14
2
[LLVMdev] Figuring out the parameters of the Call Instruction
...6 int b;
7 };
8
9 struct my_struct abc;
10 void p_ptr ( unsigned long j)
11 {
12 printf ( "%lx \n", j );
13 }
14
15 void struct_ptr ( struct my_struct * s_ptr )
16 {
17 printf ( "%p \n", s_ptr );
18 }
19
20 int
21 main ()
22 {
23 struct my_struct stack_abc;
24 p_ptr ((unsigned long) &abc);
25 struct_ptr ( &abc );
26 p_ptr ((unsigned long) &stack_abc);
27 struct_ptr ( &stack_abc );
28 return 0;
29 }
24 p_ptr ((unsigned long) &abc);
call void @p_ptr(i64 ptrtoint (%struct.my_struct* @abc to i64))
nounwi...
2010 Jul 15
0
[LLVMdev] Figuring out the parameters of the Call Instruction
...re used, as you see in your example.
> How can I reach the ptrtoint instruction from the call
> instruction ? What fields I need to access.
It is the first argument to the call instruction CI, thus you can get it with
CI->getArgOperand(0).
> 26 p_ptr ((unsigned long)&stack_abc);
> %stack_abc1 = ptrtoint %struct.my_struct* %stack_abc to i64, !dbg
> !33 ;<i64> [#uses=1]
> call void @p_ptr(i64 %stack_abc1) nounwind, !dbg !33
>
> Q.2 stack_abc1 is a alias for the operation performed by the
> ptrtoint instruction.
> Which fields...