[PATCH] D74649: [TBLGEN] Emit register pressure set enum

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 16 09:24:20 PST 2020


rampitec marked an inline comment as done.
rampitec added inline comments.


================
Comment at: llvm/utils/TableGen/RegisterInfoEmitter.cpp:101-109
+static std::string getLegalCName(std::string Name) {
+  static const char legal_elements[] =
+    "_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
+  std::string::size_type pos = 0;
+  while ((pos = Name.find_first_not_of(legal_elements, pos)) !=
+         std::string::npos)
+    Name.replace(pos, 1, "_");
----------------
nhaehnle wrote:
> Is there no pre-existing way of doing this in TableGen? If not, why is this needed in the first place?
I was looking for one and didn't find. Looks like in other cases tablegen just avoids such names. Here I saw "+" sign. Probably it will take yet another change to remove both invalid symbols and this function.


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

https://reviews.llvm.org/D74649





More information about the llvm-commits mailing list