[all-commits] [llvm/llvm-project] f9f49d: [lldb][NFC] Return a reference from ClangASTContex...

Raphael Isemann via All-commits all-commits at lists.llvm.org
Sat Dec 21 13:54:51 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f9f49d3594bc7584cc5cb96125ca08f2ad97662c
      https://github.com/llvm/llvm-project/commit/f9f49d3594bc7584cc5cb96125ca08f2ad97662c
  Author: Raphael Isemann <teemperor at gmail.com>
  Date:   2019-12-21 (Sat, 21 Dec 2019)

  Changed paths:
    M lldb/include/lldb/Symbol/ClangASTContext.h
    M lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
    M lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
    M lldb/source/Plugins/Language/ObjC/NSArray.cpp
    M lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
    M lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
    M lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
    M lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
    M lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
    M lldb/source/Symbol/ClangASTContext.cpp
    M lldb/source/Symbol/ClangASTImporter.cpp
    M lldb/tools/lldb-test/lldb-test.cpp
    M lldb/unittests/Expression/ClangExpressionDeclMapTest.cpp
    M lldb/unittests/Symbol/TestClangASTContext.cpp
    M lldb/unittests/Symbol/TestClangASTImporter.cpp
    M lldb/unittests/TestingSupport/Symbol/ClangTestUtils.h

  Log Message:
  -----------
  [lldb][NFC] Return a reference from ClangASTContext::getASTContext and remove dead nullptr checks

ClangASTContext::getASTContext() currently returns a ptr but we have an assert there since a
while that the ASTContext is not a nullptr. This causes that we still have a lot of code
that is doing nullptr checks on the result of getASTContext() which is all unreachable code.

This patch changes the return value to a reference to make it clear this can't be a nullptr
and deletes all the nullptr checks.




More information about the All-commits mailing list