[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.
diff --git a/lldb/unittests/Expression/ClangExpressionDeclMapTest.cpp b/lldb/unittests/Expression/ClangExpressionDeclMapTest.cpp
index 12ba5fc..299c41f 100644
--- a/lldb/unittests/Expression/ClangExpressionDeclMapTest.cpp
+++ b/lldb/unittests/Expression/ClangExpressionDeclMapTest.cpp
@@ -33,7 +33,7 @@
// persistent declaration and must be inside the scratch AST context.
assert(d);
assert(d->getName().startswith("$"));
- assert(&d->getASTContext() == m_scratch_context->getASTContext());
+ assert(&d->getASTContext() == &m_scratch_context->getASTContext());
m_persistent_decls[d->getName()] = d;
}