search for: constantintval

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

2009 Sep 28
3
[LLVMdev] Printing Function Arguments
...turns 'i32', which is >> good. >> >> But I also need to get the value '8'. >> >> I can get it via v->getValueID(), but in the documentation it says not to >> use that function. > > Heh. No, getValueID() returns '8' as the "ConstantIntVal" enum, not the > actual argument number. > >> Any other ideas what is the proper way to access the value '8' ? > > It's a ConstantInt, so cast it and retrieve the APInt then pull out the > number. Here: > > unsigned val; > if (ConstantInt *C...
2009 Sep 28
0
[LLVMdev] Printing Function Arguments
...he type via v->getType() and that returns 'i32', which is good. > > But I also need to get the value '8'. > > I can get it via v->getValueID(), but in the documentation it says not to > use that function. Heh. No, getValueID() returns '8' as the "ConstantIntVal" enum, not the actual argument number. > Any other ideas what is the proper way to access the value '8' ? It's a ConstantInt, so cast it and retrieve the APInt then pull out the number. Here: unsigned val; if (ConstantInt *CI = dyn_cast<ConstantInt>(v)) { v...
2009 Sep 28
2
[LLVMdev] Printing Function Arguments
I am processing the LLVM instructions and right now I am at the 'call' instruction. For now I just want to print the argument type. For example in the following: %0 = tail call i32 (...)* @__FFF (i32 8) nounwind; <i32> [#uses=1] I need to get access to 'i32' and '8' separately. I do: CallInst *CI = dyn_cast<CallInst>(I); Value *v = CI->getOperand(1)
2009 Sep 28
0
[LLVMdev] Printing Function Arguments
...od. >>> >>> But I also need to get the value '8'. >>> >>> I can get it via v->getValueID(), but in the documentation it says not >>> to >>> use that function. >> >> Heh. No, getValueID() returns '8' as the "ConstantIntVal" enum, not the >> actual argument number. >> >>> Any other ideas what is the proper way to access the value '8' ? >> >> It's a ConstantInt, so cast it and retrieve the APInt then pull out the >> number. Here: >> >> unsigned...