[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
Mon Dec 9 05:32:18 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:
Maybe replace with `llvm::StringMap` to get better performance and avoid these problems for good?
I would be surprised if the `StringRef` in the map is critical for performance and I am 99% certain that `StringMap` will likely win over `std::map<StringRef, ...` anyway.
https://github.com/llvm/llvm-project/pull/119197
More information about the cfe-commits
mailing list