[LLVMdev] For a pointer to pointer ?How to fast get the pointee pointer?

Shen Liu shl413 at lehigh.edu
Fri Jul 17 07:57:09 PDT 2015


Hi all, i am coding to analyze an IR with multi-level pointers, and i am
eager to know whether there exists a way to find the pointee pointer
directly, if only given an upper level pointer.

For example, in the following demo,

C code:

  int i = 10;
  int *p = &i;
  int **pp;
  *pp = &p;

IR code:

 %i = alloca i32, align 4
  %p = alloca i32*, align 8
  %pp = alloca i32**, align 8
  store i32 10, i32* %i, align 4
  store i32* %i, i32** %p, align 8
  %0 = bitcast i32** %p to i32*



If I know the value of *pp *already, Is there a fast method for me to find
pointer *p *directly? And if not must I consider AA case here?

Thanks!


Best Regards,

Shen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150717/81e3e5c5/attachment.html>


More information about the llvm-dev mailing list