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


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

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


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

示例1: printf

int
main ( int argc, char * argv[] )
   {
  // DQ (2/26/2010): Use the last name as the output file name for the generated AST (written back out).
     ROSE_ASSERT(argc > 1);
     if (argc <= 1)
        {
          printf ("Error: This AST file reader requires the name of a binary AST file AND the output filename for the merged binary AST file. \n");
          ROSE_ASSERT(false);
        }

#if 0
  // DQ (2/23/2010): This can't be called since it will generate a SgFunctionTypeTable and the memory pools must be empty.
     printf ("Before reading AST files: SgNode::get_globalFunctionTypeTable() = %p \n",SgNode::get_globalFunctionTypeTable());
  // ROSE_ASSERT(isSgFunctionTypeTable(SgNode::get_globalFunctionTypeTable()) != NULL);
#endif

  // Internal debugging support (e.g. new and delete operators).
  // ROSE_DEBUG = 2;

     int numFiles = argc - 2;
     vector<std::string> fileNames;
     for (int i= 0; i < numFiles; ++i)
        {
       // Detect options starting with "-"; not allowed.
          if (argv[i+1][0] == '-')
             {
               printf ("Skipping %s \n",argv[i+1]);

               printf ("Error can't handle common ROSE options on command line! \n");
               ROSE_ASSERT(false);
             }

          fileNames.push_back(argv[i+1]);
        }

     string outputFileName = argv[argc-1];
     printf ("Number of file = %zu Output filename = %s \n",fileNames.size(),outputFileName.c_str());

  // Reset numFiles to only count valid input files.
  // numFiles = fileNames.size();

#if 0
     printf ("Exiting after test of output name specification. \n");
     ROSE_ASSERT(false);
#endif

#if 0
     cout << "################ In astFileRead.C ############## " << endl;
     cout << "#  Going to read " << numFiles << " files  " << endl;
     cout << "################################################ " << endl;
#endif

  // We should be built into a data structure to hold this sepeaate file by file AST information.
  // Static data structures in ROSE that require special handling when reading more than one AST from a file.
     vector<SgFunctionTypeTable*> functionTableArray;
  // vector<map<int, std::string> > fileidtoname_mapArray;
  // vector<map<std::string, int> > nametofileid_mapArray;

  // This uses the new data structure to hold all the required information for each 
  // AST file so that we can do a merge of the static information of the AST.
     vector<AstFileSpecificInfo*> AstFileInfoArray;

     size_t currentNumberOfNodes  = 0;
     size_t previousNumberOfNodes = 0;

  // DQ (6/5/2010): Trigger debugging output!
  // ROSE_DEBUG = 2;
  // SgProject::set_verbose(3);

  // cout  << endl << "Here we call the AST_FILE_IO :: readASTFromFile ..." << endl;
     SgProject* tmp_previous_globalProject = NULL;
     for (int i= 0; i < numFiles; ++i)
        {
       // cout  << "Here we will read .... " << fileNames[i] << endl;
          AST_FILE_IO :: readASTFromFile ( fileNames[i] + ".binary" );
       // cout  << "Here we just read .... " << fileNames[i] << endl;

          AstData* tmp_ast = AST_FILE_IO::getAst(i);
          SgProject* tmp_globalProject = tmp_ast->getRootOfAst();
          ROSE_ASSERT(tmp_globalProject->get_freepointer() == AST_FileIO::IS_VALID_POINTER());
          if (tmp_previous_globalProject != NULL)
             {
               ROSE_ASSERT(tmp_previous_globalProject->get_freepointer() == AST_FileIO::IS_VALID_POINTER());
             }
          tmp_previous_globalProject = tmp_globalProject;
          

          currentNumberOfNodes = Sg_File_Info::numberOfNodes();

       // printf ("SgProject* tmp_globalProject = %p \n",tmp_globalProject);
          printf ("file #%5d = %20s AST size = %12zu IR nodes  memory usage = %12zu bytes  Sg_File_Info::numberOfNodes() = %12zu \n",i,fileNames[i].c_str(),numberOfNodes(),memoryUsage(),currentNumberOfNodes);

       // TestFreepointerInMemoryPool::test();

#if 0
       // DQ (2/24/2010): This is a significant bottleneck to the performance on large codes since it is n^2 in the size of the AST.
          AstTests::runAllTests(ast->getRootOfAst());
#endif
#if 0
//.........这里部分代码省略.........
开发者ID:Federico2014,项目名称:edg4x-rose,代码行数:101,代码来源:testAstFileRead.C


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