fix: correct use of string types.

This commit is contained in:
2025-03-01 23:42:20 +08:00
parent b69cad483b
commit 0fbcb9b499
3 changed files with 6 additions and 6 deletions

View File

@@ -39,11 +39,11 @@ void BoundSymbolList::write(const fs::path& path) const {
} }
void BoundSymbolList::record( void BoundSymbolList::record(
std::string_view symbol, const std::string& symbol,
rva_t rva, rva_t rva,
bool is_function bool is_function
) { ) {
m_entities.emplace(BoundSymbol{std::string(symbol), rva, is_function}); m_entities.emplace(BoundSymbol{symbol, rva, is_function});
} }
} // namespace di::data_format } // namespace di::data_format

View File

@@ -12,7 +12,7 @@ public:
void read(const fs::path& path) override; void read(const fs::path& path) override;
void write(const fs::path& path) const override; void write(const fs::path& path) const override;
void record(std::string_view symbol, rva_t rva, bool is_function); void record(const std::string& symbol, rva_t rva, bool is_function);
constexpr void for_each(const for_each_callback_t& callback) const { constexpr void for_each(const for_each_callback_t& callback) const {
for (const auto& entity : m_entities) callback(entity); for (const auto& entity : m_entities) callback(entity);

View File

@@ -52,7 +52,7 @@ public:
// Do not mangle template deduction guides. // Do not mangle template deduction guides.
if (isa<CXXDeductionGuideDecl>(decl)) return true; if (isa<CXXDeductionGuideDecl>(decl)) return true;
std::string mangled_name = m_namegen.getName(decl); auto mangled_name = m_namegen.getName(decl);
if (!mangled_name.empty()) { if (!mangled_name.empty()) {
if (config_record_decl_name) { if (config_record_decl_name) {
mangled_name = std::format( mangled_name = std::format(