Add a text mode for fingerprinting. (#7231)

The intent is to add visibility into how the fingerprint is computed, so
that fingerprinting issues and mangling collisions can be more readily
understood and fixed.

Assisted-by: Gemini via Antigravity
This commit is contained in:
Richard Smith
2026-05-19 23:16:51 +00:00
committed by GitHub
parent ce080b3549
commit be70c092fa
19 changed files with 466 additions and 129 deletions
+2 -1
View File
@@ -480,7 +480,8 @@ static auto BuildCppFunctionDeclForCarbonFn(Context& context,
function_decl->setParams(param_var_decls);
// Mangle the function name and attach it to the `FunctionDecl`.
SemIR::Mangler m(context.sem_ir(), context.total_ir_count());
SemIR::Mangler m(context.sem_ir(), context.total_ir_count(),
context.mangle_string_fingerprint());
std::string mangled_name = m.Mangle(function_id, SemIR::SpecificId::None);
function_decl->addAttr(
clang::AsmLabelAttr::Create(context.ast_context(), mangled_name));