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

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 17 13:21:34 PDT 2022


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


================
Comment at: llvm/utils/TableGen/X86MnemonicTables.cpp:72
+
+    MnemonicToCGInstrMap[Mnemonic].push_back(I);
+  }
----------------
skan wrote:
> It's not about `CC`. 
> 
> ```
> std::string AsmString = I->FlattenAsmStringVariants(I->AsmString, Variant);
> ```
> `AsmString` is contructed in each iteration and is destroyed at the end of the iteration,  `Mnemoic` references a substring of it while you use it outside the loop.
> I'm afraid it's not safe. Correct me if I am wrong.
Now I understand the issue. I think I've addressed the problem by storing a std::string as a key in the new revision.


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