Skip to content

Commit bb67c7d

Browse files
authored
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.
1 parent 7c01bb4 commit bb67c7d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

toolchain/sem_ir/dump.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ LLVM_DUMP_METHOD static auto MakeClassId(int id) -> ClassId {
246246
LLVM_DUMP_METHOD static auto MakeConstantId(int id) -> ConstantId {
247247
return ConstantId(id);
248248
}
249+
LLVM_DUMP_METHOD static auto MakeSymbolicConstantId(int id) -> ConstantId {
250+
return ConstantId::ForSymbolicConstantIndex(id);
251+
}
249252
LLVM_DUMP_METHOD static auto MakeEntityNameId(int id) -> EntityNameId {
250253
return EntityNameId(id);
251254
}

0 commit comments

Comments
 (0)