[llvm] r231529 - Add DIEInteger::setValue() method.

Frédéric Riss friss at apple.com
Fri Mar 6 15:40:16 PST 2015


> On Mar 6, 2015, at 3:33 PM, Eric Christopher <echristo at gmail.com> wrote:
> 
> So they're mostly read only, why change the values rather than create a new one?

Simply convenience. It’s easier to store a DIEInteger * and just call setValue() on it than to store a reference to the  place where the DIEInteger was used to be able to replace it. I could go with the second option, but I’d need to add more complicated API to DIE to be able to change an attribute’s value.

Do you want me to do that?

Fred

> -eric
> 
> On Fri, Mar 6, 2015 at 3:32 PM Frederic Riss <friss at apple.com <mailto:friss at apple.com>> wrote:
> Author: friss
> Date: Fri Mar  6 17:22:46 2015
> New Revision: 231529
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=231529&view=rev <http://llvm.org/viewvc/llvm-project?rev=231529&view=rev>
> Log:
> Add DIEInteger::setValue() method.
> 
> dsymutil needs to 'patch' attribute values after creating them. Just
> add this trivial capability.
> 
> Modified:
>     llvm/trunk/include/llvm/CodeGen/DIE.h
> 
> Modified: llvm/trunk/include/llvm/CodeGen/DIE.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DIE.h?rev=231529&r1=231528&r2=231529&view=diff <http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/DIE.h?rev=231529&r1=231528&r2=231529&view=diff>
> ==============================================================================
> --- llvm/trunk/include/llvm/CodeGen/DIE.h (original)
> +++ llvm/trunk/include/llvm/CodeGen/DIE.h Fri Mar  6 17:22:46 2015
> @@ -278,6 +278,7 @@ public:
>    void EmitValue(const AsmPrinter *AP, dwarf::Form Form) const override;
> 
>    uint64_t getValue() const { return Integer; }
> +  void setValue(uint64_t Val) { Integer = Val; }
> 
>    /// SizeOf - Determine size of integer value in bytes.
>    ///
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu <mailto:llvm-commits at cs.uiuc.edu>
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits <http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150306/7e745660/attachment.html>


More information about the llvm-commits mailing list