Commit a9969c4
committed
[Support] Remove output file checks from
Currently, `LockFileManager` assumes the owner of the lock file creates an output file. This is problematic for at least three reasons:
1. It is orthogonal to the main purpose of this class - mutual exclusion. This makes creating an alternative implementation more complicated than it needs to be.
2. Some clients (like the upstream `AMDGPUSplitModule.cpp` file) assume the output file is not necessary. The owner of the lock file does not write the file expected by `LockFileManager` and processes waiting for the non-owned lock file therefore assume the owner has died. This means that the work gets repeated by each waiting process, serially.
3. The documentation makes it sound like successfully waiting for a non-owned lock file guarantees the output file to be present on the file system. Implicitly-built modules rely on this. However, the module file may disappear between `LockFileManager` performing the check and the compiler loading the module (for example due to module cache pruning with short intervals, or intervention from outside of Clang). The compiler assumes this cannot happen, and fails the build if it does.
This PR solves this situation by removing the check, reflecting that in the `LockFileManager` documentation, and fixing the time-of-check time-of-use bug in implicit modules.LockFileManager
1 parent 7602d78 commit a9969c4
File tree
3 files changed
+27
-26
lines changed- clang/lib/Frontend
- llvm
- include/llvm/Support
- lib/Support
3 files changed
+27
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1406 | 1406 | | |
1407 | 1407 | | |
1408 | 1408 | | |
1409 | | - | |
| 1409 | + | |
1410 | 1410 | | |
1411 | 1411 | | |
1412 | 1412 | | |
| |||
1427 | 1427 | | |
1428 | 1428 | | |
1429 | 1429 | | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
1430 | 1436 | | |
1431 | 1437 | | |
1432 | 1438 | | |
| |||
1452 | 1458 | | |
1453 | 1459 | | |
1454 | 1460 | | |
1455 | | - | |
| 1461 | + | |
1456 | 1462 | | |
1457 | 1463 | | |
1458 | 1464 | | |
| |||
1517 | 1523 | | |
1518 | 1524 | | |
1519 | 1525 | | |
| 1526 | + | |
1520 | 1527 | | |
1521 | | - | |
| 1528 | + | |
1522 | 1529 | | |
1523 | | - | |
| 1530 | + | |
1524 | 1531 | | |
1525 | 1532 | | |
1526 | | - | |
1527 | | - | |
1528 | | - | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
1529 | 1537 | | |
1530 | 1538 | | |
1531 | 1539 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
| |||
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
53 | | - | |
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
164 | 163 | | |
165 | | - | |
| 164 | + | |
166 | 165 | | |
167 | 166 | | |
168 | 167 | | |
169 | | - | |
| 168 | + | |
170 | 169 | | |
171 | 170 | | |
172 | 171 | | |
| |||
307 | 306 | | |
308 | 307 | | |
309 | 308 | | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
| 309 | + | |
314 | 310 | | |
315 | | - | |
316 | 311 | | |
317 | 312 | | |
318 | 313 | | |
| |||
0 commit comments