search for: getint16ty

Displaying 11 results from an estimated 11 matches for "getint16ty".

2011 Jan 24
3
[LLVMdev] How to change the type of an Instruction?
...all characteristics of the old Instruction and create a new one only with a different type. I am trying create a new Instruction thus: %3 = add nsw i32 %1, %2 ; <i16> [#uses=2] //Old Instruction Value* Op0 = I->getOperand(0); Value* Op1 = I->getOperand(1); Value* V0 = new Value(Type::getInt16Ty(Op0->getContext()), Op0->getValueID()); Value* V1 = new Value(Type::getInt16Ty(Op1->getContext()), Op1->getValueID()); Instruction* newInst = BinaryOperator::CreateNSWAdd(V0, V1, "test"); errs() << "NewInst:\n" << *newInst << "\n"; But I...
2011 Jan 24
0
[LLVMdev] How to change the type of an Instruction?
...at to unsigned int, or bitcast (only legal sometimes)? I am trying > create a new Instruction thus: > > %3 = add nsw i32 %1, %2 ; <i16> [#uses=2] //Old Instruction > > Value* Op0 = I->getOperand(0); > Value* Op1 = I->getOperand(1); > Value* V0 = new Value(Type::getInt16Ty(Op0->getContext()), > Op0->getValueID()); Hunh, Value's constructor is protected. In any event, Value is pure base. Constructing one this way will never get you what you want. If the ValueID indicates an Instruction, go through Instruction to create one. > Value* V1 = new Value...
2011 Jan 24
3
[LLVMdev] How to change the type of an Instruction?
...uction. > > > I am trying > >> create a new Instruction thus: >> >> %3 = add nsw i32 %1, %2 ; <i16> [#uses=2] //Old Instruction >> >> Value* Op0 = I->getOperand(0); >> Value* Op1 = I->getOperand(1); >> Value* V0 = new Value(Type::getInt16Ty(Op0->getContext()), >> Op0->getValueID()); >> > > Hunh, Value's constructor is protected. > > In any event, Value is pure base. Constructing one this way will never get > you what you want. If the ValueID indicates an Instruction, go through > Instruction to...
2011 Jan 24
0
[LLVMdev] How to change the type of an Instruction?
...gt; > I am trying > > create a new Instruction thus: > > %3 = add nsw i32 %1, %2 ; <i16> [#uses=2] //Old Instruction > > Value* Op0 = I->getOperand(0); > Value* Op1 = I->getOperand(1); > Value* V0 = new Value(Type::getInt16Ty(Op0->getContext()), > Op0->getValueID()); > > > Hunh, Value's constructor is protected. > > In any event, Value is pure base. Constructing one this way will > never get you what you want. If the ValueID indicates an > Instruction, go through...
2011 Jan 28
1
[LLVMdev] How to change the type of an Instruction?
...rying >> >>> create a new Instruction thus: >>> >>> %3 = add nsw i32 %1, %2 ; <i16> [#uses=2] //Old Instruction >>> >>> Value* Op0 = I->getOperand(0); >>> Value* Op1 = I->getOperand(1); >>> Value* V0 = new Value(Type::getInt16Ty(Op0->getContext()), >>> Op0->getValueID()); >>> >> >> Hunh, Value's constructor is protected. >> >> In any event, Value is pure base. Constructing one this way will never get >> you what you want. If the ValueID indicates an Instruction, go...
2013 Jan 11
2
[LLVMdev] Make a comparation with IR builder
...bol); if (typeid(*currentType) == typeid(get_datatype_info_c::bool_type_name)) { std::cout << "Creating integer: " << value << std::endl; return (void *)ConstantInt::get(Type::getInt1Ty(getGlobalContext()), value, false); } return (void *)ConstantInt::get(Type::getInt16Ty(getGlobalContext()), value, false); } void *visit(symbolic_variable_c *symbol) { std::string varName; AllocaInst *alloc; varName = get_var_name_c::get_name(symbol->var_name)->value; alloc = locals[varName]; return (void *)alloc; } void *visit(equ_expression_c *symbol) { Va...
2011 Jan 21
0
[LLVMdev] How to change the type of an Instruction?
On 21 January 2011 12:56, Douglas do Couto Teixeira < douglasdocouto at gmail.com> wrote: > Hello guys, > > I wonder how I can change the type of an integer variable. For instance, > given the instruction "%3 = add i32 %1, %2" I would like to alter the > instruction to "%3 = add i16 %1, %2". Is there any way to do this? > No. Instead you create a new
2011 Jan 21
2
[LLVMdev] How to change the type of an Instruction?
Hello guys, I wonder how I can change the type of an integer variable. For instance, given the instruction "%3 = add i32 %1, %2" I would like to alter the instruction to "%3 = add i16 %1, %2". Is there any way to do this? Best wishes, Douglas -------------- next part -------------- An HTML attachment was scrubbed... URL:
2013 Jan 11
2
[LLVMdev] Make a comparation with IR builder
...> std::cout << "Creating integer: " << value << std::endl; > return (void > *)ConstantInt::get(Type::getInt1Ty(getGlobalContext()), value, false); > } > return (void > *)ConstantInt::get(Type::getInt16Ty(getGlobalContext()), value, > false); > } > > void *visit(symbolic_variable_c *symbol) { > std::string varName; > AllocaInst *alloc; > > varName = get_var_name_c::get_name(symbol->var_name)->value; > alloc = locals[varName]; >...
2013 Jan 11
0
[LLVMdev] Make a comparation with IR builder
...type_name)) > { > std::cout << "Creating integer: " << value << std::endl; > return (void *)ConstantInt::get(Type::**getInt1Ty(getGlobalContext()), > value, false); > } > return (void *)ConstantInt::get(Type::** > getInt16Ty(getGlobalContext())**, value, false); > } > > void *visit(symbolic_variable_c *symbol) { > std::string varName; > AllocaInst *alloc; > > varName = get_var_name_c::get_name(**symbol->var_name)->value; > alloc = locals[varName]; > > return (void *)alloc;...
2013 Jan 11
0
[LLVMdev] Make a comparation with IR builder
...>> std::cout << "Creating integer: " << value << std::endl; >> return (void >> *)ConstantInt::get(Type::getInt1Ty(getGlobalContext()), value, false); >> } >> return (void >> *)ConstantInt::get(Type::getInt16Ty(getGlobalContext()), value, false); >> } >> >> void *visit(symbolic_variable_c *symbol) { >> std::string varName; >> AllocaInst *alloc; >> >> varName = get_var_name_c::get_name(symbol->var_name)->value; >> alloc = locals[varName]; >&g...