[clang] [clang] Fix a dangling reference in clang/utils/TableGen/ClangDiagnosticsEmitter.cpp (PR #119197)
Ilya Biryukov via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 10 08:50:03 PST 2024
================
@@ -1908,7 +1908,7 @@ void clang::EmitClangDiagDocs(const RecordKeeper &Records, raw_ostream &OS) {
for (const Record *G : DiagGroups) {
bool IsRemarkGroup = isRemarkGroup(G, DiagsInGroup);
auto &GroupInfo =
- DiagsInGroup[std::string(G->getValueAsString("GroupName"))];
----------------
ilya-biryukov wrote:
If we need to have stable order, let's document it. Could you elaborate what is "different" about a change to StringMap?
It's a container that does key-value lookups with string keys. It is efficient, widely used in LLVM and fully avoids this class of errors. Are there any downsides of using it (assuming we don't need to stable iteration order that std::map provides?)
https://github.com/llvm/llvm-project/pull/119197
More information about the cfe-commits
mailing list