Files
carbon-lang/toolchain/sem_ir/thunk.h
T
Richard Smith bc06f6c5ec Mangle the signature decl when mangling a thunk. (#7177)
Fixes mangling collisions when two thunks with the same name (eg, `Op`)
are created in the same context, which in turn would lead to LLVM
verifier failures and miscompiles.

To support this, add a new value store to track a little more
information about thunks beyond what's in the `Function`.
2026-05-07 21:58:29 +00:00

26 lines
759 B
C++

// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#ifndef CARBON_TOOLCHAIN_SEM_IR_THUNK_H_
#define CARBON_TOOLCHAIN_SEM_IR_THUNK_H_
#include "toolchain/base/value_store.h"
#include "toolchain/sem_ir/ids.h"
namespace Carbon::SemIR {
// Metadata tracking information about a thunk's signature, callee, and specific
// generic parameters.
struct ThunkInfo {
InstId callee_id;
FunctionId signature_id = FunctionId::None;
SpecificId specific_id = SpecificId::None;
};
using ThunkStore = ValueStore<ThunkId, ThunkInfo, Tag<CheckIRId>>;
} // namespace Carbon::SemIR
#endif // CARBON_TOOLCHAIN_SEM_IR_THUNK_H_