[PATCH] D24426: DebugInfo: Pass non-zero alignment to DIBuilder only if aligment was forced
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 12 17:12:25 PDT 2016
On Mon, Sep 12, 2016 at 5:00 PM Paul Robinson <paul.robinson at sony.com>
wrote:
> probinson added a subscriber: probinson.
>
> ================
> Comment at: lib/CodeGen/CGDebugInfo.cpp:3691
> @@ -3635,1 +3690,3 @@
> + if (D->hasAttr<AlignedAttr>())
> + AlignInBits = D->getMaxAlignment();
> StringRef DeclName, LinkageName;
> ----------------
> dblaikie wrote:
> > is max alignment the right thing here? Should it be min alignment?
> > (is alignment in bits the desired thing across all of this too? It
> looked like in the backend patch there was some division by CHAR_BITS, etc?)
> I should think bits is the right choice here; seems more the province of
> the backend to convert it into the appropriate addressable units (commonly
> but not universally chars).
>
The alternative thinking is that we've a generally sense we want to make
more of this type information opaque to LLVM - so I'm somewhat inclined to
make the frontend do the work of choosing what to emit and the backend just
being as simple as possible.
Hmm, seems like the DWARF spec details I can find:
http://www.dwarfstd.org/ShowIssue.php?issue=140528.1 don't really specify
what the value of DW_AT_alignment is, it's sort of assumed, by the looks of
it? I'm assuming it's bytes, the same as the byte_size attribute.
>
>
> https://reviews.llvm.org/D24426
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160913/328e7f0d/attachment-0001.html>
More information about the cfe-commits
mailing list