[LLVMdev] matching function call arguments

Reid Kleckner reid.kleckner at gmail.com
Mon Mar 7 10:04:39 PST 2011


Could you be more precise about what you mean by "identical"?  Would
entry(2) and entry(1+1) be considered equivalent?

If the same Value* is passed to entry and exit, then pointer equality
(==) will detect that.

Reid

On Mon, Mar 7, 2011 at 8:08 AM, Hari Pyla <harip at vt.edu> wrote:
> Hi,
>  I am trying to identify if two functions were called with exactly the same argument. For instance, in the below example, assuming both entry() and exit() functions take a single argument, I would like to know if arg1 in entry() is same as arg1in exit().
>
> int a;
> struct sa
> {
>  int b;
>  int c;
> };
>
> int main ()
> {
>   struct sa s;
>
>   entry (arg1);
>    ...
>   exit (arg1);
>
>   return 0;
> }
>
> In instances such as entry(a) and exit (a). I am able to determine that it is the same variable 'a' using '==' on the callinst->getOperand(1)'. However, if I pass a member variable of a structure say (s.b) to both entry and exit, I am unable to use '==' since the operands are GEP instructions. How can I compare such arguments to check if they are identical and also I was wondering as to what is best approach to determine if these arguments are exactly identical. Thanks in advance.
>
> Best,
> --Hari
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list