[all-commits] [llvm/llvm-project] f9568a: [lldb][NFC] Make all CompilerDeclContext parameter...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Mon Feb 17 23:59:04 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f9568a95493aea3ea813bd37cb8c084ec4294e38
      https://github.com/llvm/llvm-project/commit/f9568a95493aea3ea813bd37cb8c084ec4294e38
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2020-02-18 (Tue, 18 Feb 2020)

  Changed paths:
    M lldb/include/lldb/Core/Module.h
    M lldb/include/lldb/Symbol/SymbolFile.h
    M lldb/source/API/SBModule.cpp
    M lldb/source/Breakpoint/BreakpointResolverName.cpp
    M lldb/source/Commands/CommandObjectTarget.cpp
    M lldb/source/Core/AddressResolverName.cpp
    M lldb/source/Core/Disassembler.cpp
    M lldb/source/Core/Module.cpp
    M lldb/source/Core/ModuleList.cpp
    M lldb/source/Core/SourceManager.cpp
    M lldb/source/Expression/IRExecutionUnit.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
    M lldb/source/Plugins/InstrumentationRuntime/TSan/InstrumentationRuntimeTSan.cpp
    M lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
    M lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
    M lldb/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
    M lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
    M lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h
    M lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
    M lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
    M lldb/source/Symbol/SymbolFile.cpp
    M lldb/tools/lldb-test/lldb-test.cpp

  Log Message:
  -----------
  [lldb][NFC] Make all CompilerDeclContext parameters references instead of pointers

Summary:
All of our lookup APIs either use `CompilerDeclContext &` or `CompilerDeclContext *` semi-randomly it seems.
This leads to us constantly converting between those two types (and doing nullptr checks when going from
pointer to reference). It also leads to the confusing situation where we have two possible ways to express
that we don't have a CompilerDeclContex: either a nullptr or an invalid CompilerDeclContext (aka a default
constructed CompilerDeclContext).

This moves all APIs to use references and gets rid of all the nullptr checks and conversions.

Reviewers: labath, mib, shafik

Reviewed By: labath, shafik

Subscribers: shafik, arphaman, abidh, JDevlieghere, lldb-commits

Tags: #lldb

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




More information about the All-commits mailing list