[all-commits] [llvm/llvm-project] 9b809c: [LLDB][NativePDB] Improve ParseDeclsForContext time.

Zequan Wu via All-commits all-commits at lists.llvm.org
Fri Oct 21 10:33:32 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9b809cc5b69a45601910bf4c60a2ece2f5462a18
      https://github.com/llvm/llvm-project/commit/9b809cc5b69a45601910bf4c60a2ece2f5462a18
  Author: Zequan Wu <zequanwu at google.com>
  Date:   2022-10-21 (Fri, 21 Oct 2022)

  Changed paths:
    M lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
    M lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h

  Log Message:
  -----------
  [LLDB][NativePDB] Improve ParseDeclsForContext time.

1. When we evaluating an expression multiple times and the searching scope is translation unit, ParseDeclsForContext iterates the type info and symbol info multiple times, though only the debug info is parsed once. Using llvm::call_once to make it only iterating and parsing once.

2. When evaluating an expression with identifier whose parent scope is a namespace, ParseDeclsForContext needs to search the entire type info to complete those records whose name is prefixed with the namespace's name and the entire symbol info to to parse functions and non-local variables. Caching parsed namespaces to avoid unnecessary searching.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D136006




More information about the All-commits mailing list