search for: gvar_struct_foo

Displaying 4 results from an estimated 4 matches for "gvar_struct_foo".

2015 Mar 16
4
[LLVMdev] size of const_ptr for array index
...structure, the c++API code looks like: std::vector<Constant*> const_ptr_183_indices; const_ptr_183_indices.push_back(const_int32_172); const_ptr_183_indices.push_back(const_int32_184); const_ptr_183_indices.push_back(const_int64_175); Constant* const_ptr_183 = ConstantExpr::getGetElementPtr(gvar_struct_foo, const_ptr_183_indices); the struct could be struct stest { double age; double darray[3]; } The indices for accessing 'age' would be 0 (32bit) 0 (32bit). For an element of the darray, one however needs 0 (32bit) 1 (32bit) 0-2 (64bit) The same for indices of vectors. Th...
2015 Mar 07
2
[LLVMdev] cannot understand global c++API code
...t32_99 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); std::vector<Constant*> const_ptr_103_indices; const_ptr_103_indices.push_back(const_int32_98); const_ptr_103_indices.push_back(const_int32_99); Constant* const_ptr_103 = ConstantExpr::getGetElementPtr(gvar_struct_foo, const_ptr_103_indices); //the store inst is in principle clear StoreInst* void_119 = new StoreInst(const_float_102, const_ptr_103, false, label_entry_113); void_119->setAlignment(4); --------------------------------------------- comment: I don't get whats the meaning of the two const_in...
2015 Mar 17
2
[LLVMdev] casting Constant * to value *?
Hi all, extracting datafields of globals, the API code ends up in a Constant * Constant* const_ptr_103 = ConstantExpr::getGetElementPtr(gvar_struct_foo, const_ptr_103_indices); it can be used to initialize e.g. a new instruction like: StoreInst* void_119 = new StoreInst(const_float_102, const_ptr_103, false, label_entry_113); But how about replacing the operand of an already existing instruction using a Constant *? Instruction->setOpera...
2015 Mar 18
5
[LLVMdev] casting Constant * to value *?
...possibly tomorrow. Thanks Alex John Criswell wrote: > On 3/17/15 8:40 PM, Alexander Poddey wrote: >> Hi all, >> >> extracting datafields of globals, the API code ends up in a Constant * >> >> >> Constant* const_ptr_103 = ConstantExpr::getGetElementPtr(gvar_struct_foo, >> const_ptr_103_indices); >> >> it can be used to initialize e.g. a new instruction like: >> >> StoreInst* void_119 = new StoreInst(const_float_102, const_ptr_103, >> false, label_entry_113); >> >> >> But how about replacing the operand of an...