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

Skip autoloading when there are errors.

This fix should be generalized such that upon autoloading we should be able to
check whether cling issued an error and abort the whole autoloading.
parent a79ad19a
No related branches found
No related tags found
No related merge requests found
...@@ -294,7 +294,15 @@ bool TClingCallbacks::tryAutoloadInternal(llvm::StringRef Name, LookupResult &R, ...@@ -294,7 +294,15 @@ bool TClingCallbacks::tryAutoloadInternal(llvm::StringRef Name, LookupResult &R,
// 'neutral' token, this will force clang to create the so called in // 'neutral' token, this will force clang to create the so called in
// C++11 EmptyDecl. It is not a big issue, but still suboptimal. // C++11 EmptyDecl. It is not a big issue, but still suboptimal.
cling::Transaction* T = 0; cling::Transaction* T = 0;
m_Interpreter->declare("namespace " + Name.str() + "{}", &T); // For now rely on a side effect in cling. When there was an error
// all subsequent transaction coming from the autoloading will be
// unsuccessful, because cling is on the error path, before trying
// to recover.
// FIXME: In future that might change so heads up.
cling::Interpreter::CompilationResult CR
= m_Interpreter->declare("namespace " + Name.str() + "{}", &T);
if (CR == cling::Interpreter::kFailure)
return false;
pushedDCAndS.pop(); pushedDCAndS.pop();
cleanupRAII.pop(); cleanupRAII.pop();
// The first decl in T will be EmptyDecl unless the FIXME above gets // The first decl in T will be EmptyDecl unless the FIXME above gets
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment