vleschuk added inline comments.
Comment at: lib/CodeGen/CGDebugInfo.cpp:608
@@ -608,2 +607,3 @@
uint64_t Size = CGM.getContext().getTypeSize(Ty);
+ uint64_t Align = 0;
rnk wrote:
> IMO this is what we should be doing everywhere, rather than manually
vleschuk added inline comments.
Comment at: lib/CodeGen/CGDebugInfo.cpp:3691
@@ -3635,1 +3690,3 @@
+ if (D->hasAttr())
+AlignInBits = D->getMaxAlignment();
StringRef DeclName, LinkageName;
probinson wrote:
> dblaikie wrote:
> > is max alignment the right
I hadn't thought Clang wanted to be *quite* so knowledgeable about targets, and
similarly not so tightly tied to byte-addressable targets. But if both of
those things are actually okay, then it's fine to set the alignment value here
to what would be passed through to DWARF.
--paulr
From:
On Mon, Sep 12, 2016 at 6:01 PM Robinson, Paul
wrote:
> The text in the committee draft is different (e.g., the exhortation about
> non-default alignment is gone), with an example to the effect that a value
> of 8 means the entity's address is a multiple of 8 (not 2^8).
The text in the committee draft is different (e.g., the exhortation about
non-default alignment is gone), with an example to the effect that a value of 8
means the entity's address is a multiple of 8 (not 2^8). So, alignment is
conceived in terms of address bits, whatever those represent (not
rnk added a subscriber: rnk.
Comment at: lib/CodeGen/CGDebugInfo.cpp:608
@@ -608,2 +607,3 @@
uint64_t Size = CGM.getContext().getTypeSize(Ty);
+ uint64_t Align = 0;
IMO this is what we should be doing everywhere, rather than manually checking
AlignedAttr:
probinson added a subscriber: probinson.
Comment at: lib/CodeGen/CGDebugInfo.cpp:3691
@@ -3635,1 +3690,3 @@
+ if (D->hasAttr())
+AlignInBits = D->getMaxAlignment();
StringRef DeclName, LinkageName;
dblaikie wrote:
> is max alignment the right thing here?
dblaikie added a comment.
Like the backend patch, should/could this be broken up into separate patches
for the different places/features that have alignment?
(probably just passing zero for alignment in general could be a simple cleanup
patch to start, if it's otherwise unused)
vleschuk retitled this revision from "DebugInfo: use
llvm::DINode::FlagAlignment to mark forcibly aligned data" to "DebugInfo: Pass
non-zero alignment to DIBuilder only if aligment was forced".
vleschuk updated the summary for this revision.
vleschuk updated this revision to Diff 70965.
vleschuk