Commit 63aab7c
[CIR][Bugfix] Fix cir.array getTypeSizeInBits method
Constant initialization of static local arrays would fail due to a
mismatch between the variable and the initializer type size. This patch
fixes the data layout interface implementation for the cir.array type.
A complete array in C/C++ should have its type size in bits equal to
the size of the array times the size of the element type.
ghstack-source-id: 56f3f29
Pull Request resolved: #2061 parent db67c45 commit 63aab7c
File tree
3 files changed
+15
-4
lines changed- clang
- lib/CIR
- CodeGen
- Dialect/IR
- test/CIR/CodeGen
3 files changed
+15
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
910 | 910 | | |
911 | 911 | | |
912 | 912 | | |
913 | | - | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
914 | 919 | | |
915 | 920 | | |
916 | | - | |
917 | | - | |
| 921 | + | |
918 | 922 | | |
919 | 923 | | |
920 | 924 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
0 commit comments