[lldb][NFC] Explicitly ask for a ClangASTContext in ClangASTSource
authorRaphael Isemann <teemperor@gmail.com>
Fri, 29 Nov 2019 12:02:41 +0000 (13:02 +0100)
committerRaphael Isemann <teemperor@gmail.com>
Fri, 29 Nov 2019 12:28:55 +0000 (13:28 +0100)
commitbc7f1df6b61a3c8f88f2541ef9ba73f4ee0ee4fe
treed157ca65af2fc94ab2bb154765fa83f7e93a4628
parent363cbcc59040dd337f958fd0fd0584f7c6ebbd63
[lldb][NFC] Explicitly ask for a ClangASTContext in ClangASTSource

ClangASTSource currently takes a clang::ASTContext and keeps that
around, but a lot of LLDB's functionality for doing operations
on a clang::ASTContext is in its ClangASTContext twin class. We
currently constantly recompute the respective ClangASTContext
from the clang::ASTContext while we instead could just pass and
store a ClangASTContext in the ClangASTSource. This also allows
us to get rid of a bunch of unreachable error checking for cases
where recomputation fails for some reason.
lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.h
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
lldb/source/Symbol/ClangASTContext.cpp