amalykh created this revision.
amalykh added reviewers: rsmith, momchil.velikov, stephenkelly.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
This patch replaces getCharWidth with getCharAlign where it is used incorrectly
Repository:
rC Clang
https://reviews.llvm.org/D
amalykh added a comment.
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
amalykh added a comment.
Thank you for your comments, Roman.
Despite the fact, that there are no official LLVM targets that will be
influenced by this patch, there are architectures which support only word
addressing mode, for which the assumption of char align equals to 8 is not true.
The patch
amalykh added a comment.
> Could you clarify the characteristics of your target?
Yeah, sure.
The target supports only word addressing when it comes to loading from memory
or storing to memory, that's why types shorter than 4 bytes need to be aligned
by at least 4.
In order to achieve this, ge