mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 11:31:05 +01:00
Remove "__cpp_thunk" from thunk name for exported functions (#7092)
This makes the behavior consistent between methods and regular functions, and fixes the behavior with `using` aliases (see new `using.carbon` test). As requested in https://github.com/carbon-language/carbon-lang/pull/7078#discussion_r3121104954.
This commit is contained in:
@@ -465,16 +465,9 @@ static auto BuildCppToCarbonThunkBody(clang::Sema& sema,
|
||||
// callee of the Carbon thunk.)
|
||||
static auto BuildCppToCarbonThunk(Context& context, SemIR::LocId loc_id,
|
||||
const FunctionInfo& target,
|
||||
llvm::StringRef base_name,
|
||||
llvm::StringRef thunk_name,
|
||||
clang::FunctionDecl* carbon_function_decl)
|
||||
-> clang::FunctionDecl* {
|
||||
// Create the thunk's name.
|
||||
llvm::SmallString<64> thunk_name = base_name;
|
||||
// TODO: changing the thunk name for methods hits this clang assertion:
|
||||
// https://github.com/llvm/llvm-project/blob/058398c4ceaf/clang/lib/AST/Expr.cpp#L1720
|
||||
if (!target.has_self()) {
|
||||
thunk_name += "__cpp_thunk";
|
||||
}
|
||||
auto& thunk_ident = context.ast_context().Idents.get(thunk_name);
|
||||
|
||||
llvm::SmallVector<clang::QualType> param_types;
|
||||
|
||||
Reference in New Issue
Block a user