mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 19:40:10 +01:00
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`.
26 lines
759 B
C++
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_
|