Displaying 9 results from an estimated 9 matches for "store_inst".
Did you mean:
store_idt
2017 Jun 12
4
How to know the sub-class of a Value class?
As a concrete question, I understand 'Value' class is the parent of many
concrete sub-classes. Let's say I retrieve a Value* value =
store_inst->getValueOperand(). Unless I know what the sub-type is, how can
I further use this object? I tried something like this:
=================================================
Value* value = store_inst->getValueOperand()
errs() << value->getValueID; // Which ID correspo...
2017 Jun 12
2
Force casting a Value*
...<hintonda at gmail.com> wrote:
> Assuming you know it's a 64 bit value, and the function you are calling
> takes a uint64_t, try this:
>
The values from the test program are of type: i32/i32*/i32**. Can't I
interpret these as uint64_t some way?
>
> Value* args[] = {store_inst->getOperand(0)};
>
>
> On Sun, Jun 11, 2017 at 1:16 PM, Dipanjan Das via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>>
>>
>> On 11 June 2017 at 12:05, Tim Northover <t.p.northover at gmail.com> wrote:
>>
>>> On 11 June 2017 at 11...
2017 Jun 11
2
Force casting a Value*
I am trying to cast a Value* irrespective of its underlying subclass to
uint64 and pass it on to a method as an argument.
if (StoreInst *store_inst = dyn_cast<StoreInst>(&I)) {
Value* vo = store_inst->getValueOperand();
uint64 value = /* cast vo to unsigned int 64 bit */
func(value);
}
How can I force cast 'vo' to unsigned int?
--
Thanks &...
2017 Jun 11
2
Force casting a Value*
...store instruction at run-time and pass on that value as either
an unsigned int (64) or a pointer (char*) to an external function. The call
to that function is inserted using IRBuilder.CreateCall().
Consider the code snippet below.
==================================================
if (StoreInst *store_inst = dyn_cast<StoreInst>(&I)) {
Value* vo = store_inst->getValueOperand();
uint64 var_value = /* cast vo to unsigned int 64 bit */
// Pass on this value to external function
IRBuilder<> builder(&I);...
2017 Jun 11
2
Force casting a Value*
...> On Sun, Jun 11, 2017 at 3:06 AM Dipanjan Das via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>>
>> I am trying to cast a Value* irrespective of its underlying subclass to
>> uint64 and pass it on to a method as an argument.
>>
>> if (StoreInst *store_inst = dyn_cast<StoreInst>(&I)) {
>> Value* vo = store_inst->getValueOperand();
>> uint64 value = /* cast vo to unsigned int 64 bit */
>> func(value);
>> }
>>
>> How can I force...
2017 Apr 28
2
How to get the address of a global variable in LLVM?
...m writing an LLVM pass which will instrument the program such that `x`
is passed to an instrumentation function `func(int addr)` at run-time. I
can insert a call to `func` using `IRBuilder` successfully. What I am not
being able to do is to insert instrumentation to collect `x`.
if (StoreInst *store_inst = dyn_cast<StoreInst>(&I)) {
Value* po = store_inst->getPointerOperand();
if(isa<GlobalVariable>(po)) {
errs() << "store [pointer]: " << *po << '\n';...
2017 Jun 11
2
Force casting a Value*
...lvm-dev <
>>> llvm-dev at lists.llvm.org> wrote:
>>>
>>>>
>>>> I am trying to cast a Value* irrespective of its underlying subclass
>>>> to uint64 and pass it on to a method as an argument.
>>>>
>>>> if (StoreInst *store_inst = dyn_cast<StoreInst>(&I)) {
>>>> Value* vo = store_inst->getValueOperand();
>>>> uint64 value = /* cast vo to unsigned int 64 bit */
>>>> func(value);
>>>> }
&...
2017 Jun 12
4
How to know the sub-class of a Value class?
...;
> On Mon, Jun 12, 2017 at 3:24 PM, Dipanjan Das via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>>
>> As a concrete question, I understand 'Value' class is the parent of many
>> concrete sub-classes. Let's say I retrieve a Value* value =
>> store_inst->getValueOperand(). Unless I know what the sub-type is, how can
>> I further use this object? I tried something like this:
>>
>> =================================================
>>
>> Value* value = store_inst->getValueOperand()
>> errs()...
2017 Jun 12
2
How to know the sub-class of a Value class?
...> On Sun, Jun 11, 2017 at 10:54 PM, Dipanjan Das via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>>
>> As a concrete question, I understand 'Value' class is the parent of many
>> concrete sub-classes. Let's say I retrieve a Value* value =
>> store_inst->getValueOperand(). Unless I know what the sub-type is, how can
>> I further use this object? I tried something like this:
>>
>> =================================================
>>
>> Value* value = store_inst->getValueOperand()
>> errs()...