Skip to content

Commit 0545e9f

Browse files
authored
[LLVM][TableGen] Change DFAEmitter to use const Record pointers (#109042)
Change DFAEmitter to use const Record pointers. This is a part of effort to have better const correctness in TableGen backends: https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
1 parent 87da9e2 commit 0545e9f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/utils/TableGen/DFAEmitter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ void DfaEmitter::printActionValue(action_type A, raw_ostream &OS) { OS << A; }
170170

171171
namespace {
172172

173-
using Action = std::variant<Record *, unsigned, std::string>;
173+
using Action = std::variant<const Record *, unsigned, std::string>;
174174
using ActionTuple = std::vector<Action>;
175175
class Automaton;
176176

@@ -356,7 +356,7 @@ void CustomDfaEmitter::printActionValue(action_type A, raw_ostream &OS) {
356356
ListSeparator LS;
357357
for (const auto &SingleAction : AT) {
358358
OS << LS;
359-
if (const auto *R = std::get_if<Record *>(&SingleAction))
359+
if (const auto *R = std::get_if<const Record *>(&SingleAction))
360360
OS << (*R)->getName();
361361
else if (const auto *S = std::get_if<std::string>(&SingleAction))
362362
OS << '"' << *S << '"';

0 commit comments

Comments
 (0)