Commit bb51313
committed
[BoundsSafety][NFC] Simplify the interface of
`BoundsSafetyCheckAssignmentToCountAttrPtrWithIncompletePointeeTy`
Previously the interface took a std::function<std::string>. The
rationale behind this was to prevent callers from always allocating and
computing a `std::string`.
While trying to upstream this code (rdar://133600117)
(llvm#106321) it was pointed out
that there might be a simpler way to implement this.
This patch instead has callers pass
* a `ValueDecl*` pointer. In the cases where this isn't known (currently
return values and unnamed parameters) this can be set to nullptr
* a boolean flag stating whether or not the `ValueDecl*` should be fully
qualified when printed.
This avoids needing to pass a `std::function` and also avoids `std::string`
unnecessary allocation.
rdar://1425447081 parent aef1dbe commit bb51313
File tree
4 files changed
+55
-48
lines changed- clang
- include/clang/Sema
- lib/Sema
4 files changed
+55
-48
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2228 | 2228 | | |
2229 | 2229 | | |
2230 | 2230 | | |
2231 | | - | |
2232 | | - | |
2233 | | - | |
2234 | | - | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
2235 | 2237 | | |
2236 | 2238 | | |
2237 | 2239 | | |
2238 | 2240 | | |
2239 | | - | |
2240 | | - | |
| 2241 | + | |
| 2242 | + | |
2241 | 2243 | | |
2242 | 2244 | | |
2243 | 2245 | | |
| |||
2248 | 2250 | | |
2249 | 2251 | | |
2250 | 2252 | | |
2251 | | - | |
2252 | | - | |
2253 | | - | |
2254 | | - | |
| 2253 | + | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
| 2257 | + | |
| 2258 | + | |
2255 | 2259 | | |
2256 | 2260 | | |
2257 | 2261 | | |
2258 | 2262 | | |
2259 | | - | |
| 2263 | + | |
| 2264 | + | |
2260 | 2265 | | |
2261 | 2266 | | |
2262 | 2267 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
467 | | - | |
| 466 | + | |
| 467 | + | |
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
| |||
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
484 | | - | |
485 | | - | |
486 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
487 | 492 | | |
488 | 493 | | |
489 | | - | |
490 | | - | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
491 | 498 | | |
492 | 499 | | |
493 | 500 | | |
| |||
501 | 508 | | |
502 | 509 | | |
503 | 510 | | |
504 | | - | |
505 | | - | |
| 511 | + | |
| 512 | + | |
506 | 513 | | |
507 | 514 | | |
508 | 515 | | |
509 | 516 | | |
510 | | - | |
| 517 | + | |
511 | 518 | | |
512 | 519 | | |
513 | 520 | | |
| |||
531 | 538 | | |
532 | 539 | | |
533 | 540 | | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
541 | 545 | | |
542 | 546 | | |
543 | 547 | | |
| |||
629 | 633 | | |
630 | 634 | | |
631 | 635 | | |
632 | | - | |
| 636 | + | |
633 | 637 | | |
634 | 638 | | |
635 | 639 | | |
636 | | - | |
| 640 | + | |
637 | 641 | | |
638 | | - | |
639 | 642 | | |
640 | 643 | | |
641 | 644 | | |
| |||
644 | 647 | | |
645 | 648 | | |
646 | 649 | | |
647 | | - | |
| 650 | + | |
648 | 651 | | |
649 | 652 | | |
650 | 653 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9503 | 9503 | | |
9504 | 9504 | | |
9505 | 9505 | | |
9506 | | - | |
9507 | | - | |
| 9506 | + | |
| 9507 | + | |
9508 | 9508 | | |
9509 | 9509 | | |
9510 | 9510 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16730 | 16730 | | |
16731 | 16731 | | |
16732 | 16732 | | |
| 16733 | + | |
| 16734 | + | |
| 16735 | + | |
| 16736 | + | |
| 16737 | + | |
| 16738 | + | |
| 16739 | + | |
| 16740 | + | |
| 16741 | + | |
| 16742 | + | |
16733 | 16743 | | |
16734 | | - | |
16735 | | - | |
16736 | | - | |
16737 | | - | |
16738 | | - | |
16739 | | - | |
16740 | | - | |
16741 | | - | |
16742 | | - | |
16743 | | - | |
16744 | | - | |
16745 | | - | |
16746 | | - | |
| 16744 | + | |
| 16745 | + | |
16747 | 16746 | | |
16748 | 16747 | | |
16749 | 16748 | | |
| |||
26280 | 26279 | | |
26281 | 26280 | | |
26282 | 26281 | | |
26283 | | - | |
| 26282 | + | |
0 commit comments