[PATCH] D25073: [DebugInfo]: preparation to implement DW_AT_alignment

Adrian Prantl via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 4 13:01:51 PDT 2016


aprantl added a comment.

There also needs to be a bitcode upgrade test if you are changing the serialization format.



> BitcodeReader.cpp:2779
>        IsDistinct = Record[0];
> -      bool HasTag = Record.size() > 8;
> +      bool HasTag = Record.size() != 8;
>        DINode::DIFlags Flags = static_cast<DINode::DIFlags>(Record[7 + HasTag]);

Why change this?

> BitcodeReader.cpp:2781
>        DINode::DIFlags Flags = static_cast<DINode::DIFlags>(Record[7 + HasTag]);
> +      // 11th field if exists contains alignment value
> +      uint64_t AlignInBits = (Record.size() > 9) ? Record[9] : 0;

"." at the end of the sentence; also it is probably not the 11th field.

> BitcodeWriter.cpp:1725
>    Record.push_back(N->isDistinct());
> +  // Fake tag value for backwards compatibility
> +  Record.push_back((uint64_t)-1);

Can you explain?

> DwarfUnit.cpp:1409
> +      // is non-zero if and only if alignment was forced (e.g. _Alignas()),
> +      // which can't be done with bitfields. Thus we use FieldSize here.
> +      uint64_t AlignInBits = FieldSize;

Why is this correct?

https://reviews.llvm.org/D25073





More information about the llvm-commits mailing list