[PATCH] D121571: [TableGen] X86 mnemonic tables backend
Kan Shengchen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 17 05:29:45 PDT 2022
skan added inline comments.
================
Comment at: llvm/utils/TableGen/X86MnemonicTables.cpp:72
+
+ MnemonicToCGInstrMap[Mnemonic].push_back(I);
+ }
----------------
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.
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