[llvm-dev] Value &operator=(const Value &) = delete;

Doerfert, Johannes via llvm-dev llvm-dev at lists.llvm.org
Wed Jan 29 16:13:18 PST 2020


On 01/29, Daniel Sanders via llvm-dev wrote:
> Hi Abid,
> 
> I don't work on the LLVM-IR level very often so this may be incorrect
> but I believe you're looking for either:
>     val.replaceAllUsesWith(val2)
> or:
>     instruction.getOperandUse(Index).set(val2)
> 
> The first one should change all instructions that use val2 so that
> they use val instead. The second should change one specific operand of
> an instruction to use val2 instead.

This should work. The shorter version is `setOperand(i, NewOpVal)`.


> > On Jan 29, 2020, at 12:24, Abid Malik via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> > 
> > 
> > Does it mean we can not dereference the Value variables?
> > 
> > Value *val = some operand of an instruction;
> > Value *val2=  some operand of another instruction;
> > 
> > I am trying to rewire the operand values of an instruction using:
> > 
> > *val = *val2;
> > 
> > It seems that this is not allowed.
> > 
> > Thanks,
> > 
> > -- 
> > Abid M. Malik
> > ******************************************************
> > "I have learned silence from the talkative, toleration from the intolerant, and kindness from the unkind"---Gibran
> > "Success is not for the chosen few, but for the few who choose" --- John Maxwell
> > "Being a good person does not depend on your religion or status in life, your race or skin color, political views or culture. IT DEPENDS ON HOW GOOD YOU TREAT OTHERS"--- Abid
> > "The Universe is talking to us, and the language of the Universe is mathematics."----Abid
> >  
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> 

> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


-- 

Johannes Doerfert
Researcher

Argonne National Laboratory
Lemont, IL 60439, USA

jdoerfert at anl.gov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200130/985a6765/attachment.sig>


More information about the llvm-dev mailing list