[PATCH] D67968: [TableGen] Introduce a generic automaton (DFA) backend

David Majnemer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 14:33:53 PDT 2019


majnemer added inline comments.


================
Comment at: llvm/include/llvm/TableGen/Automaton.td:25
+//   S: (sigma) The input alphabet.
+//   d: (delta) The transition function f(q ∊ Q, s ∊ S) -> q' ∊ Q
+//   F: The set of final (accepting) states.
----------------
Is it OK to have unicode in source files? It used to be frowned upon IIRC.


================
Comment at: llvm/utils/TableGen/DFAEmitter.cpp:210-211
+
+  bool canTransitionFrom(const uint64_t &State);
+  uint64_t transitionFrom(const uint64_t &State);
+};
----------------
Why do these take references?


================
Comment at: llvm/utils/TableGen/DFAEmitter.cpp:334
+      if (Bit->getValue())
+        NewState |= 1ULL << I;
+    }
----------------
Should we `assert(NewStateInit->getNumBits() <= sizeof(uint64_t) * 8` somewhere?


================
Comment at: llvm/utils/TableGen/DFAEmitter.h:48
+
+  DfaEmitter() {}
+  virtual ~DfaEmitter() {}
----------------
`= default();`


================
Comment at: llvm/utils/TableGen/DFAEmitter.h:49
+  DfaEmitter() {}
+  virtual ~DfaEmitter() {}
+
----------------
`= default();`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67968/new/

https://reviews.llvm.org/D67968





More information about the llvm-commits mailing list