[LLVMdev] Function aliases in CallGraph

Stephen Schiffli sschiffli at gmail.com
Thu Oct 11 15:56:03 PDT 2012


Hello, I have a simple program using aliases to functions, and it seems
that the CallGraph doesn't follow these aliases.  Here is the example:

@alias = alias void ()* @realfunc

define void @realfunc() {
entry:
  ret void
}

define i32 @main() {
entry:
  call void @alias()
  ret i32 0
}

******* Output of the CallGraph *******

Call graph node <<null function>><<0xbe64c0>>  #uses=0
  CS<0x0> calls function 'realfunc'
  CS<0x0> calls function 'realfunc'
  CS<0x0> calls function 'main'

Call graph node for function: 'realfunc'<<0xbe6880>>  #uses=2

Call graph node for function: 'main'<<0xbe6d80>>  #uses=1
  CS<0xbdfe7c> calls external node

Is there a reason the CallGraph doesn't try to see through aliases?  I
would like this capability, but was wondering if it is generally safe to do.

Thanks,
-Stephen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121011/b0b63740/attachment.html>


More information about the llvm-dev mailing list