Sohail Somani (Fizz Buzz Inc.) via llvm-dev
2018-Jul-16 12:57 UTC
[llvm-dev] sizeof(DIFlags)
Hi list, Is there a standards based reason why the DIFlags enum is set to uint32_t[1]? I am sure my DWARF-std-reading-fu is not up to snuff and so I cannot seem to find it. The reason I ask is that we are running out of space for our own DIFlags and would like to nail this down before deciding on an approach. Thanks! Sohail [1] The code in question: https://github.com/llvm-mirror/llvm/blob/master/include/llvm/IR/DebugInfoMetadata.h#L194 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180716/2f01fd98/attachment.html>
DIFlags is internal to the compiler, not directly determined by the DWARF standard. It mostly happens to be full of data that gets turned into DWARF flags. I suspect it's nailed down to 32 bits mainly because we haven't needed more, so far. Also MSVC historically failed to handle enum values wider than 32 bits; I don't know whether that's still true. --paulr From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Sohail Somani (Fizz Buzz Inc.) via llvm-dev Sent: Monday, July 16, 2018 8:57 AM To: llvm-dev at lists.llvm.org Subject: [llvm-dev] sizeof(DIFlags) Hi list, Is there a standards based reason why the DIFlags enum is set to uint32_t[1]? I am sure my DWARF-std-reading-fu is not up to snuff and so I cannot seem to find it. The reason I ask is that we are running out of space for our own DIFlags and would like to nail this down before deciding on an approach. Thanks! Sohail [1] The code in question: https://github.com/llvm-mirror/llvm/blob/master/include/llvm/IR/DebugInfoMetadata.h#L194 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180716/a4b4e2cf/attachment.html>
Sohail Somani (Fizz Buzz Inc.) via llvm-dev
2018-Jul-16 17:19 UTC
[llvm-dev] sizeof(DIFlags)
Thanks Paul! This was our conclusion as well so it's encouraging that you feel similarly. The next question is whether these are being cast to int/unsigned somewhere. That will be fun to track down :) On Mon, Jul 16, 2018, at 1:17 PM, paul.robinson at sony.com wrote:> DIFlags is internal to the compiler, not directly determined by the > DWARF standard. It mostly happens to be full of data that gets turned > into DWARF flags.> I suspect it's nailed down to 32 bits mainly because we haven't needed > more, so far. Also MSVC historically failed to handle enum values > wider than 32 bits; I don't know whether that's still true.> --paulr>> *From:* llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] *On Behalf > Of *Sohail Somani (Fizz Buzz Inc.) via llvm-dev *Sent:* Monday, July > 16, 2018 8:57 AM *To:* llvm-dev at lists.llvm.org *Subject:* [llvm-dev] > sizeof(DIFlags)>> Hi list,>> Is there a standards based reason why the DIFlags enum is set to > uint32_t[1]? I am sure my DWARF-std-reading-fu is not up to snuff and > so I cannot seem to find it.>> The reason I ask is that we are running out of space for our own > DIFlags and would like to nail this down before deciding on an > approach.>> Thanks!>> Sohail>> [1] The code in question: > https://github.com/llvm-mirror/llvm/blob/master/include/llvm/IR/DebugInfoMetadata.h#L194>>-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180716/7c2c8f29/attachment-0001.html>
I think mainly to ensure that we don't have extra padding in DIType objects: class DIType : public DIScope { unsigned Line; DIFlags Flags; uint64_t SizeInBits; uint64_t OffsetInBits; uint32_t AlignInBits; If DIFlags grew to 64-bits, we'd want to re-arrange things to save memory. DITypes have been known to consume large amounts of memory. On Mon, Jul 16, 2018 at 5:57 AM Sohail Somani (Fizz Buzz Inc.) via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Hi list, > > Is there a standards based reason why the DIFlags enum is set to > uint32_t[1]? I am sure my DWARF-std-reading-fu is not up to snuff and so I > cannot seem to find it. > > The reason I ask is that we are running out of space for our own DIFlags > and would like to nail this down before deciding on an approach. > > Thanks! > > Sohail > > [1] The code in question: > https://github.com/llvm-mirror/llvm/blob/master/include/llvm/IR/DebugInfoMetadata.h#L194 > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180716/3a17b136/attachment.html>
Possibly Parallel Threads
- RFC: Adding debug information to LLVM to support Fortran
- Can creating new forms of debug info metadata be simplified? [formatting fixed]
- Can creating new forms of debug info metadata be simplified? [formatting fixed]
- Can creating new forms of debug info metadata be simplified? [formatting fixed]
- Can creating new forms of debug info metadata be simplified? [formatting fixed]