<div dir="ltr"><div><div>There is a store operation if you want the value on the stack or heap, but there is no assignment operator in IR. <br></div>CreateAdd returns an Instruction which represents both the operation and the result value. Value's are immutable and can be used as input arguments to any Instruction further down the control flow.<br></div><div><br></div>The other thing you might need to research is the Phi Instruction. Which gives you a way to specify how the value in this basic block will be different based on how we reached this block in the control flow of the function.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 16, 2016 at 1:04 PM, Paul Hancock via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">However I need the standard assignment operator so I can assign the value of a temporary to that of another temporary, or to create a new temporary from an existing one.<br>
<br>
- Paul<br>
<br>
________________________________________<br>
From: Tim Northover <<a href="mailto:t.p.northover@gmail.com">t.p.northover@gmail.com</a>><br>
Sent: 16 March 2016 13:11<br>
To: Paul Hancock<br>
Cc: <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
Subject: Re: [llvm-dev] IRBuilder Assignment ( '=' ) operator?<br>
<div class="HOEnZb"><div class="h5"><br>
Hi Paul,<br>
<br>
On 15 March 2016 at 17:59, Paul Hancock via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> In my code assembly system I have the various LH-RH operators, ADD, ADDF,<br>
> SUB, etc, using CreateAdd, CreateFAdd, etc, however I cant seem to locate<br>
> the correct function/s for the assignment operator.<br>
<br>
The assignment is automatic. The pointer you get back from CreateAdd<br>
can be used directly in other instructions. When this is transcribed<br>
to the textual IR, LLVM will put in the appropriate assignments (so it<br>
won't try to assign a store to anything for example, because it<br>
doesn't produce a value that can be used elsewhere).<br>
<br>
The Name parameter you pass to CreateAdd determines what variable will<br>
be assigned, otherwise an incrementing number will be used (%1, %2,<br>
...).<br>
<br>
Cheers.<br>
<br>
Tim.<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</div></div></blockquote></div><br></div>