[lldb][NFC] Return a reference from ClangASTContext::getASTContext and remove dead...
authorRaphael Isemann <teemperor@gmail.com>
Sat, 21 Dec 2019 21:40:52 +0000 (22:40 +0100)
committerRaphael Isemann <teemperor@gmail.com>
Sat, 21 Dec 2019 21:51:35 +0000 (22:51 +0100)
commitf9f49d3594bc7584cc5cb96125ca08f2ad97662c
tree9055539f626cc2ce798d895434b6092a9123cf3e
parentbf03e17c570171c7a52117fe63ace89d58f328d5
[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.
18 files changed:
lldb/include/lldb/Symbol/ClangASTContext.h
lldb/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
lldb/source/Plugins/Language/ObjC/NSArray.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
lldb/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
lldb/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
lldb/source/Symbol/ClangASTContext.cpp
lldb/source/Symbol/ClangASTImporter.cpp
lldb/tools/lldb-test/lldb-test.cpp
lldb/unittests/Expression/ClangExpressionDeclMapTest.cpp
lldb/unittests/Symbol/TestClangASTContext.cpp
lldb/unittests/Symbol/TestClangASTImporter.cpp
lldb/unittests/TestingSupport/Symbol/ClangTestUtils.h