[PATCH] D58811: [clang] Fix misuses of char width to char align

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 1 02:20:47 PST 2019


lebedev.ri added a comment.

In D58811#1414784 <https://reviews.llvm.org/D58811#1414784>, @amalykh wrote:

> Currently getCharWidth and getCharAlign functions are hard coded to return 8 in clang with no way to change it for target.
>  This can be seen in TargetInfo.h file:
>
>   unsigned getCharWidth() const { return 8; } // FIXME
>   unsigned getCharAlign() const { return 8; } // FIXME
>   
>
> It means that these functions can be used interchangeably and there will be no test failures because of this, until custom alignment will be supported.
>  Nevertheless, it will not be possible to support custom alignment until all incorrect usages of getCharWidth will be replaced with getCharAlign. This patch fixes some of them


Likewise, LLVM hardcodes that byte is 8 bits and does not want to change that
since there is no official LLVM target with that characteristics,
and thus it is impossible to test it, and it would quickly regress.

Which target will be affected by this patch?
I suspect the situation is the same here.
If there is no way to test this upstream...


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58811/new/

https://reviews.llvm.org/D58811





More information about the cfe-commits mailing list