[PATCH] D125695: [clang][DebugInfo] Allow function-local type-like entities to be scoped within a lexical block (5/5)

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 27 13:27:42 PDT 2022


dblaikie added inline comments.


================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:231-234
+  assert(LexicalBlockMap.find(&D) == LexicalBlockMap.end() &&
+         "D is already mapped to a lexical block scope");
+  if (!LexicalBlockStack.empty())
+    LexicalBlockMap.insert({&D, LexicalBlockStack.back()});
----------------
Rather than doing an extra lookup in the assert, could probably check the return value of `insert` instead and assert based on that?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125695



More information about the cfe-commits mailing list