[LLVMdev] arguments to standard library functions

Alkis Evlogimenos alkis at cs.uiuc.edu
Thu Apr 7 03:15:47 PDT 2005


On Thursday 07 April 2005 04:45, Abhijit Ray wrote:
> looks like my invocation to getGetElementPtr() is not what it should be
> . But I am not sure what it should be :(

The reason the above doesn't work is that the ConstantArray is not a pointer 
type. You cannot use a non pointer type in a getelementptr instruction.

Instead you should create a GlobalVariable initialized with the ConstantArray 
(the name) and pass a ConstantExpr::getPtrPtrFromArrayPtr(<the global 
variable>) to the function call as the name of the function.

I hope this helps,

-- 

Alkis




More information about the llvm-dev mailing list