[LLVMdev] bitcast of function

Le Anh Quang anhquangbk at googlemail.com
Tue Aug 19 13:51:59 PDT 2008


Hi,
 I have tried to use LLVM to compile a small C project.  All thing seem ok,
but I found some bistcast and call instructions that are weird.
First,  I have a simple function :  void type and no parameter (content of
the function is not relevant here, just copy&paste)
 
void openBMPJPG() {     
      bmpheader=&_bmpheader;
      jpegoutput=&_jpegoutput;     
      getbmpheader(bmpheader);
      jpegheadersize = writejpegheader(bmpheader, &_jpegheader);       
      _jpegoutput.header = _jpegheader;
}
 
The function is declared in a header file. After linking all the files
together,  the callee function is called in the way bellow:
 
call void (...)* bitcast (void ()* @openBMPJPG to void (...)*)( ) nounwind
 
The function has been casted to a constant before (a CE_GEP) and then this
CE_GEP has been called, not the global function.
I don't understand, why and how it has been casted. Can anybody explain it ?

Thank for any advice
Quang
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080819/0d0efa23/attachment.html>


More information about the llvm-dev mailing list