Commit c7d7419
committed
[Modules] Record side effect info in EvaluatedStmt
All deserialized VarDecl initializers are EvaluatedStmt, but not all
EvaluatedStmt initializers are from a PCH. Calling
`VarDecl::hasInitWithSideEffects` can trigger constant evaluation, but
it's hard to know ahead of time whether that will trigger
deserialization - even if the initializer is fully deserialized, it may
contain a call to a constructor whose body is not deserialized. By
caching the result of `VarDecl::hasInitWithSideEffects` and populating
that cache during deserialization we can guarantee that calling it won't
trigger deserialization regardless of the state of the initializer.
This also reduces memory usage by removing the `InitSideEffectVars` set
in `ASTReader`.
rdar://1547179301 parent a2dc64c commit c7d7419
File tree
11 files changed
+77
-63
lines changed- clang
- include/clang
- AST
- Sema
- Serialization
- lib
- AST
- Sema
- Serialization
- test/Modules
11 files changed
+77
-63
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
888 | 888 | | |
889 | 889 | | |
890 | 890 | | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
891 | 894 | | |
892 | 895 | | |
893 | 896 | | |
894 | 897 | | |
895 | 898 | | |
896 | 899 | | |
897 | | - | |
| 900 | + | |
| 901 | + | |
898 | 902 | | |
899 | 903 | | |
900 | 904 | | |
| |||
1353 | 1357 | | |
1354 | 1358 | | |
1355 | 1359 | | |
1356 | | - | |
1357 | | - | |
1358 | | - | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
1359 | 1365 | | |
1360 | 1366 | | |
1361 | 1367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | 199 | | |
204 | 200 | | |
205 | 201 | | |
| |||
434 | 430 | | |
435 | 431 | | |
436 | 432 | | |
437 | | - | |
438 | | - | |
439 | | - | |
440 | | - | |
441 | | - | |
442 | | - | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | 433 | | |
449 | 434 | | |
450 | 435 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | 97 | | |
100 | 98 | | |
101 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1453 | 1453 | | |
1454 | 1454 | | |
1455 | 1455 | | |
1456 | | - | |
1457 | | - | |
1458 | | - | |
1459 | | - | |
1460 | | - | |
1461 | | - | |
1462 | 1456 | | |
1463 | 1457 | | |
1464 | 1458 | | |
| |||
2410 | 2404 | | |
2411 | 2405 | | |
2412 | 2406 | | |
2413 | | - | |
2414 | | - | |
2415 | 2407 | | |
2416 | 2408 | | |
2417 | 2409 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2444 | 2444 | | |
2445 | 2445 | | |
2446 | 2446 | | |
2447 | | - | |
2448 | | - | |
2449 | | - | |
2450 | | - | |
2451 | | - | |
2452 | | - | |
2453 | | - | |
2454 | | - | |
2455 | | - | |
2456 | | - | |
2457 | | - | |
2458 | | - | |
2459 | | - | |
2460 | | - | |
2461 | | - | |
2462 | | - | |
2463 | | - | |
2464 | | - | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
| 2450 | + | |
| 2451 | + | |
| 2452 | + | |
| 2453 | + | |
| 2454 | + | |
| 2455 | + | |
| 2456 | + | |
2465 | 2457 | | |
2466 | 2458 | | |
2467 | 2459 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | 118 | | |
127 | 119 | | |
128 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9725 | 9725 | | |
9726 | 9726 | | |
9727 | 9727 | | |
9728 | | - | |
9729 | | - | |
9730 | | - | |
9731 | | - | |
9732 | 9728 | | |
9733 | 9729 | | |
9734 | 9730 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1628 | 1628 | | |
1629 | 1629 | | |
1630 | 1630 | | |
1631 | | - | |
1632 | | - | |
1633 | | - | |
1634 | 1631 | | |
1635 | 1632 | | |
1636 | 1633 | | |
| |||
1701 | 1698 | | |
1702 | 1699 | | |
1703 | 1700 | | |
| 1701 | + | |
| 1702 | + | |
1704 | 1703 | | |
1705 | 1704 | | |
1706 | 1705 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7320 | 7320 | | |
7321 | 7321 | | |
7322 | 7322 | | |
| 7323 | + | |
| 7324 | + | |
| 7325 | + | |
| 7326 | + | |
7323 | 7327 | | |
7324 | 7328 | | |
7325 | 7329 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1305 | 1305 | | |
1306 | 1306 | | |
1307 | 1307 | | |
1308 | | - | |
1309 | 1308 | | |
1310 | 1309 | | |
1311 | 1310 | | |
| |||
0 commit comments