[PATCH] D42369: Issue local statics in correct DWARF lexical scope
Vedant Kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 22 11:59:13 PST 2018
vsk added inline comments.
================
Comment at: lib/CodeGen/AsmPrinter/DwarfCompileUnit.h:88
+ typedef llvm::SmallVector<DIE *, 8> LocalLexicalDIEs;
+ llvm::DenseMap<const DILexicalBlock *, LocalLexicalDIEs> LocalLexicalDIEsMap;
+
----------------
Can we allocate fewer DIE pointers inline? The first time a DenseMap grows, it allocates space for 64 entries, so this might get big a bit too quick.
================
Comment at: lib/CodeGen/AsmPrinter/DwarfCompileUnit.h:142
+ /// getLocalLexicalDIEs - Return vector of local DIEs for lexical scope
+ const LocalLexicalDIEs& getLocalLexicalDIEs(const DILexicalBlock *Scope) {
+ static const LocalLexicalDIEs Empty;
----------------
Just return an Optional<LocalLexicalDIEs>? As written, I think this creates a distinct 'LocalLexicalDIEs Empty' object in each translation unit that includes the header.
https://reviews.llvm.org/D42369
More information about the llvm-commits
mailing list