Commit 0bd992a
authored
[clang AST] move mangling API to namespace clang to allow calls from swift-frontend (#137884)
When implementing `@objcDirect` in Swift, Swift needs to mangle a native
`Decl` that is not a clang Node, which in turn don't have access to
`clang::MangleContext`. Reimplementing mangling logic in Swift is
redundant.
This patch moves mangling logic from `clang::MangleContext` to `clang`
using only basic types (`StringRef`, `std::optional`, etc.), such that
Swift can we can just call Clang API: Swift depends on Clang already.
We are separating this from #126639 so we can draft the proposal on the
Swift side. #126639 will be worked to depend on this PR.
Tests: No new tests, old ones should pass with no problem.
---------
Signed-off-by: Peter Rong <[email protected]>1 parent d7f096e commit 0bd992a
2 files changed
+34
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
43 | 50 | | |
44 | 51 | | |
45 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
32 | 49 | | |
33 | 50 | | |
34 | 51 | | |
| |||
362 | 379 | | |
363 | 380 | | |
364 | 381 | | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
| 382 | + | |
| 383 | + | |
369 | 384 | | |
370 | 385 | | |
371 | | - | |
| 386 | + | |
372 | 387 | | |
373 | | - | |
| 388 | + | |
374 | 389 | | |
375 | 390 | | |
376 | 391 | | |
377 | 392 | | |
378 | | - | |
| 393 | + | |
379 | 394 | | |
380 | 395 | | |
381 | 396 | | |
382 | | - | |
383 | | - | |
384 | | - | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
385 | 402 | | |
386 | 403 | | |
387 | 404 | | |
| |||
0 commit comments