search for: const_float_102

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

2015 Mar 07
2
[LLVMdev] cannot understand global c++API code
...the result. Perhaps someone could explain it to me. c code --------------------------------- struct stest { int age; float weight; } foo={44,67.2}; int main() { foo.weight=68.2; ... ---------------------------------------- API code // this is clear ConstantFP* const_float_102 = ConstantFP::get(mod->getContext(), APFloat(6.820000e+01f)); ConstantInt* const_int32_98 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10)); ConstantInt* const_int32_99 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10)); std::...
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->setOperand(1,__needs_a_value*_here__); Thx Alex
2015 Mar 18
5
[LLVMdev] casting Constant * to value *?
...he 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->setOperand(1,__needs_a_value*_here__); > > If you look at the inheritance tree, y...