[PATCH] D121571: [TableGen] X86 mnemonic tables backend

Kan Shengchen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 16 02:58:03 PDT 2022


skan added inline comments.


================
Comment at: llvm/utils/TableGen/X86MnemonicTables.cpp:52-58
+    std::string AsmString = I->FlattenAsmStringVariants(I->AsmString, Variant);
+    // Extract a mnemonic, assuming it's separated from the rest of AsmString by
+    // \t
+    std::string::size_type TabPos = AsmString.find_first_of("\t");
+    if (TabPos == std::string::npos)
+      TabPos = AsmString.size();
+    std::string Mnemonic = AsmString.substr(0, TabPos);
----------------
Use `StringRef::take_until`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121571



More information about the llvm-commits mailing list