Add SemIR::MakeSymbolicConstantId(int) (#4862)

Symbolic constants are negative values (starting at -3 at the moment)
but instead of having to figure the correct integer value for
MakeConstantId, provide a function to make a symbolic constant directly.
This commit is contained in:
Dana Jansens
2025-01-29 16:55:14 +00:00
committed by GitHub
parent 7c01bb4e5c
commit bb67c7dfb2
+3
View File
@@ -246,6 +246,9 @@ LLVM_DUMP_METHOD static auto MakeClassId(int id) -> ClassId {
LLVM_DUMP_METHOD static auto MakeConstantId(int id) -> ConstantId {
return ConstantId(id);
}
LLVM_DUMP_METHOD static auto MakeSymbolicConstantId(int id) -> ConstantId {
return ConstantId::ForSymbolicConstantIndex(id);
}
LLVM_DUMP_METHOD static auto MakeEntityNameId(int id) -> EntityNameId {
return EntityNameId(id);
}