Hi, <br> I am trying to extract the name of the variables passed as an Argument to a Function. I am using a runOnFunction Pass. <br>For example   in the following IR respresentation, <br><br>define void @foo(i32 %limit) {<br>
entry:<br>--<br>--<br>}<br><br>I should be able to walk the IR and get '%limit' as the external variable passed to the function.<br><br>Another question, Is it possible to create a basic symbol table ( internal variables in a function, global variables outside of a fucntion ) only from the entry: basic block.
<br>According to my observation, it seems that the temporary variables created for different basic block are independent from each other, for example in the following IR the temp variables used in the basic block bb: i.e. %tmp, %tmp1, %tmp2 are only dependent on the variables defined in the entry: basic block, and same holds for basic block bb5: 
i.e. variables %tmp6, %tmp7, %tmp8 etc are only dependent on the variables in the entry block (%limit_addr, %i.. etc) and the temp variables defined in the same basic block.<br><br>Is this true ?, as far as i have seen, by generating the bitcode for various test codes, and it holds true for all. So, now the proposition is, that one can create the symbol table of the internal variables and the variables passed to the function as an agrument by only using the information in entry block and argument list information.
<br><br>The IR....<br>.................<br>define void @foo(i32 %limit) {<br>entry:<br>    %limit_addr = alloca i32        ; <i32*> [#uses=2]<br>    %i = alloca i32, align 4        ; <i32*> [#uses=6]<br>    %"alloca point" = bitcast i32 0 to i32        ; <i32> [#uses=0]
<br>    store i32 %limit, i32* %limit_addr<br>    store i32 0, i32* %i, align 4<br>    store i32 0, i32* %i, align 4<br>    br label %bb5<br><br>bb:        ; preds = %bb5<br>    %tmp = getelementptr [24 x i8]* @.str, i32 0, i32 0        ; <i8*> [#uses=1]
<br>    %tmp1 = load i32* %i, align 4        ; <i32> [#uses=1]<br>    %tmp2 = call i32 (i8* noalias , ...)* @printf( i8* %tmp noalias , i32 %tmp1 )        ; <i32> [#uses=0]<br>    %tmp3 = load i32* %i, align 4        ; <i32> [#uses=1]
<br>    %tmp4 = add i32 %tmp3, 1        ; <i32> [#uses=1]<br>    store i32 %tmp4, i32* %i, align 4<br>    br label %bb5<br><br>bb5:        ; preds = %bb, %entry<br>    %tmp6 = load i32* @glob_var, align 4        ; <i32> [#uses=1]
<br>    %tmp7 = load i32* %limit_addr, align 4        ; <i32> [#uses=1]<br>    %tmp8 = add i32 %tmp7, %tmp6        ; <i32> [#uses=1]<br>    %tmp9 = load i32* %i, align 4        ; <i32> [#uses=1]<br>    %tmp10 = icmp sge i32 %tmp8, %tmp9        ; <i1> [#uses=1]
<br>    %tmp1011 = zext i1 %tmp10 to i8        ; <i8> [#uses=1]<br>    %toBool = icmp ne i8 %tmp1011, 0        ; <i1> [#uses=1]<br>    br i1 %toBool, label %bb, label %bb12<br><br>bb12:        ; preds = %bb5<br>
    br label %return<br><br>return:        ; preds = %bb12<br>    ret void<br>}<br>.........................<br><br><br>Thanks and Regards<br>Prabhat<br><br>