search for: xiedingbao

Displaying 3 results from an estimated 3 matches for "xiedingbao".

2015 Jan 27
2
[LLVMdev] Create a call to function malloc using LLVM API
Hi, I encountered an issue when attempting to create a call to function malloc. I just want to do a simple thing, suppose there is a variable p, if p is a pointer then allocate memory to p. Source code: int *p; p = (int *) malloc(sizeof(*p)); Try to generate LLVM IR for it: Type *tp = p->getType(); AllocaInst* arg_alloc = builder.CreateAlloca(tp);//builder is IRBuilder
2014 Nov 05
3
[LLVMdev] How to lower the intrinsic function 'llvm.objectsize'?
Thanks for your reply. I'm attempting to expand KLEE to support this intrinsic function. That's why I need to handle this myself. According to the reply, the correct implementation should first find the definition of the object and then determine the size of the object. BTW, can I just refer to the implementation in InstCombineCalls.cpp. On Wed, Nov 5, 2014 at 2:24 PM, Matt Arsenault
2014 Nov 05
3
[LLVMdev] How to lower the intrinsic function 'llvm.objectsize'?
The documentation of LLVM says that "The llvm.objectsize intrinsic is lowered to a constant representing the size of the object concerned". I'm attempting to lower this intrinsic function to a constant in a pass. Below is the code snippet that I wrote: for (BasicBlock::iterator i = b.begin(), ie = b.end(); (i != ie) && (block_split == false);) { IntrinsicInst *ii =