Skip to content
Snippets Groups Projects
Commit b9c793ab authored by Vassil Vassilev's avatar Vassil Vassilev
Browse files

Keep the old implementation of the autoloading around until the modules arrive.

git-svn-id: http://root.cern.ch/svn/root/trunk@48403 27541ba8-7e3a-0410-8455-c3a389f83636
parent c823235f
No related branches found
No related tags found
No related merge requests found
......@@ -83,8 +83,40 @@ bool TClingCallbacks::tryAutoloadInternal(LookupResult &R, Scope *S) {
fIsAutoloadingRecursively = true;
bool lookupSuccess = false;
if (TCling__AutoLoadCallback(Name.getAsString().c_str())) {
lookupSuccess = SemaR.LookupName(R, S);
if (getenv("ROOT_MODULES")) {
if (TCling__AutoLoadCallback(Name.getAsString().c_str())) {
lookupSuccess = SemaR.LookupName(R, S);
}
}
else {
// Save state of the PP
ASTContext& C = SemaR.getASTContext();
Preprocessor &PP = SemaR.getPreprocessor();
Preprocessor::CleanupAndRestoreCacheRAII cleanupRAII(PP);
Parser& P = const_cast<Parser&>(m_Interpreter->getParser());
Parser::ParserCurTokRestoreRAII savedCurToken(P);
// After we have saved the token reset the current one to something which
// is safe (semi colon usually means empty decl)
Token& Tok = const_cast<Token&>(P.getCurToken());
Tok.setKind(tok::semi);
bool oldSuppressDiags = SemaR.getDiagnostics().getSuppressAllDiagnostics();
SemaR.getDiagnostics().setSuppressAllDiagnostics();
// We can't PushDeclContext, because we go up and the routine that pops
// the DeclContext assumes that we drill down always.
// We have to be on the global context. At that point we are in a
// wrapper function so the parent context must be the global.
Sema::ContextAndScopeRAII pushedDCAndS(SemaR, C.getTranslationUnitDecl(),
SemaR.TUScope);
if (TCling__AutoLoadCallback(Name.getAsString().c_str())) {
pushedDCAndS.pop();
cleanupRAII.pop();
lookupSuccess = SemaR.LookupName(R, S);
}
SemaR.getDiagnostics().setSuppressAllDiagnostics(oldSuppressDiags);
}
fIsAutoloadingRecursively = false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment