mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-24 02:12:43 +00:00
Rather than producing multiple constants with the same value, fold all instances of a given constant to the same constant instruction. A future PR will use this to replace the current type canonicalization system.
22 lines
695 B
C++
22 lines
695 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_INST_PROFILE_H_
|
|
#define CARBON_TOOLCHAIN_SEM_IR_INST_PROFILE_H_
|
|
|
|
#include "llvm/ADT/FoldingSet.h"
|
|
#include "toolchain/sem_ir/file.h"
|
|
#include "toolchain/sem_ir/inst.h"
|
|
|
|
namespace Carbon::SemIR {
|
|
|
|
// Computes a profile of the given constant instruction, for canonicalization /
|
|
// deduplication.
|
|
auto ProfileConstant(llvm::FoldingSetNodeID& id, const File& sem_ir, Inst inst)
|
|
-> void;
|
|
|
|
} // namespace Carbon::SemIR
|
|
|
|
#endif // CARBON_TOOLCHAIN_SEM_IR_INST_PROFILE_H_
|