File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -182,6 +182,7 @@ void InitTimers();
182182 auto & MultiplexC = cast<MultiplexConsumer>(m_CI.getASTConsumer ());
183183 auto & RobbedCs = ACCESS (MultiplexC, Consumers);
184184 assert (RobbedCs.back ().get () == this && " Clad is not the last consumer" );
185+
185186 const auto & Macros = m_CI.getPreprocessorOpts ().Macros ;
186187 const bool IsCling = llvm::any_of (
187188 Macros, [](const auto & Macro) { return Macro.first == " __CLING__" ; });
@@ -477,6 +478,8 @@ void InitTimers();
477478 }
478479
479480 void CladPlugin::SendToMultiplexer () {
481+ if (!m_Multiplexer)
482+ return ;
480483 for (unsigned i = m_MultiplexerProcessedDelayedCallsIdx;
481484 i < m_DelayedCalls.size (); ++i) {
482485 auto DelayedCall = m_DelayedCalls[i];
@@ -653,7 +656,8 @@ void InitTimers();
653656 FinalizeTranslationUnit ();
654657 SendToMultiplexer ();
655658 }
656- m_Multiplexer->HandleTranslationUnit (C);
659+ if (m_Multiplexer)
660+ m_Multiplexer->HandleTranslationUnit (C);
657661 }
658662
659663 void CladPlugin::PrintStats () {
@@ -712,7 +716,8 @@ void InitTimers();
712716 llvm::errs () << " \n " ;
713717 }
714718
715- m_Multiplexer->PrintStats ();
719+ if (m_Multiplexer)
720+ m_Multiplexer->PrintStats ();
716721 }
717722
718723 } // end namespace plugin
Original file line number Diff line number Diff line change @@ -229,7 +229,7 @@ struct DifferentiationOptions {
229229 void PrintStats () override ;
230230
231231 bool shouldSkipFunctionBody (clang::Decl* D) override {
232- return m_Multiplexer->shouldSkipFunctionBody (D);
232+ return m_Multiplexer ? m_Multiplexer ->shouldSkipFunctionBody (D) : true ;
233233 }
234234
235235 // SemaConsumer
@@ -243,7 +243,8 @@ struct DifferentiationOptions {
243243 void ForgetSema () override {
244244 // ForgetSema is called in the destructor of Sema which is much later
245245 // than where we can process anything. We can't delay this call.
246- m_Multiplexer->ForgetSema ();
246+ if (m_Multiplexer)
247+ m_Multiplexer->ForgetSema ();
247248 }
248249
249250 // FIXME: We should hide ProcessDiffRequest when we implement proper
You can’t perform that action at this time.
0 commit comments