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


C++ SgProject::get_exit_after_parser方法代码示例

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


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

示例1: AstPostProcessing

// DQ (5/22/2005): Added function with better name, since none of the fixes are really
// temporary any more.
void AstPostProcessing (SgNode* node)
   {
  // DQ (7/7/2005): Introduce tracking of performance of ROSE.
     TimingPerformance timer ("AST post-processing:");

     ROSE_ASSERT(node != NULL);

  // printf ("Inside of AstPostProcessing(node = %p) \n",node);

  // DQ (1/31/2014): We want to enforce this, but for now issue a warning if it is not followed.
  // Later I want to change the function's API to onoy take a SgProject.  Note that this is 
  // related to a performance bug that was fixed by Gergo a few years ago.  The fix could be
  // improved by enforcing that this could not be called at the SgFile level of the hierarchy.
     if (isSgProject(node) == NULL)
        {
          printf ("Error: AstPostProcessing should only be called on SgProject (due to repeated memory pool traversals when multiple files are specified on the command line). node = %s \n",node->class_name().c_str());
        }
  // DQ (1/31/2014): This is a problem to enforce this for at least (this test program): 
  //      tests/roseTests/astRewriteTests/testIncludeDirectiveInsertion.C
  // ROSE_ASSERT(isSgProject(node) != NULL);

  // DQ (3/17/2007): This should be empty
     if (SgNode::get_globalMangledNameMap().size() != 0)
        {
          if (SgProject::get_verbose() > 0)
             {
                printf("AstPostProcessing(): found a node with globalMangledNameMap size not equal to 0: SgNode = %s =%s ", node->class_name().c_str(),SageInterface::get_name(node).c_str());
               printf ("SgNode::get_globalMangledNameMap().size() != 0 size = %" PRIuPTR " (clearing mangled name cache) \n",SgNode::get_globalMangledNameMap().size());
             }

          SgNode::clearGlobalMangledNameMap();
        }
     ROSE_ASSERT(SgNode::get_globalMangledNameMap().size() == 0);

     switch (node->variantT())
        {
          case V_SgProject:
             {
               SgProject* project = isSgProject(node);
               ROSE_ASSERT(project != NULL);

            // GB (8/19/2009): Added this call to perform post-processing on
            // the entire project at once. Conversely, commented out the
            // loop iterating over all files because repeated calls to
            // AstPostProcessing are slow due to repeated memory pool
            // traversals of the same nodes over and over again.
            // Only postprocess the AST if it was generated, and not were we just did the parsing.
            // postProcessingSupport(node);

            // printf ("In AstPostProcessing(): project->get_exit_after_parser() = %s \n",project->get_exit_after_parser() ? "true" : "false");
               if (project->get_exit_after_parser() == false)
                  {
                    postProcessingSupport (node);
                  }
#if 0
               SgFilePtrList::iterator fileListIterator;
               for (fileListIterator = project->get_fileList().begin(); fileListIterator != project->get_fileList().end(); fileListIterator++)
                  {
                 // iterate through the list of current files
                    AstPostProcessing(*fileListIterator);
                  }
#endif

            // printf ("SgProject support not implemented in AstPostProcessing \n");
            // ROSE_ASSERT(false);
               break;
             }

          case V_SgDirectory:
             {
               SgDirectory* directory = isSgDirectory(node);
               ROSE_ASSERT(directory != NULL);

               printf ("SgDirectory support not implemented in AstPostProcessing \n");
               ROSE_ASSERT(false);
               break;
             }

          case V_SgFile:
          case V_SgSourceFile:
             {
               SgFile* file = isSgFile(node);
               ROSE_ASSERT(file != NULL);

            // Only postprocess the AST if it was generated, and not were we just did the parsing.
               if (file->get_exit_after_parser() == false)
                  {
                    postProcessingSupport (node);
                  }
               
               break;
             }

       // Test for a binary executable, object file, etc.
          case V_SgBinaryComposite:
             {
               SgBinaryComposite* file = isSgBinaryComposite(node);
               ROSE_ASSERT(file != NULL);
//.........这里部分代码省略.........
开发者ID:brushington,项目名称:rose-develop,代码行数:101,代码来源:astPostProcessing.C


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