|
| 1 | +diff --git a/include/cling/Interpreter/LookupHelper.h b/include/cling/Interpreter/LookupHelper.h |
| 2 | +index 6e6e2814..cd79b2a6 100644 |
| 3 | +--- a/include/cling/Interpreter/LookupHelper.h |
| 4 | ++++ b/include/cling/Interpreter/LookupHelper.h |
| 5 | +@@ -56,7 +56,7 @@ namespace cling { |
| 6 | + WithDiagnostics |
| 7 | + }; |
| 8 | + private: |
| 9 | +- std::unique_ptr<clang::Parser> m_Parser; |
| 10 | ++ clang::Parser* m_Parser; |
| 11 | + Interpreter* m_Interpreter; // we do not own. |
| 12 | + std::array<const clang::Type*, kNumCachedStrings> m_StringTy = {{}}; |
| 13 | + /// A map containing the hash of the lookup buffer. This allows us to avoid |
| 14 | +diff --git a/lib/Interpreter/Interpreter.cpp b/lib/Interpreter/Interpreter.cpp |
| 15 | +index 6af90108..89ca360b 100644 |
| 16 | +--- a/lib/Interpreter/Interpreter.cpp |
| 17 | ++++ b/lib/Interpreter/Interpreter.cpp |
| 18 | +@@ -265,13 +265,6 @@ namespace cling { |
| 19 | + } |
| 20 | + |
| 21 | + Sema& SemaRef = getSema(); |
| 22 | +- Preprocessor& PP = SemaRef.getPreprocessor(); |
| 23 | +- |
| 24 | +- m_LookupHelper.reset(new LookupHelper(new Parser(PP, SemaRef, |
| 25 | +- /*SkipFunctionBodies*/false, |
| 26 | +- /*isTemp*/true), this)); |
| 27 | +- if (!m_LookupHelper) |
| 28 | +- return; |
| 29 | + |
| 30 | + if (!isInSyntaxOnlyMode() && !m_Opts.CompilerOpts.CUDADevice) { |
| 31 | + m_Executor.reset(new IncrementalExecutor(SemaRef.Diags, *getCI(), |
| 32 | +@@ -317,6 +310,10 @@ namespace cling { |
| 33 | + return; |
| 34 | + } |
| 35 | + |
| 36 | ++ m_LookupHelper.reset(new LookupHelper(m_IncrParser->getParser(), this)); |
| 37 | ++ if (!m_LookupHelper) |
| 38 | ++ return; |
| 39 | ++ |
| 40 | + // When not using C++ modules, we now have a PCH and we can safely setup |
| 41 | + // our callbacks without fearing that they get overwritten by clang code. |
| 42 | + // The modules setup is handled above. |
0 commit comments