No public description PiperOrigin-RevId: 756369964 Change-Id: I4fadd0f2d2e2d7edc4686e8fa063340dc470035b
diff --git a/mpact/sim/decoder/instruction_set.cc b/mpact/sim/decoder/instruction_set.cc index 09ea0af..287f9b8 100644 --- a/mpact/sim/decoder/instruction_set.cc +++ b/mpact/sim/decoder/instruction_set.cc
@@ -987,6 +987,19 @@ absl::StrAppend(&array, "};\n\n"); absl::StrAppend(&cc_output, array, "\n} // namespace\n\n"); + // Generate the regex matcher base class. + absl::StrAppend( + &h_output, + "// Assembly matcher.\n" + "class SlotMatcherInterface {\n" + " public:\n" + " virtual ~SlotMatcherInterface() = default;\n" + " virtual absl::StatusOr<std::tuple<uint64_t, int>> Encode(\n" + " uint64_t address, absl::string_view text, int entry,\n" + " ResolverInterface *resolver,\n" + " std::vector<RelocationInfo> &relocations) = 0;\n" + "};\n\n"); + // Generate the regex matchers for each slot. for (auto *slot : slot_order_) { if (!slot->is_referenced()) continue;
diff --git a/mpact/sim/decoder/slot.cc b/mpact/sim/decoder/slot.cc index 0918d6e..4997503 100644 --- a/mpact/sim/decoder/slot.cc +++ b/mpact/sim/decoder/slot.cc
@@ -479,7 +479,7 @@ &h_output, "// Assembly matcher.\n" "class ", - class_name, + class_name, " : public SlotMatcherInterface", " {\n" " public:\n" " ", @@ -492,7 +492,7 @@ "absl::StatusOr<std::tuple<uint64_t, int>> " " Encode(uint64_t address, absl::string_view text, int entry, " "ResolverInterface *resolver, std::vector<RelocationInfo> " - "&relocations);\n\n" + "&relocations) override;\n\n" " private:\n" " bool Match(absl::string_view text, std::vector<int> &matches);\n" " bool Extract(absl::string_view text, int index, "