Commit cb12c3a
committed
[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 beb5bb5 commit cb12c3a
File tree
2 files changed
+7
-1
lines changed- clang
- lib/CIR/Dialect/IR
- test/CIR/CodeGen
2 files changed
+7
-1
lines changed| 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 | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
0 commit comments