[Lldb-commits] [PATCH] D74690: Separate DIERef vs. user_id_t: GetForwardDeclClangTypeToDie()

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Feb 18 02:14:25 PST 2020


labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

In D74690#1879121 <https://reviews.llvm.org/D74690#1879121>, @jankratochvil wrote:

> Sorry for that `DenseMap::insert`, I see it is the same as `std::map`, I should study `DenseMap` more.


Yep, it tried to be similar to std::map, but there are some (sometimes subtle) differences.



================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:1724
           clang_type.GetOpaqueQualType();
-      dwarf->GetForwardDeclClangTypeToDie()
-          [ClangUtil::RemoveFastQualifiers(clang_type).GetOpaqueQualType()] =
-          die.GetID();
+      dwarf->GetForwardDeclClangTypeToDie().insert(std::make_pair(
+          ClangUtil::RemoveFastQualifiers(clang_type).GetOpaqueQualType(),
----------------
Actually, `try_emplace` would be slightly better here. (Sorry for the back-and-forth :/).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74690





More information about the lldb-commits mailing list