Skip to content

Commit f138af5

Browse files
committed
Rename GetFnRefName to MapFunctionName
1 parent 60209ac commit f138af5

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

cpp2rust/converter/converter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ std::string Converter::GetPointeeRustType(clang::QualType ptr_type) {
14081408

14091409
void Converter::ConvertFunctionToFunctionPointer(
14101410
const clang::FunctionDecl *fn_decl) {
1411-
StrCat(std::format("Some({})", Mapper::GetFnRefName(fn_decl)));
1411+
StrCat(std::format("Some({})", Mapper::MapFunctionName(fn_decl)));
14121412
}
14131413

14141414
void Converter::ConvertGenericCallExpr(clang::CallExpr *expr) {

cpp2rust/converter/mapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ const TranslationRule::ExprTgt *GetExprTgt(const clang::Expr *expr) {
588588
return nullptr;
589589
}
590590

591-
std::string GetFnRefName(const clang::FunctionDecl *decl) {
591+
std::string MapFunctionName(const clang::FunctionDecl *decl) {
592592
assert(decl);
593593
if (model_ == Model::kRefCount) {
594594
auto refcount_path = GetRulePathForFunction(decl, "tgt_refcount");

cpp2rust/converter/mapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ bool Contains(const clang::Expr *expr);
1919

2020
std::string Map(clang::QualType qual_type);
2121
const TranslationRule::ExprTgt *GetExprTgt(const clang::Expr *expr);
22-
std::string GetFnRefName(const clang::FunctionDecl *decl);
22+
std::string MapFunctionName(const clang::FunctionDecl *decl);
2323
std::string InstantiateTemplate(const clang::Expr *expr,
2424
const std::string &text);
2525
bool ReturnsPointer(const clang::Expr *expr);

cpp2rust/converter/models/converter_refcount.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ std::string ConverterRefCount::BuildFnAdapter(
196196
closure += "{ ";
197197

198198
// Build adapter body: src_fn(convert(a0), convert(a1), ...)
199-
closure += Mapper::GetFnRefName(src_fn) + "(";
199+
closure += Mapper::MapFunctionName(src_fn) + "(";
200200
for (unsigned i = 0; i < src_proto->getNumParams(); ++i) {
201201
auto src_pty = src_proto->getParamType(i);
202202
auto tgt_pty = target_proto->getParamType(i);
@@ -1039,7 +1039,7 @@ void ConverterRefCount::ConvertFunctionToFunctionPointer(
10391039
StrCat(std::format("FnPtr::<{}>::new({})",
10401040
ConvertFunctionPointerType(
10411041
fn_decl->getType()->getAs<clang::FunctionProtoType>()),
1042-
Mapper::GetFnRefName(fn_decl)));
1042+
Mapper::MapFunctionName(fn_decl)));
10431043
}
10441044

10451045
void ConverterRefCount::ConvertEqualsNullPtr(clang::Expr *expr) {

0 commit comments

Comments
 (0)