mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SIL] Use mangled names + asmname for @c functions
Instead of using the C name for `@c` functions in SIL, retain mangled names and apply the `asmname` attribute, so we retain more type information until later in the pipeline and avoid collisions. Another part of rdar://137014448.
This commit is contained in:
@@ -333,6 +333,10 @@ struct SILDeclRef {
|
||||
/// Produce a mangled form of this constant.
|
||||
std::string mangle(ManglingKind MKind = ManglingKind::Default) const;
|
||||
|
||||
/// If the symbol has a specific name for use at the LLVM IR level,
|
||||
/// produce that name. This may be different than the mangled name in SIL.
|
||||
std::optional<StringRef> getAsmName() const;
|
||||
|
||||
/// True if the SILDeclRef references a function.
|
||||
bool isFunc() const {
|
||||
return kind == Kind::Func;
|
||||
|
||||
Reference in New Issue
Block a user