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

Eric Christopher echristo at gmail.com
Fri Mar 6 16:44:56 PST 2015


On Fri, Mar 6, 2015 at 3:40 PM Frédéric Riss <friss at apple.com> wrote:

> 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?
>
>
I don't have a strong opinion I guess. Up to now they've been read only
DIEs, but I don't really know what we get out of keeping it that way.

I guess if it starts to get icky or complicated we can rethink it.

-eric


> Fred
>
> -eric
>
> On Fri, Mar 6, 2015 at 3:32 PM Frederic Riss <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
>> 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
>> ============================================================
>> ==================
>> --- 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
>> 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/20150307/67147f62/attachment.html>


More information about the llvm-commits mailing list