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

2023-01-12 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri resigned from this revision. lebedev.ri added a comment. This revision now requires review to proceed. Herald added a subscriber: StephenFan. Herald added a project: All. This review seems to be stuck/dead, consider abandoning if no longer relevant. Repository: rC Clang CHANGES SIN

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

2019-03-05 Thread Aleksandr Malykh via Phabricator via cfe-commits
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

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

2019-03-05 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. > The patch have been tested for a proprietary architecture, where there is a > difference between align and width of char. The C standard requires that both `alignof(char)` and `sizeof(char)` must equal 1, and therefore must equal each other. Could you clarify the

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

2019-03-04 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri requested changes to this revision. lebedev.ri added a comment. This revision now requires changes to proceed. In D58811#1417959 , @amalykh wrote: > Thank you for your comments, Roman. > Despite the fact, that there are no official LLVM targets

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

2019-03-04 Thread Aleksandr Malykh via Phabricator via cfe-commits
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

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

2019-03-01 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. In 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 getChar

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

2019-03-01 Thread Aleksandr Malykh via Phabricator via cfe-commits
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

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

2019-03-01 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Can you be more specific? Is there some bugreport this fixes? Is there some test? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58811/new/ https://reviews.llvm.org/D58811 ___ cfe-commits m

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

2019-03-01 Thread Aleksandr Malykh via Phabricator via cfe-commits
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