Commit f2ad45c
committed
[llvm-cov][WebAssembly] Align coverage mapping section to 8 bytes
Wasm format does not have a good way to insert padding bytes to align
the start of a section contents because the size of each section header
depends on the size of the section contents (leb128 encoding). This
design makes it difficult to align section contents to a specific
alignment to load them by post-processing tools like llvm-cov.
This patch copies the coverage mapping section to a new buffer that is
aligned to 8 bytes if the original section is not aligned. This is
not an ideal solution but it works for now.1 parent 29cc14f commit f2ad45c
2 files changed
Lines changed: 28 additions & 8 deletions
File tree
- llvm
- include/llvm/ProfileData/Coverage
- lib/ProfileData/Coverage
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
183 | 184 | | |
184 | 185 | | |
185 | 186 | | |
| |||
195 | 196 | | |
196 | 197 | | |
197 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
198 | 204 | | |
199 | | - | |
200 | | - | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
201 | 209 | | |
202 | 210 | | |
203 | 211 | | |
| |||
212 | 220 | | |
213 | 221 | | |
214 | 222 | | |
| 223 | + | |
215 | 224 | | |
216 | 225 | | |
217 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
| 897 | + | |
897 | 898 | | |
898 | 899 | | |
899 | 900 | | |
900 | 901 | | |
901 | 902 | | |
902 | | - | |
903 | | - | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
904 | 906 | | |
905 | 907 | | |
906 | 908 | | |
| |||
1035 | 1037 | | |
1036 | 1038 | | |
1037 | 1039 | | |
1038 | | - | |
1039 | | - | |
| 1040 | + | |
| 1041 | + | |
1040 | 1042 | | |
1041 | 1043 | | |
1042 | 1044 | | |
| |||
1136 | 1138 | | |
1137 | 1139 | | |
1138 | 1140 | | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
1139 | 1150 | | |
1140 | 1151 | | |
1141 | 1152 | | |
| |||
1184 | 1195 | | |
1185 | 1196 | | |
1186 | 1197 | | |
1187 | | - | |
1188 | | - | |
| 1198 | + | |
| 1199 | + | |
1189 | 1200 | | |
1190 | 1201 | | |
1191 | 1202 | | |
| |||
0 commit comments