当前位置: 首页>>代码示例>>C++>>正文


C++ ASTReader::setDeserializationListener方法代码示例

本文整理汇总了C++中ASTReader::setDeserializationListener方法的典型用法代码示例。如果您正苦于以下问题:C++ ASTReader::setDeserializationListener方法的具体用法?C++ ASTReader::setDeserializationListener怎么用?C++ ASTReader::setDeserializationListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ASTReader的用法示例。


在下文中一共展示了ASTReader::setDeserializationListener方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: InterpreterExternalSemaSource

  InterpreterCallbacks::InterpreterCallbacks(Interpreter* interp,
                             bool enableExternalSemaSourceCallbacks/* = false*/,
                        bool enableDeserializationListenerCallbacks/* = false*/,
                                             bool enablePPCallbacks/* = false*/)
    : m_Interpreter(interp), m_IsRuntime(false) {
    
    if (enableExternalSemaSourceCallbacks) {
      m_ExternalSemaSource.reset(new InterpreterExternalSemaSource(this));
      m_Interpreter->getSema().addExternalSource(m_ExternalSemaSource.get());
    }

    ASTReader* Reader = m_Interpreter->getCI()->getModuleManager();
    if (enableDeserializationListenerCallbacks && Reader) {
      // FIXME: need to create a multiplexer if a DeserializationListener is
      // alreday present.
      m_DeserializationListener.
        reset(new InterpreterDeserializationListener(this));
      Reader->setDeserializationListener(m_DeserializationListener.get());
    }

    if (enablePPCallbacks) {
      m_PPCallbacks.reset(new InterpreterPPCallbacks(this));
      Preprocessor& PP = m_Interpreter->getCI()->getPreprocessor();
      PP.addPPCallbacks(m_PPCallbacks.get());
    }
  }
开发者ID:alexschlueter,项目名称:cern-root,代码行数:26,代码来源:InterpreterCallbacks.cpp

示例2:

 InterpreterCallbacks::InterpreterCallbacks(Interpreter* interp,
                                           InterpreterExternalSemaSource* IESS,
                                       InterpreterDeserializationListener* IDL,
                                            InterpreterPPCallbacks* IPPC)
   : m_Interpreter(interp),  m_ExternalSemaSource(IESS),
     m_DeserializationListener(IDL), m_IsRuntime(false) {
   if (IESS)
     m_Interpreter->getSema().addExternalSource(m_ExternalSemaSource.get());
   ASTReader* Reader = m_Interpreter->getCI()->getModuleManager();
   if (IDL && Reader)
     Reader->setDeserializationListener(IDL);
   if (IPPC)
     m_Interpreter->getCI()->getPreprocessor().addPPCallbacks(IPPC);
 }
开发者ID:alexschlueter,项目名称:cern-root,代码行数:14,代码来源:InterpreterCallbacks.cpp

示例3: InterpreterExternalSemaSource

  InterpreterCallbacks::InterpreterCallbacks(Interpreter* interp,
                             bool enableExternalSemaSourceCallbacks/* = false*/,
                        bool enableDeserializationListenerCallbacks/* = false*/,
                                             bool enablePPCallbacks/* = false*/)
    : m_Interpreter(interp), m_ExternalSemaSource(0), m_PPCallbacks(0),
      m_IsRuntime(false) {
    Sema& SemaRef = interp->getSema();
    ASTReader* Reader = m_Interpreter->getCI()->getModuleManager().get();
    ExternalSemaSource* externalSemaSrc = SemaRef.getExternalSource();
    if (enableExternalSemaSourceCallbacks)
      if (!externalSemaSrc || externalSemaSrc == Reader) {
        // If the ExternalSemaSource is the PCH reader we still need to insert
        // our listener.
        m_ExternalSemaSource = new InterpreterExternalSemaSource(this);
        m_ExternalSemaSource->InitializeSema(SemaRef);
        m_Interpreter->getSema().addExternalSource(m_ExternalSemaSource);

        // FIXME: We should add a multiplexer in the ASTContext, too.
        llvm::IntrusiveRefCntPtr<ExternalASTSource>
          astContextExternalSource(SemaRef.getExternalSource());
        clang::ASTContext& Ctx = SemaRef.getASTContext();
        // FIXME: This is a gross hack. We must make multiplexer in the
        // astcontext or a derived class that extends what we need.
        Ctx.ExternalSource.resetWithoutRelease();//FIXME: make sure we delete it.
        Ctx.setExternalSource(astContextExternalSource);
    }

    if (enableDeserializationListenerCallbacks && Reader) {
      // FIXME: need to create a multiplexer if a DeserializationListener is
      // alreday present.
      m_DeserializationListener.
        reset(new InterpreterDeserializationListener(this));
      Reader->setDeserializationListener(m_DeserializationListener.get());
    }

    if (enablePPCallbacks) {
      Preprocessor& PP = m_Interpreter->getCI()->getPreprocessor();
      m_PPCallbacks = new InterpreterPPCallbacks(this);
      PP.addPPCallbacks(std::unique_ptr<InterpreterPPCallbacks>(m_PPCallbacks));
    }
  }
开发者ID:CristinaCristescu,项目名称:root,代码行数:41,代码来源:InterpreterCallbacks.cpp


注:本文中的ASTReader::setDeserializationListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。