similar to: [LLVMdev] FYI: AllocaInst & MallocInst ctor change

Displaying 20 results from an estimated 8000 matches similar to: "[LLVMdev] FYI: AllocaInst & MallocInst ctor change"

2010 May 28
0
[LLVMdev] Retrieving Underlying Type from AllocaInst
You should be able to use the second alternative that Nick proposed: cast<PointerType*>(pointer_value->getType())->getElementType() Reid On Fri, May 28, 2010 at 9:37 AM, Curtis Faith <curtis at curtisfaith.com> wrote: > Thanks Nick, > Unfortunately, that is indeed what I asked for but not what I really am > looking for. > My naive approach is to store symbol table
2008 Jan 14
1
[LLVMdev] Opaque type
Hello, I'm trying to translate part of Java code in LLVM code. I have some problems with the "opaque type", I think because I did not understand how to use. So, the java code is: int[] ai; .... ai = new int[1]; I am using LLVM API in this way: //I create a pointer of Opaque type, because I don't know yet the array size! OpaqueType* ot = OpaqueType::get(); AllocaInst*
2010 May 28
0
[LLVMdev] Retrieving Underlying Type from AllocaInst
Curtis Faith wrote: > Is there a recommended way to retrieve the original type from an > AllocaInst object? > > For example, I am creating alloca instructions using the IRBuilder > interface like: > > alloca = builder.CreateAlloca( Type::getDoubleTy( context ), 0, > variableName.c_str() ); > > and I place the alloca into a symbol table. > > Later when I am
2010 May 28
2
[LLVMdev] Retrieving Underlying Type from AllocaInst
Thanks Nick, Unfortunately, that is indeed what I asked for but not what I really am looking for. My naive approach is to store symbol table entries as Value* objects so I can allocate global variables and alloca variables and place them into the symbol table and the rest of the code didn't need to know which kind they were, in general. Loads and Stores of these types (as well as other
2010 May 28
2
[LLVMdev] Retrieving Underlying Type from AllocaInst
Is there a recommended way to retrieve the original type from an AllocaInst object? For example, I am creating alloca instructions using the IRBuilder interface like: alloca = builder.CreateAlloca( Type::getDoubleTy( context ), 0, variableName.c_str() ); and I place the alloca into a symbol table. Later when I am generating instructions for an assignment operation, I want to check the type of
2014 Aug 04
3
[LLVMdev] LLVM AllocaInst and StoreInst
Hi, I am trying to write a simple interpreter. I am trying to generate LLVM IR for assignment operation. The code for the generation part looks like this llvm::Value* codeGenSymTab(llvm::LLVMContext& context) { > printf("\n CodeGen SymTab \n"); > Value *num = ConstantInt::get(Type::getInt64Ty(context), aTable.value, > true); > Value *alloc = new
2016 Jun 28
0
mutateType on AllocaInst problem
Hi, I'm trying to replace pointer typed alloca instructions to allocate a vector of pointers. The idea is to change from [1] to [2]: [1]: %0 = alloca i<N>* [2]: %0 = alloca <3 x i8*> I did it this way: - first, create and insert [2] (for debug purpose, not necessary to insert) - mutate type so that replaceAllUsesWith can be called in a correctly typed way - replace all
2012 Sep 21
0
[LLVMdev] How To Get The Name of the type the popinter is pointing to
i am using llvm , i did this if ( AllocaInst *allocInst = dyn_cast<AllocaInst>(&*bbit)){ PointerType *p = allocInst->getType(); if ( p->getElementType()->isPointerTy()){ StringRef name = allocInst->getName();
2005 Jan 31
1
[LLVMdev] Question about Global Variable
Hi, Sorry for bothering you guys again. I got problem when I am trying to recover the Global Variable Initial value. What I did is like the following ConstantArray *Cstr = dyn_cast<ConstantArray>(gI->getInitializer()); // the above instruction enable me to get the content of initial string of global variable, like char a[10] ="test global"; And then I make some change for
2008 Jun 28
0
[LLVMdev] need to store the address of a variable
Paul Arndt wrote: > Hello everybody, > > my problem is, that I want to get an array of pointers to all local variables > in a function. This array will be used for transfering these Variables to > another execution engine. > > I've code which generates this array, and a pointer to the target field of the > array. > > name = variables.fname +
2009 Oct 20
0
[LLVMdev] Dereference PointerType?
2009/10/20 Daniel Waterworth <da.waterworth at googlemail.com> > Hello, > > I'm wondering if it's possible to dereference a PointerType. I have an > AllocaInst and although I can find the number of elements allocated, (using > Instruction::getOperand(0)), I can't find a way to get the size of each > element. What I'd like to do is: > > AllocaInst
2013 Sep 01
0
[LLVMdev] Distinguishing Pointer Variable and Ordinary Variable
Hi, On 1 September 2013 15:47, Abhinash Jain <omnia at mailinator.com> wrote: > Sorry I have actually edited the post. This is primarily an e-mail list; the vast majority of us won't see any edits (on some web mirror?). > I did check its type by using > isa<PointerType>(cast<AllocaInst>(instr->getOperand(1))->getAllocatedType()) > but it is only detecting
2008 Jun 28
2
[LLVMdev] need to store the address of a variable
Hello everybody, my problem is, that I want to get an array of pointers to all local variables in a function. This array will be used for transfering these Variables to another execution engine. I've code which generates this array, and a pointer to the target field of the array. name = variables.fname + "_pointerArray"; Instruction* pointerArray = new
2002 Sep 15
0
[LLVMdev] MP1: Constructor for AllocaInst
> AllocaInst. I did a recent "cvsupdate", but the code still hadn't > changed. Has this code already been updated ? If not, I request that it > be updated as soon as possible, as it simplifies our implementation of > MP1 (we need to insert the alloca's at the beginning of the function). The plan is to update the CSIL CVS tree soon. When that happens you should get
2008 Nov 08
0
[LLVMdev] non-pointer gcroot
On Nov 7, 2008, at 15:29, Scott Graham wrote: > I'm getting an assert in LowerIntrinsics::InsertRootInitializers > because I'm gcroot'ing an alloca to a non-pointer. > > I was hoping to modify InsertRootInitializers to memset the > structure in the case that it's not a pointer, but I'm not sure how > to. Can anyone suggest what should go at "todo;
2009 Mar 20
0
[LLVMdev] GC interface suggestions
Hello, I have a few suggestions for the GC interface. First, initialization of roots fails if the root isn't just a pointer. Some implementations require more data than just the pointer for handling references to the interior of an aggregate. On my end it just required changing ConstantPointerNull::get() to Constant::GetNullValue() to support fat pointers. The roots that were being
2005 Mar 16
2
[LLVMdev] Dynamic Creation of a simple program
Hi Misha, Thanks for your answer I was doing this: ======================== BasicBlock *BBlock = new BasicBlock("entry", MyFunc); ... Value *Zero = ConstantSInt::get(Type::IntTy, 0); Value *UZero = ConstantUInt::get(Type::UIntTy, 0); MallocInst* mi = new MallocInst( STyStru ); mi->setName("tmp.0"); BBlock->getInstList().push_back( mi );
2005 Jan 27
1
[LLVMdev] Question about inserting IR code
Hi, From the file HowToUseJIT.cpp, I learned how to insert some calcuation IR code like Add/Sub/Mul etc by using Instruction *Add = BinaryOperator::createAdd(One, ArgX, "addresult", BB); By following this way, it works well when I insert some IR code whose operand is integer type like IntTy, however, when I tried to insert similar thing whose operands are float point, I got the
2008 Nov 07
2
[LLVMdev] non-pointer gcroot
Hi I'm getting an assert in LowerIntrinsics::InsertRootInitializers because I'm gcroot'ing an alloca to a non-pointer. I was hoping to modify InsertRootInitializers to memset the structure in the case that it's not a pointer, but I'm not sure how to. Can anyone suggest what should go at "todo; something here"? ... for (AllocaInst **I = Roots, **E = Roots +
2011 Oct 08
0
[LLVMdev] Initializing GC roots
On Oct 6, 2011, at 17:19, Yiannis Tsiouris wrote: > Hello all, > > I set: InitRoots = true; in my gc plugin as i want the roots to be > initialized to the "null" value. > Is there a way to define which value should be the initial one? For > example, i would like to initialize my roots to -5 (tagged, null value > for the GC in my runtime system) instead of 0. >