Further delay the lazy initialization of dynamic lookup.

This optimizes the ROOT startup for C++ Modules by avoiding
deserialization of redundant declarations.
This commit is contained in:
Vassil Vassilev 2018-11-17 14:48:29 +01:00 committed by sftnight
parent ce34bd7abf
commit 60a08fd97a

View File

@ -249,13 +249,12 @@ namespace cling {
if (!getCompilationOpts().DynamicScoping)
return Result(D, true);
// Find DynamicLookup specific builtins
if (!m_EvalDecl) {
Initialize();
}
if (FunctionDecl* FD = dyn_cast<FunctionDecl>(D)) {
if (FD->hasBody() && ShouldVisit(FD)) {
// Find DynamicLookup specific builtins
if (!m_EvalDecl)
Initialize();
// Set the decl context, which is needed by Evaluate.
m_CurDeclContext = FD;
ASTNodeInfo NewBody = Visit(D->getBody());