Commit 95522dc
committed
[NFC] Optimize File kind determination
There are checks in clang codebase that determine the type of source
file, associated with a given location - specifically, if it is an
ordonary file or comes from sources like command-line options or a
built-in definitions. These checks often rely on calls to
`getPresumedLoc`, which is relatively expensive. In certain cases,
these checks are combined, leading to repeated calculations of the
costly function negatively affecting compile time.
This change tries to optimize such checks. It must fix compile time
regression introduced in #137306.1 parent aeb5a58 commit 95522dc
File tree
4 files changed
+14
-9
lines changed- clang
- include/clang/Basic
- lib
- ExtractAPI
- Frontend
- Lex
4 files changed
+14
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1529 | 1529 | | |
1530 | 1530 | | |
1531 | 1531 | | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
1532 | 1541 | | |
1533 | 1542 | | |
1534 | 1543 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
309 | | - | |
| 308 | + | |
310 | 309 | | |
311 | 310 | | |
312 | 311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
572 | | - | |
573 | | - | |
| 572 | + | |
574 | 573 | | |
575 | 574 | | |
576 | 575 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | | - | |
378 | | - | |
379 | | - | |
| 377 | + | |
| 378 | + | |
380 | 379 | | |
381 | 380 | | |
382 | 381 | | |
| |||
1706 | 1705 | | |
1707 | 1706 | | |
1708 | 1707 | | |
1709 | | - | |
1710 | | - | |
| 1708 | + | |
1711 | 1709 | | |
1712 | 1710 | | |
1713 | 1711 | | |
| |||
0 commit comments