[all-commits] [llvm/llvm-project] e6cb4b: [Clang][CodeGen] Fixing mismatch between memory la...

Lucas Duarte Prates via All-commits all-commits at lists.llvm.org
Thu Apr 2 03:55:25 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: e6cb4b659af9f9c1a4c179093b187e7ad7cc5770
      https://github.com/llvm/llvm-project/commit/e6cb4b659af9f9c1a4c179093b187e7ad7cc5770
  Author: Lucas Prates <lucas.prates at arm.com>
  Date:   2020-04-02 (Thu, 02 Apr 2020)

  Changed paths:
    M clang/lib/CodeGen/CGExprConstant.cpp
    M clang/test/CodeGenCXX/bitfield-layout.cpp

  Log Message:
  -----------
  [Clang][CodeGen] Fixing mismatch between memory layout and const expressions for oversized bitfields

Summary:
The construction of constants for structs/unions was conflicting the
expected memory layout for over-sized bit-fields. When building the
necessary bits for those fields, clang was ignoring the size information
computed for the struct/union memory layout and using the original data
from the AST's FieldDecl information. This caused an issue in big-endian
targets, where the field's contant was incorrectly misplaced due to
endian calculations.

This patch aims to separate the constant value from the necessary
padding bits, using the proper size information for each one of them.
With this, the layout of constants for over-sized bit-fields matches the
ABI requirements.

Reviewers: rsmith, eli.friedman, efriedma

Reviewed By: efriedma

Subscribers: efriedma, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D77048




More information about the All-commits mailing list