Ejemplo n.º 1
0
/******************************************
 * Traversal over all functions
 * this needs to be improved... for correctness, the traversal must 
 * be according to controlflow (otherwise global variables are incorrect)
 *****************************************/
bool  DefUseAnalysis::start_traversal_of_functions() {
  if (DEBUG_MODE) 
    cout << "START: Traversal over Functions" << endl;

  nrOfNodesVisited = 0;
  dfaFunctions.clear();

  // Traverse through each FunctionDefinition and check for DefUse
  Rose_STL_Container<SgNode*> functions = NodeQuery::querySubTree(project, V_SgFunctionDefinition); 
  DefUseAnalysisPF* defuse_perfunc = new DefUseAnalysisPF(DEBUG_MODE, this);
  bool abortme=false;
  for (Rose_STL_Container<SgNode*>::const_iterator i = functions.begin(); i != functions.end(); ++i) {
    SgFunctionDefinition* proc = isSgFunctionDefinition(*i);
    if (DEBUG_MODE) 
      cout << "\t function Def@"<< proc->get_file_info()->get_filename() <<":" << proc->get_file_info()->get_line() << endl;
    FilteredCFGNode <IsDFAFilter> rem_source = defuse_perfunc->run(proc,abortme);
    nrOfNodesVisited += defuse_perfunc->getNumberOfNodesVisited();
    //cout << nrOfNodesVisited << " ......... function " << proc->get_declaration()->get_name().str() << endl; 
    if (rem_source.getNode()!=NULL)
      dfaFunctions.push_back(rem_source);
  }
  delete defuse_perfunc;

  if (DEBUG_MODE) {
    dfaToDOT();
  }

  if (DEBUG_MODE) 
    cout << "FINISH: Traversal over Functions" << endl;
  return abortme;  
}
Ejemplo n.º 2
0
int main(int argc, char *argv[]) 
{
  SgProject* sageProject = frontend(argc,argv);
  AstTests::runAllTests(sageProject);

  Rose_STL_Container <SgNode*> functions = NodeQuery::querySubTree(sageProject, V_SgFunctionDefinition);

  for (Rose_STL_Container <SgNode*>::const_iterator i = functions.begin(); i != functions.end(); ++i) 
  {
    SgFunctionDefinition* proc = isSgFunctionDefinition(*i);
    ROSE_ASSERT (proc);
    string file_name = StringUtility::stripPathFromFileName(proc->get_file_info()->get_filename());
    string file_func_name= file_name+ "_"+proc->get_mangled_name().getString();
    
    string full_output = file_func_name +"_scfg.dot";
    // Full CFG graph
    StaticCFG::CFG cfg(proc);
    cfg.buildFullCFG();
    cfg.cfgToDot(proc, full_output);


#if 0 // not ready
    string simple_output = file_func_name +"_simple_vcfg.dot";
    std::ofstream simplegraph(simple_output.c_str());
    // Simplified CFG suitable for most analyses
    // This will cause assertion failure
    //StaticCFG::cfgToDot(simplegraph, proc->get_declaration()->get_name(), StaticCFG::makeInterestingCfg(proc)); 
    // This will generate identical graph as cfgToDotForDebugging ()
    StaticCFG::cfgToDot(simplegraph, proc->get_declaration()->get_name(), proc->cfgForBeginning());
#endif    
  }
  return 0;
}
int main(int argc, char *argv[]) {
  
  struct timeval t1, t2;
  SgProject* proj = frontend(argc,argv);
  ROSE_ASSERT (proj != NULL); 

  SgFunctionDeclaration* mainDefDecl = SageInterface::findMain(proj);

  SgFunctionDefinition* mainDef = mainDefDecl->get_definition(); 
   visitorTraversal* vis = new visitorTraversal();
    StaticCFG::CFG cfg(mainDef);
   //cfg.buildFullCFG();
    stringstream ss;
    string fileName= StringUtility::stripPathFromFileName(mainDef->get_file_info()->get_filenameString());
    string dotFileName1=fileName+"."+ mainDef->get_declaration()->get_name() +".dot";

    cfgToDot(mainDef,dotFileName1); 
    //cfg->buildFullCFG();
    SgIncidenceDirectedGraph* g = new SgIncidenceDirectedGraph();
    g = cfg.getGraph();
    myGraph* mg = new myGraph();
    mg = instantiateGraph(g, cfg);
    vis->tltnodes = 0;
    vis->paths = 0;
    //vis->firstPrepGraph(constcfg);
    t1 = getCPUTime();
    vis->constructPathAnalyzer(mg, true, 0, 0, true);
    t2 = getCPUTime();
    std::cout << "took: " << timeDifference(t2, t1) << std::endl;
    //cfg.clearNodesAndEdges();
    std::cout << "finished" << std::endl;
    std::cout << "tltnodes: " << vis->tltnodes << " paths: " << vis->paths << std::endl;
    delete vis;
}
Ejemplo n.º 4
0
int main(int argc, char *argv[]) 
{
  // Build the AST used by ROSE
  SgProject* sageProject = frontend(argc,argv);

  // Process all function definition bodies for static control flow graph generation
  Rose_STL_Container<SgNode*> functions = NodeQuery::querySubTree(sageProject, V_SgFunctionDefinition);
  for (Rose_STL_Container<SgNode*>::const_iterator i = functions.begin(); i != functions.end(); ++i) 
  {
    SgFunctionDefinition* proc = isSgFunctionDefinition(*i);
    ROSE_ASSERT (proc != NULL); 
    string fileName= StringUtility::stripPathFromFileName(proc->get_file_info()->get_filenameString());
    string dotFileName1=fileName+"."+ proc->get_declaration()->get_name() +".debug.dot";
    string dotFileName2=fileName+"."+ proc->get_declaration()->get_name() +".interesting.dot";

    StaticCFG::CFG cfg(proc);

    // Dump out the full CFG, including bookkeeping nodes
    cfg.buildFullCFG();
    cfg.cfgToDot(proc, dotFileName1);

    // Dump out only those nodes which are "interesting" for analyses
    cfg.buildFilteredCFG();
    cfg.cfgToDot(proc, dotFileName2);
  }

  return 0;
}
Ejemplo n.º 5
0
 void IntraAnalysisResultsToDotFiles::runAnalysis()
 {
   set<FunctionState*> allFuncs = FunctionState::getAllDefinedFuncs();
   // Go through functions one by one, call an intra-procedural analysis on each of them
   // iterate over all functions with bodies
   for(set<FunctionState*>::iterator it=allFuncs.begin(); it!=allFuncs.end(); it++)
   {
 
     FunctionState* fState = *it;
     // compose the output file name as filename_mangled_function_name.dot
     Function *func = & (fState->getFunc());
     assert (func != NULL);
     SgFunctionDefinition* proc = func->get_definition();
     string file_name = StringUtility::stripPathFromFileName(proc->get_file_info()->get_filename());
     string file_func_name= file_name+ "_"+proc->get_mangled_name().getString();
 
     string full_output = file_func_name +"_cfg.dot";
     std::ofstream ostr(full_output.c_str());
 
     ostr << "digraph " << "mygraph" << " {\n";
     analysisStatesToDOT* dot_analysis = dynamic_cast <analysisStatesToDOT*> ( intraAnalysis);
     assert (dot_analysis != NULL);
     dot_analysis->ostr = &ostr;
     dot_analysis->runAnalysis(fState->func, &(fState->state));
     ostr << "}\n";
   }
 
 }
Ejemplo n.º 6
0
void findCandidateFunctionDefinitions (SgProject* project, std::vector<SgFunctionDefinition* >& candidateFuncDefs)
{
  ROSE_ASSERT (project != NULL);
  // For each source file in the project
  SgFilePtrList & ptr_list = project->get_fileList();
  for (SgFilePtrList::iterator iter = ptr_list.begin(); iter!=ptr_list.end();
      iter++)
  {
    SgFile* sageFile = (*iter);
    SgSourceFile * sfile = isSgSourceFile(sageFile);
    ROSE_ASSERT(sfile);
//    SgGlobal *root = sfile->get_globalScope();

    if (enable_debug)
      cout<<"Processing each function within the files "<< sfile->get_file_info()->get_filename() <<endl;
    //      cout<<"\t loop at:"<< cur_loop->get_file_info()->get_line() <<endl;

    // This is wrong, many functions in question are not top level declarations!!
    //SgDeclarationStatementPtrList& declList = root->get_declarations ();
    //VariantVector vv;
    Rose_STL_Container<SgNode*> defList = NodeQuery::querySubTree(sfile, V_SgFunctionDefinition); 
//    bool hasOpenMP= false; // flag to indicate if omp.h is needed in this file

    //For each function body in the scope
    //for (SgDeclarationStatementPtrList::iterator p = declList.begin(); p != declList.end(); ++p) 
    for (Rose_STL_Container<SgNode*>::iterator p = defList.begin(); p != defList.end(); ++p) 
    {
      SgFunctionDefinition *defn = isSgFunctionDefinition(*p);
      ROSE_ASSERT (defn != NULL);

      SgFunctionDeclaration *func = defn->get_declaration();
      ROSE_ASSERT (func != NULL);

      if (enable_debug)
        cout<<"\t considering function "<< func->get_name() << " at "<< func->get_file_info()->get_line()<<endl;
      //ignore functions in system headers, Can keep them to test robustness
      if (defn->get_file_info()->get_filename()!=sageFile->get_file_info()->get_filename())
      {
        if (enable_debug)
          cout<<"\t Skipped since the function's associated file name does not match current file being considered. Mostly from a header. "<<endl;
        continue;
      }
      candidateFuncDefs.push_back(defn);
    } // end for def list
  } // end for file list
}
Ejemplo n.º 7
0
/*
 * Main Function
 */
int main(int argc, char * argv[]) {
	// Build the AST used by ROSE
	SgProject* sageProject = frontend(argc, argv);

	// For each source file in the project
	SgFilePtrList & ptr_list = sageProject->get_fileList();
	for (SgFilePtrList::iterator iter = ptr_list.begin(); iter
			!= ptr_list.end(); iter++) {
		SgFile* sageFile = (*iter);
		SgSourceFile * sfile = isSgSourceFile(sageFile);
		ROSE_ASSERT(sfile);
		SgGlobal *root = sfile->get_globalScope();
		SgDeclarationStatementPtrList& declList = root->get_declarations();

		// Insert header file
		insertHeader(sfile);

		//For each function body in the scope
		for (SgDeclarationStatementPtrList::iterator p = declList.begin(); p
				!= declList.end(); ++p) {
			SgFunctionDeclaration *func = isSgFunctionDeclaration(*p);
			if (func == 0)
				continue;
			SgFunctionDefinition *defn = func->get_definition();
			if (defn == 0)
				continue;
			//ignore functions in system headers, Can keep them to test robustness
			if (defn->get_file_info()->get_filename()
					!= sageFile->get_file_info()->get_filename())
				continue;
			SgBasicBlock *body = defn->get_body();
			ROSE_ASSERT(body);

			vector<SgForStatement*> loops = querySubTree<SgForStatement> (defn,
					V_SgForStatement);
			if (loops.size() == 0)
				continue;

			visitLoops(loops);
		}

		// Generate source code from AST and call the vendor's compiler
		return backend(sageProject);
	}

}
Ejemplo n.º 8
0
int main(int argc, char *argv[]) 
{
  // Build the AST used by ROSE
  SgProject* proj = frontend(argc,argv);
  ROSE_ASSERT (proj != NULL); 

  SgFunctionDeclaration* mainDefDecl = SageInterface::findMain(proj);
  ROSE_ASSERT (mainDefDecl != NULL); 

  SgFunctionDefinition* mainDef = mainDefDecl->get_definition();
  ROSE_ASSERT (mainDef != NULL); 

  string fileName= StringUtility::stripPathFromFileName(mainDef->get_file_info()->get_filenameString());
  string dotFileName1=fileName+"."+ mainDef->get_declaration()->get_name() +".IPCFG.dot";

  StaticCFG::InterproceduralCFG cfg(mainDef);

  // Dump out the full CFG, including bookkeeping nodes
  cfg.cfgToDot(mainDef, dotFileName1);

  return 0;
}
Ejemplo n.º 9
0
int main( int argc, char * argv[] )
   {
  // Build the AST used by ROSE
     SgProject* project = frontend(argc,argv);
     ROSE_ASSERT(project != NULL);

  // Build a list of functions within the AST and find all access functions 
  // (function name starts with "get_" or "set_")

  // Build list using a query of the whole AST
     Rose_STL_Container<SgNode*> functionDefinitionList = NodeQuery::querySubTree (project,V_SgFunctionDefinition);

  // Build list using nested Queries (operating on return result of previous query)
  //   Rose_STL_Container<SgNode*> accessFunctionsList;
  //   accessFunctionsList = NodeQuery::queryNodeList (functionDeclarationList,&querySolverAccessFunctions);
  //   printFunctionDeclarationList(accessFunctionsList);

  // Alternative form of same query building the list using a query of the whole AST
   //  accessFunctionsList = NodeQuery::querySubTree (project,&querySolverAccessFunctions);
   //  printFunctionDeclarationList(accessFunctionsList);
int counter = 0;
for (Rose_STL_Container<SgNode*>::iterator i = functionDefinitionList.begin(); i != functionDefinitionList.end(); i++) {
   SgFunctionDefinition* fnc = isSgFunctionDefinition(*i);
  stringstream ss; 
  SgFunctionDeclaration* functionDeclaration = fnc->get_declaration();
  string fileName= functionDeclaration->get_name().str();//StringUtility::stripPathFromFileName(mainDef->get_file_info()->get_filenameString());
    string dotFileName1;
ss << fileName << "." << counter << ".dot";
    counter++;
    dotFileName1 = ss.str();
    //SgFunctionDefinition* fnc = functionDeclaration->get_definition();
    if (fnc != NULL) {
    StaticCFG::CFG* cfg = new StaticCFG::CFG(fnc);
    SgIncidenceDirectedGraph* g = new SgIncidenceDirectedGraph();
     visitorTraversal* vis = new visitorTraversal();
    g = cfg->getGraph();
    myGraph* mg = new myGraph();
    mg = instantiateGraph(g, (*cfg));
    vis->tltnodes = 0;
    vis->paths = 0;
 std::cout << dotFileName1 << std::endl;
 cfgToDot(fnc,dotFileName1);
    //vis->firstPrepGraph(constcfg);
    //t1 = getCPUTime();
    vis->constructPathAnalyzer(mg, true, 0, 0, true);
    
    //t2 = getCPUTim
    std::cout << "function: " << fileName << std::endl;
    std::cout << "paths: " << vis->paths << std::endl;
    delete vis;
    delete cfg;
    delete g;
    delete mg;
    //std::cout << "took: " << timeDifference(t2, t1) << std::endl;
    }
    }
   SgProject* proj = project; 
   SgFunctionDeclaration* mainDefDecl = SageInterface::findMain(proj);
   if (mainDefDecl != NULL) {
  SgFunctionDefinition* mainDef = mainDefDecl->get_definition();
   visitorTraversal* vis = new visitorTraversal();
    StaticCFG::CFG cfg(mainDef);
   //cfg.buildFullCFG();
    stringstream ss;
    string fileName= StringUtility::stripPathFromFileName(mainDef->get_file_info()->get_filenameString());
    string dotFileName1=fileName+"."+ mainDef->get_declaration()->get_name() +".dot";

    cfgToDot(mainDef,dotFileName1);
    //cfg->buildFullCFG();
    SgIncidenceDirectedGraph* g = new SgIncidenceDirectedGraph();
    g = cfg.getGraph();
    myGraph* mg = new myGraph();
    mg = instantiateGraph(g, cfg);
    vis->tltnodes = 0;
    vis->paths = 0;
    //vis->firstPrepGraph(constcfg);
    vis->constructPathAnalyzer(mg, true, 0, 0, true);
    //std::cout << "took: " << timeDifference(t2, t1) << std::endl;
    //cfg.clearNodesAndEdges();
    std::cout << "finished" << std::endl;
    std::cout << "tltnodes: " << vis->tltnodes << " paths: " << vis->paths << std::endl;
    //std::cout << "ipaths: " << ipaths << std::endl;
    delete vis;

    }

// Another way to query for collections of IR nodes
     VariantVector vv1 = V_SgClassDefinition;
     std::cout << "Number of class definitions in the memory pool is: " << NodeQuery::queryMemoryPool(vv1).size() << std::endl;

  // Another way to query for collections of multiple IR nodes.
  // VariantVector(V_SgType) is internally expanded to all IR nodes derived from SgType.
     VariantVector vv2 = VariantVector(V_SgClassDefinition) + VariantVector(V_SgType);
     std::cout << "Number of class definitions AND types in the memory pool is: " << NodeQuery::queryMemoryPool(vv2).size() << std::endl;

  // Note: Show composition of AST queries

     return 0;
   }
Ejemplo n.º 10
0
int main( int argc, char *argv[] )
{
	if( argc < 2 ) {
		cout << "./amos: no input files                               " << endl;
		cout << "                                                     " << endl;
		cout << "Hi, this is Amos!                                    " << endl;
		cout << "It's my pleasure to serve you.                       " << endl;
		cout << "                                                     " << endl;
		cout << "Please type option '--help' to see guide             " << endl;
		cout << "                                                     " << endl;

		return 0;
	}

	cout << "*************************************************************" << endl;
	cout << "**                                                         **" << endl;
	cout << "**      Welcome to use OpenMP task validation system!      **" << endl;
	cout << "**                                                         **" << endl;
	cout << "**                                      editor: Amos Wang  **" << endl;
	cout << "*************************************************************\n" << endl;

	vector<string> argvList( argv, argv+argc );
	vector<string> argvList0( argv, argv+argc ); // keep original argv and argc

	command_processing( argvList );

	if( !parse_OmpTask( argvList ) ) {

		cout << "\nAmos says: I am sorry that I could not find any OpenMP task !" << endl << endl;
		return 0;
	}

	// for time counter
	long t_start;
	long t_end;
	double time_program = 0.0;

	t_start = usecs(); 
	// for time counter

	transform_Task2Loop( argvList );

	SgProject *project = frontend(argvList);
	ROSE_ASSERT( project != NULL );

#if 1
	VariantVector vv( V_SgForStatement );
	Rose_STL_Container<SgNode*> loops = NodeQuery::queryMemoryPool(vv);
	for( Rose_STL_Container<SgNode*>::iterator iter = loops.begin(); iter!= loops.end(); iter++ ) {
		SgForStatement* cur_loop = isSgForStatement(*iter);
		ROSE_ASSERT(cur_loop);
		SageInterface::normalizeForLoopInitDeclaration(cur_loop);
	}
#endif

	//initialize_analysis( project, false );
	initialize_analysis( project, false );

	//For each source file in the project
	SgFilePtrList &ptr_list = project->get_fileList();

	cout << "\n**** Amos' validation system running ****\n" << endl;

	for( SgFilePtrList::iterator iter = ptr_list.begin(); iter != ptr_list.end(); iter++ ) {

		cout << "temp source code: " << (*iter)->get_file_info()->get_filename() << endl << endl;
		SgFile *sageFile = (*iter);
		SgSourceFile *sfile = isSgSourceFile(sageFile);
		ROSE_ASSERT(sfile);
		SgGlobal *root = sfile->get_globalScope();
		SgDeclarationStatementPtrList& declList = root->get_declarations ();

		//cout << "Check point 2" << endl;
		//For each function body in the scope
		for( SgDeclarationStatementPtrList::iterator p = declList.begin(); p != declList.end(); ++p ) 
		{
			SgFunctionDeclaration *func = isSgFunctionDeclaration(*p);
			if ( func == 0 )  continue;

			SgFunctionDefinition *defn = func->get_definition();
			if ( defn == 0 )  continue;

			//ignore functions in system headers, Can keep them to test robustness
			if ( defn->get_file_info()->get_filename() != sageFile->get_file_info()->get_filename() )
				continue;

			SgBasicBlock *body = defn->get_body();

			// For each loop
			Rose_STL_Container<SgNode*> loops = NodeQuery::querySubTree( defn, V_SgForStatement ); 

			if( loops.size() == 0 ) continue;

			// X. Replace operators with their equivalent counterparts defined 
			// in "inline" annotations
			AstInterfaceImpl faImpl_1( body );
			CPPAstInterface fa_body( &faImpl_1 );
			OperatorInlineRewrite()( fa_body, AstNodePtrImpl(body) );

			// Pass annotations to arrayInterface and use them to collect 
			// alias info. function info etc.  
			ArrayAnnotation* annot = ArrayAnnotation::get_inst(); 
			ArrayInterface array_interface( *annot );
			array_interface.initialize( fa_body, AstNodePtrImpl(defn) );
			array_interface.observe( fa_body );

			// X. Loop normalization for all loops within body
			NormalizeForLoop(fa_body, AstNodePtrImpl(body));

			//cout << "Check point 3" << endl;
			for ( Rose_STL_Container<SgNode*>::iterator iter = loops.begin(); iter!= loops.end(); iter++ ) {

				SgNode* current_loop = *iter;
				SgInitializedName* invarname = getLoopInvariant( current_loop );

				if( invarname != NULL ) {

					if( invarname->get_name().getString().compare("__Amos_Wang__") == 0 ) {

						//cout << "It's __Amos_Wang__." << endl;
						//replace "for(__Amos_Wang__ = 0;__Amos_Wang__ <= 1 - 1;__Amos_Wang__ += 1)" 
						//to "#pragma omp task"
						std::string strtemp = current_loop->unparseToString();
						strtemp.replace( 0, 64, "#pragma omp task" );

						cout << "task position at: " << current_loop->get_file_info()->get_line()
							<< ", " << current_loop->get_file_info()->get_col() << endl;

						cout << "context: " << strtemp.c_str() << endl; 

						TaskValidation( current_loop );

						cout << "TaskValidation done...\n" << endl;
					}
					else continue;

				}

			}// end for loops

		}//end loop for each function body
		cout << "--------------------------------------------" << endl;

	}//end loop for each source file

	release_analysis();

	//generateDOT( *project );
	backend( project );

	//generate final file with correct directive
	amos_filter( argvList0 );

	// for time counter
	t_end = usecs();
	time_program = ((double)(t_end - t_start))/1000000;
	cout << "analysis time: " << time_program << " sec" << endl;
	//

	cout << endl << "***** Thank you for using Amos' compiler ! *****\n" << endl;

	return 0;
}
Ejemplo n.º 11
0
int main(int argc, char *argv[]) {
SgProject* proj = frontend(argc,argv);
ROSE_ASSERT (proj != NULL);
SgFunctionDeclaration* mainDefDecl = SageInterface::findMain(proj);
SgFunctionDefinition* mainDef = mainDefDecl->get_definition();
visitorTraversal* vis = new visitorTraversal();
StaticCFG::CFG cfg(mainDef);
stringstream ss;
string fileName= StringUtility::stripPathFromFileName(mainDef->get_file_info()->get_filenameString());
string dotFileName1=fileName+"."+ mainDef->get_declaration()->get_name() +".dot";
cfgToDot(mainDef,dotFileName1);
SgIncidenceDirectedGraph* g = new SgIncidenceDirectedGraph();
g = cfg.getGraph();
myGraph* mg = new myGraph();
mg = instantiateGraph(g, cfg);
std::set<std::vector<string> > sssv;
std::vector<string> sss;
sss.push_back("Start(::main)<SgFunctionDefinition> @line=1 :idx=0");
sss.push_back("main_parameter_list_<SgFunctionParameterList> @line=1 :idx=0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @line=1 :idx=1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @line=1 :idx=2");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=0");
sss.push_back("_variable_declaration_k<SgVariableDeclaration> @line=2 :idx=0");
sss.push_back("initialized_name_k<SgInitializedName> k :idx=0");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=2 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=2 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=2 :idx=1");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=2 :idx=1");
sss.push_back("initialized_name_k<SgInitializedName> k :idx=1");
sss.push_back("_variable_declaration_k<SgVariableDeclaration> @line=2 :idx=1");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=0");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=3 :idx=0");
sss.push_back("_variable_declaration_i<SgVariableDeclaration> @line=3 :idx=0");
sss.push_back("initialized_name_i<SgInitializedName> i :idx=0");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=3 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=3 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=3 :idx=1");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=3 :idx=1");
sss.push_back("initialized_name_i<SgInitializedName> i :idx=1");
sss.push_back("_variable_declaration_i<SgVariableDeclaration> @line=3 :idx=1");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=2");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=4");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=2");
sss.push_back("SgReturnStmt<SgReturnStmt> @line=13 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=13 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=13 :idx=1");
sss.push_back("SgReturnStmt<SgReturnStmt> @line=13 :idx=1");
sss.push_back("End(::main)<SgFunctionDefinition> @line=1 :idx=3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @line=1 :idx=0");
sss.push_back("main_parameter_list_<SgFunctionParameterList> @line=1 :idx=0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @line=1 :idx=1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @line=1 :idx=2");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=0");
sss.push_back("_variable_declaration_k<SgVariableDeclaration> @line=2 :idx=0");
sss.push_back("initialized_name_k<SgInitializedName> k :idx=0");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=2 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=2 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=2 :idx=1");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=2 :idx=1");
sss.push_back("initialized_name_k<SgInitializedName> k :idx=1");
sss.push_back("_variable_declaration_k<SgVariableDeclaration> @line=2 :idx=1");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=0");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=3 :idx=0");
sss.push_back("_variable_declaration_i<SgVariableDeclaration> @line=3 :idx=0");
sss.push_back("initialized_name_i<SgInitializedName> i :idx=0");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=3 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=3 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=3 :idx=1");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=3 :idx=1");
sss.push_back("initialized_name_i<SgInitializedName> i :idx=1");
sss.push_back("_variable_declaration_i<SgVariableDeclaration> @line=3 :idx=1");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=2");
sss.push_back("0x2b916c912188<SgBasicBlock> @line=3 :idx=0");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=0");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=4 :idx=0");
sss.push_back("_variable_declaration_j<SgVariableDeclaration> @line=4 :idx=0");
sss.push_back("initialized_name_j<SgInitializedName> j :idx=0");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=4 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=4 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=4 :idx=1");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=4 :idx=1");
sss.push_back("initialized_name_j<SgInitializedName> j :idx=1");
sss.push_back("_variable_declaration_j<SgVariableDeclaration> @line=4 :idx=1");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=0");
sss.push_back("var_ref_of_j<SgVarRefExp> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=2");
sss.push_back("0x2b916c912300<SgBasicBlock> @line=4 :idx=0");
sss.push_back("0x2b916cb41010<SgIfStmt> @line=5 :idx=0");
sss.push_back("SgExprStatement<SgExprStatement> @line=5 :idx=0");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=5 :idx=0");
sss.push_back("SgModOp_undef_name<SgModOp> @line=5 :idx=0");
sss.push_back("var_ref_of_k<SgVarRefExp> @line=5 :idx=0");
sss.push_back("SgModOp_undef_name<SgModOp> @line=5 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=5 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=5 :idx=1");
sss.push_back("SgModOp_undef_name<SgModOp> @line=5 :idx=2");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=5 :idx=1");
sss.push_back("integer_value_exp_0<SgIntVal> @line=5 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=5 :idx=1");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=5 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=5 :idx=1");
sss.push_back("0x2b916cb41010<SgIfStmt> @line=5 :idx=1");
sss.push_back("0x2b916c912478<SgBasicBlock> @line=5 :idx=0");
sss.push_back("SgExprStatement<SgExprStatement> @line=6 :idx=0");
sss.push_back("SgAssignOp_undef_name<SgAssignOp> @line=6 :idx=0");
sss.push_back("var_ref_of_k<SgVarRefExp> @line=6 :idx=0");
sss.push_back("SgAssignOp_undef_name<SgAssignOp> @line=6 :idx=1");
sss.push_back("SgAddOp_undef_name<SgAddOp> @line=6 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=6 :idx=0");
sss.push_back("SgAddOp_undef_name<SgAddOp> @line=6 :idx=1");
sss.push_back("var_ref_of_j<SgVarRefExp> @line=6 :idx=0");
sss.push_back("SgAddOp_undef_name<SgAddOp> @line=6 :idx=2");
sss.push_back("SgAssignOp_undef_name<SgAssignOp> @line=6 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=6 :idx=1");
sss.push_back("0x2b916c912478<SgBasicBlock> @line=5 :idx=1");
sss.push_back("0x2b916cb41010<SgIfStmt> @line=5 :idx=2");
sss.push_back("0x2b916c912300<SgBasicBlock> @line=4 :idx=1");
sss.push_back("0x2b916cb41180<SgIfStmt> @line=8 :idx=0");
sss.push_back("SgExprStatement<SgExprStatement> @line=8 :idx=0");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=8 :idx=0");
sss.push_back("SgSubtractOp_undef_name<SgSubtractOp> @line=8 :idx=0");
sss.push_back("var_ref_of_k<SgVarRefExp> @line=8 :idx=0");
sss.push_back("SgSubtractOp_undef_name<SgSubtractOp> @line=8 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=8 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=8 :idx=1");
sss.push_back("SgSubtractOp_undef_name<SgSubtractOp> @line=8 :idx=2");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=8 :idx=1");
sss.push_back("integer_value_exp_0<SgIntVal> @line=8 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=8 :idx=1");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=8 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=8 :idx=1");
sss.push_back("0x2b916cb41180<SgIfStmt> @line=8 :idx=1");
sss.push_back("0x2b916c9125f0<SgBasicBlock> @line=8 :idx=0");
sss.push_back("SgExprStatement<SgExprStatement> @line=9 :idx=0");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=9 :idx=0");
sss.push_back("var_ref_of_k<SgVarRefExp> @line=9 :idx=0");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=9 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=9 :idx=1");
sss.push_back("0x2b916c9125f0<SgBasicBlock> @line=8 :idx=1");
sss.push_back("0x2b916cb41180<SgIfStmt> @line=8 :idx=2");
sss.push_back("0x2b916c912300<SgBasicBlock> @line=4 :idx=2");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=3");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=4 :idx=0");
sss.push_back("var_ref_of_j<SgVarRefExp> @line=4 :idx=0");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=0");
sss.push_back("var_ref_of_j<SgVarRefExp> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=2");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=4");
sss.push_back("0x2b916c912188<SgBasicBlock> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=3");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=3 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=3 :idx=0");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=2");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=4");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=2");
sss.push_back("SgReturnStmt<SgReturnStmt> @line=13 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=13 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=13 :idx=1");
sss.push_back("SgReturnStmt<SgReturnStmt> @line=13 :idx=1");
sss.push_back("End(::main)<SgFunctionDefinition> @line=1 :idx=3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @line=1 :idx=0");
sss.push_back("main_parameter_list_<SgFunctionParameterList> @line=1 :idx=0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @line=1 :idx=1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @line=1 :idx=2");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=0");
sss.push_back("_variable_declaration_k<SgVariableDeclaration> @line=2 :idx=0");
sss.push_back("initialized_name_k<SgInitializedName> k :idx=0");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=2 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=2 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=2 :idx=1");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=2 :idx=1");
sss.push_back("initialized_name_k<SgInitializedName> k :idx=1");
sss.push_back("_variable_declaration_k<SgVariableDeclaration> @line=2 :idx=1");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=0");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=3 :idx=0");
sss.push_back("_variable_declaration_i<SgVariableDeclaration> @line=3 :idx=0");
sss.push_back("initialized_name_i<SgInitializedName> i :idx=0");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=3 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=3 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=3 :idx=1");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=3 :idx=1");
sss.push_back("initialized_name_i<SgInitializedName> i :idx=1");
sss.push_back("_variable_declaration_i<SgVariableDeclaration> @line=3 :idx=1");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=2");
sss.push_back("0x2b916c912188<SgBasicBlock> @line=3 :idx=0");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=0");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=4 :idx=0");
sss.push_back("_variable_declaration_j<SgVariableDeclaration> @line=4 :idx=0");
sss.push_back("initialized_name_j<SgInitializedName> j :idx=0");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=4 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=4 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=4 :idx=1");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=4 :idx=1");
sss.push_back("initialized_name_j<SgInitializedName> j :idx=1");
sss.push_back("_variable_declaration_j<SgVariableDeclaration> @line=4 :idx=1");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=0");
sss.push_back("var_ref_of_j<SgVarRefExp> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=2");
sss.push_back("0x2b916c912300<SgBasicBlock> @line=4 :idx=0");
sss.push_back("0x2b916cb41010<SgIfStmt> @line=5 :idx=0");
sss.push_back("SgExprStatement<SgExprStatement> @line=5 :idx=0");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=5 :idx=0");
sss.push_back("SgModOp_undef_name<SgModOp> @line=5 :idx=0");
sss.push_back("var_ref_of_k<SgVarRefExp> @line=5 :idx=0");
sss.push_back("SgModOp_undef_name<SgModOp> @line=5 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=5 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=5 :idx=1");
sss.push_back("SgModOp_undef_name<SgModOp> @line=5 :idx=2");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=5 :idx=1");
sss.push_back("integer_value_exp_0<SgIntVal> @line=5 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=5 :idx=1");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=5 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=5 :idx=1");
sss.push_back("0x2b916cb41010<SgIfStmt> @line=5 :idx=1");
sss.push_back("0x2b916c912478<SgBasicBlock> @line=5 :idx=0");
sss.push_back("SgExprStatement<SgExprStatement> @line=6 :idx=0");
sss.push_back("SgAssignOp_undef_name<SgAssignOp> @line=6 :idx=0");
sss.push_back("var_ref_of_k<SgVarRefExp> @line=6 :idx=0");
sss.push_back("SgAssignOp_undef_name<SgAssignOp> @line=6 :idx=1");
sss.push_back("SgAddOp_undef_name<SgAddOp> @line=6 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=6 :idx=0");
sss.push_back("SgAddOp_undef_name<SgAddOp> @line=6 :idx=1");
sss.push_back("var_ref_of_j<SgVarRefExp> @line=6 :idx=0");
sss.push_back("SgAddOp_undef_name<SgAddOp> @line=6 :idx=2");
sss.push_back("SgAssignOp_undef_name<SgAssignOp> @line=6 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=6 :idx=1");
sss.push_back("0x2b916c912478<SgBasicBlock> @line=5 :idx=1");
sss.push_back("0x2b916cb41010<SgIfStmt> @line=5 :idx=2");
sss.push_back("0x2b916c912300<SgBasicBlock> @line=4 :idx=1");
sss.push_back("0x2b916cb41180<SgIfStmt> @line=8 :idx=0");
sss.push_back("SgExprStatement<SgExprStatement> @line=8 :idx=0");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=8 :idx=0");
sss.push_back("SgSubtractOp_undef_name<SgSubtractOp> @line=8 :idx=0");
sss.push_back("var_ref_of_k<SgVarRefExp> @line=8 :idx=0");
sss.push_back("SgSubtractOp_undef_name<SgSubtractOp> @line=8 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=8 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=8 :idx=1");
sss.push_back("SgSubtractOp_undef_name<SgSubtractOp> @line=8 :idx=2");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=8 :idx=1");
sss.push_back("integer_value_exp_0<SgIntVal> @line=8 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=8 :idx=1");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=8 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=8 :idx=1");
sss.push_back("0x2b916cb41180<SgIfStmt> @line=8 :idx=1");
sss.push_back("0x2b916cb41180<SgIfStmt> @line=8 :idx=2");
sss.push_back("0x2b916c912300<SgBasicBlock> @line=4 :idx=2");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=3");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=4 :idx=0");
sss.push_back("var_ref_of_j<SgVarRefExp> @line=4 :idx=0");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=0");
sss.push_back("var_ref_of_j<SgVarRefExp> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=2");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=4");
sss.push_back("0x2b916c912188<SgBasicBlock> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=3");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=3 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=3 :idx=0");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=2");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=4");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=2");
sss.push_back("SgReturnStmt<SgReturnStmt> @line=13 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=13 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=13 :idx=1");
sss.push_back("SgReturnStmt<SgReturnStmt> @line=13 :idx=1");
sss.push_back("End(::main)<SgFunctionDefinition> @line=1 :idx=3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @line=1 :idx=0");
sss.push_back("main_parameter_list_<SgFunctionParameterList> @line=1 :idx=0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @line=1 :idx=1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @line=1 :idx=2");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=0");
sss.push_back("_variable_declaration_k<SgVariableDeclaration> @line=2 :idx=0");
sss.push_back("initialized_name_k<SgInitializedName> k :idx=0");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=2 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=2 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=2 :idx=1");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=2 :idx=1");
sss.push_back("initialized_name_k<SgInitializedName> k :idx=1");
sss.push_back("_variable_declaration_k<SgVariableDeclaration> @line=2 :idx=1");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=0");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=3 :idx=0");
sss.push_back("_variable_declaration_i<SgVariableDeclaration> @line=3 :idx=0");
sss.push_back("initialized_name_i<SgInitializedName> i :idx=0");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=3 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=3 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=3 :idx=1");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=3 :idx=1");
sss.push_back("initialized_name_i<SgInitializedName> i :idx=1");
sss.push_back("_variable_declaration_i<SgVariableDeclaration> @line=3 :idx=1");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=2");
sss.push_back("0x2b916c912188<SgBasicBlock> @line=3 :idx=0");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=0");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=4 :idx=0");
sss.push_back("_variable_declaration_j<SgVariableDeclaration> @line=4 :idx=0");
sss.push_back("initialized_name_j<SgInitializedName> j :idx=0");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=4 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=4 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=4 :idx=1");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=4 :idx=1");
sss.push_back("initialized_name_j<SgInitializedName> j :idx=1");
sss.push_back("_variable_declaration_j<SgVariableDeclaration> @line=4 :idx=1");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=0");
sss.push_back("var_ref_of_j<SgVarRefExp> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=2");
sss.push_back("0x2b916c912300<SgBasicBlock> @line=4 :idx=0");
sss.push_back("0x2b916cb41010<SgIfStmt> @line=5 :idx=0");
sss.push_back("SgExprStatement<SgExprStatement> @line=5 :idx=0");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=5 :idx=0");
sss.push_back("SgModOp_undef_name<SgModOp> @line=5 :idx=0");
sss.push_back("var_ref_of_k<SgVarRefExp> @line=5 :idx=0");
sss.push_back("SgModOp_undef_name<SgModOp> @line=5 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=5 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=5 :idx=1");
sss.push_back("SgModOp_undef_name<SgModOp> @line=5 :idx=2");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=5 :idx=1");
sss.push_back("integer_value_exp_0<SgIntVal> @line=5 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=5 :idx=1");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=5 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=5 :idx=1");
sss.push_back("0x2b916cb41010<SgIfStmt> @line=5 :idx=1");
sss.push_back("0x2b916cb41010<SgIfStmt> @line=5 :idx=2");
sss.push_back("0x2b916c912300<SgBasicBlock> @line=4 :idx=1");
sss.push_back("0x2b916cb41180<SgIfStmt> @line=8 :idx=0");
sss.push_back("SgExprStatement<SgExprStatement> @line=8 :idx=0");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=8 :idx=0");
sss.push_back("SgSubtractOp_undef_name<SgSubtractOp> @line=8 :idx=0");
sss.push_back("var_ref_of_k<SgVarRefExp> @line=8 :idx=0");
sss.push_back("SgSubtractOp_undef_name<SgSubtractOp> @line=8 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=8 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=8 :idx=1");
sss.push_back("SgSubtractOp_undef_name<SgSubtractOp> @line=8 :idx=2");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=8 :idx=1");
sss.push_back("integer_value_exp_0<SgIntVal> @line=8 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=8 :idx=1");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=8 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=8 :idx=1");
sss.push_back("0x2b916cb41180<SgIfStmt> @line=8 :idx=1");
sss.push_back("0x2b916c9125f0<SgBasicBlock> @line=8 :idx=0");
sss.push_back("SgExprStatement<SgExprStatement> @line=9 :idx=0");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=9 :idx=0");
sss.push_back("var_ref_of_k<SgVarRefExp> @line=9 :idx=0");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=9 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=9 :idx=1");
sss.push_back("0x2b916c9125f0<SgBasicBlock> @line=8 :idx=1");
sss.push_back("0x2b916cb41180<SgIfStmt> @line=8 :idx=2");
sss.push_back("0x2b916c912300<SgBasicBlock> @line=4 :idx=2");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=3");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=4 :idx=0");
sss.push_back("var_ref_of_j<SgVarRefExp> @line=4 :idx=0");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=0");
sss.push_back("var_ref_of_j<SgVarRefExp> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=2");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=4");
sss.push_back("0x2b916c912188<SgBasicBlock> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=3");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=3 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=3 :idx=0");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=2");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=4");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=2");
sss.push_back("SgReturnStmt<SgReturnStmt> @line=13 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=13 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=13 :idx=1");
sss.push_back("SgReturnStmt<SgReturnStmt> @line=13 :idx=1");
sss.push_back("End(::main)<SgFunctionDefinition> @line=1 :idx=3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @line=1 :idx=0");
sss.push_back("main_parameter_list_<SgFunctionParameterList> @line=1 :idx=0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @line=1 :idx=1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @line=1 :idx=2");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=0");
sss.push_back("_variable_declaration_k<SgVariableDeclaration> @line=2 :idx=0");
sss.push_back("initialized_name_k<SgInitializedName> k :idx=0");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=2 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=2 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=2 :idx=1");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=2 :idx=1");
sss.push_back("initialized_name_k<SgInitializedName> k :idx=1");
sss.push_back("_variable_declaration_k<SgVariableDeclaration> @line=2 :idx=1");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=0");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=3 :idx=0");
sss.push_back("_variable_declaration_i<SgVariableDeclaration> @line=3 :idx=0");
sss.push_back("initialized_name_i<SgInitializedName> i :idx=0");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=3 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=3 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=3 :idx=1");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=3 :idx=1");
sss.push_back("initialized_name_i<SgInitializedName> i :idx=1");
sss.push_back("_variable_declaration_i<SgVariableDeclaration> @line=3 :idx=1");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=2");
sss.push_back("0x2b916c912188<SgBasicBlock> @line=3 :idx=0");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=0");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=4 :idx=0");
sss.push_back("_variable_declaration_j<SgVariableDeclaration> @line=4 :idx=0");
sss.push_back("initialized_name_j<SgInitializedName> j :idx=0");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=4 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=4 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=4 :idx=1");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=4 :idx=1");
sss.push_back("initialized_name_j<SgInitializedName> j :idx=1");
sss.push_back("_variable_declaration_j<SgVariableDeclaration> @line=4 :idx=1");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=0");
sss.push_back("var_ref_of_j<SgVarRefExp> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=2");
sss.push_back("0x2b916c912300<SgBasicBlock> @line=4 :idx=0");
sss.push_back("0x2b916cb41010<SgIfStmt> @line=5 :idx=0");
sss.push_back("SgExprStatement<SgExprStatement> @line=5 :idx=0");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=5 :idx=0");
sss.push_back("SgModOp_undef_name<SgModOp> @line=5 :idx=0");
sss.push_back("var_ref_of_k<SgVarRefExp> @line=5 :idx=0");
sss.push_back("SgModOp_undef_name<SgModOp> @line=5 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=5 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=5 :idx=1");
sss.push_back("SgModOp_undef_name<SgModOp> @line=5 :idx=2");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=5 :idx=1");
sss.push_back("integer_value_exp_0<SgIntVal> @line=5 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=5 :idx=1");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=5 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=5 :idx=1");
sss.push_back("0x2b916cb41010<SgIfStmt> @line=5 :idx=1");
sss.push_back("0x2b916cb41010<SgIfStmt> @line=5 :idx=2");
sss.push_back("0x2b916c912300<SgBasicBlock> @line=4 :idx=1");
sss.push_back("0x2b916cb41180<SgIfStmt> @line=8 :idx=0");
sss.push_back("SgExprStatement<SgExprStatement> @line=8 :idx=0");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=8 :idx=0");
sss.push_back("SgSubtractOp_undef_name<SgSubtractOp> @line=8 :idx=0");
sss.push_back("var_ref_of_k<SgVarRefExp> @line=8 :idx=0");
sss.push_back("SgSubtractOp_undef_name<SgSubtractOp> @line=8 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=8 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=8 :idx=1");
sss.push_back("SgSubtractOp_undef_name<SgSubtractOp> @line=8 :idx=2");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=8 :idx=1");
sss.push_back("integer_value_exp_0<SgIntVal> @line=8 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=8 :idx=1");
sss.push_back("SgEqualityOp_undef_name<SgEqualityOp> @line=8 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=8 :idx=1");
sss.push_back("0x2b916cb41180<SgIfStmt> @line=8 :idx=1");
sss.push_back("0x2b916cb41180<SgIfStmt> @line=8 :idx=2");
sss.push_back("0x2b916c912300<SgBasicBlock> @line=4 :idx=2");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=3");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=4 :idx=0");
sss.push_back("var_ref_of_j<SgVarRefExp> @line=4 :idx=0");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=0");
sss.push_back("var_ref_of_j<SgVarRefExp> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=2");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=4");
sss.push_back("0x2b916c912188<SgBasicBlock> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=3");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=3 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=3 :idx=0");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=2");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=4");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=2");
sss.push_back("SgReturnStmt<SgReturnStmt> @line=13 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=13 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=13 :idx=1");
sss.push_back("SgReturnStmt<SgReturnStmt> @line=13 :idx=1");
sss.push_back("End(::main)<SgFunctionDefinition> @line=1 :idx=3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @line=1 :idx=0");
sss.push_back("main_parameter_list_<SgFunctionParameterList> @line=1 :idx=0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @line=1 :idx=1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @line=1 :idx=2");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=0");
sss.push_back("_variable_declaration_k<SgVariableDeclaration> @line=2 :idx=0");
sss.push_back("initialized_name_k<SgInitializedName> k :idx=0");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=2 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=2 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=2 :idx=1");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=2 :idx=1");
sss.push_back("initialized_name_k<SgInitializedName> k :idx=1");
sss.push_back("_variable_declaration_k<SgVariableDeclaration> @line=2 :idx=1");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=0");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=3 :idx=0");
sss.push_back("_variable_declaration_i<SgVariableDeclaration> @line=3 :idx=0");
sss.push_back("initialized_name_i<SgInitializedName> i :idx=0");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=3 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=3 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=3 :idx=1");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=3 :idx=1");
sss.push_back("initialized_name_i<SgInitializedName> i :idx=1");
sss.push_back("_variable_declaration_i<SgVariableDeclaration> @line=3 :idx=1");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=2");
sss.push_back("0x2b916c912188<SgBasicBlock> @line=3 :idx=0");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=0");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=4 :idx=0");
sss.push_back("_variable_declaration_j<SgVariableDeclaration> @line=4 :idx=0");
sss.push_back("initialized_name_j<SgInitializedName> j :idx=0");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=4 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=4 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=4 :idx=1");
sss.push_back("SgAssignInitializer_undef_name<SgAssignInitializer> @line=4 :idx=1");
sss.push_back("initialized_name_j<SgInitializedName> j :idx=1");
sss.push_back("_variable_declaration_j<SgVariableDeclaration> @line=4 :idx=1");
sss.push_back("SgForInitStatement<SgForInitStatement> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=0");
sss.push_back("var_ref_of_j<SgVarRefExp> @line=4 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=4 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=4 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=4 :idx=1");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=2");
sss.push_back("0x2b916cac7178<SgForStatement> @line=4 :idx=4");
sss.push_back("0x2b916c912188<SgBasicBlock> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=3");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=3 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=3 :idx=0");
sss.push_back("SgPlusPlusOp_undef_name<SgPlusPlusOp> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=1");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=0");
sss.push_back("var_ref_of_i<SgVarRefExp> @line=3 :idx=0");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=1");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=0");
sss.push_back("integer_value_exp_2<SgIntVal> @line=3 :idx=1");
sss.push_back("SgLessThanOp_undef_name<SgLessThanOp> @line=3 :idx=2");
sss.push_back("SgExprStatement<SgExprStatement> @line=3 :idx=1");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=2");
sss.push_back("0x2b916cac7010<SgForStatement> @line=3 :idx=4");
sss.push_back("0x2b916c912010<SgBasicBlock> @line=1 :idx=2");
sss.push_back("SgReturnStmt<SgReturnStmt> @line=13 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=13 :idx=0");
sss.push_back("integer_value_exp_0<SgIntVal> @line=13 :idx=1");
sss.push_back("SgReturnStmt<SgReturnStmt> @line=13 :idx=1");
sss.push_back("End(::main)<SgFunctionDefinition> @line=1 :idx=3");
sssv.insert(sss);
sss.clear();
vis->sssv = sssv;
vis->constructPathAnalyzer(mg, true, 0, 0, true);
ROSE_ASSERT(vis->sssv.size() == vis->paths.size());
std::cout << "finished" << std::endl;
std::cout << " paths: " << vis->paths.size() << std::endl;
delete vis;
}
Ejemplo n.º 12
0
int main(int argc, char *argv[]) {
SgProject* proj = frontend(argc,argv);
ROSE_ASSERT (proj != NULL);
SgFunctionDeclaration* mainDefDecl = SageInterface::findMain(proj);
SgFunctionDefinition* mainDef = mainDefDecl->get_definition();
visitorTraversal* vis = new visitorTraversal();
StaticCFG::CFG cfg(mainDef);
stringstream ss;
string fileName= StringUtility::stripPathFromFileName(mainDef->get_file_info()->get_filenameString());
string dotFileName1=fileName+"."+ mainDef->get_declaration()->get_name() +".dot";
cfgToDot(mainDef,dotFileName1);
SgIncidenceDirectedGraph* g = new SgIncidenceDirectedGraph();
g = cfg.getGraph();
myGraph* mg = new myGraph();
mg = instantiateGraph(g, cfg);
std::set<std::vector<string> > sssv;
std::vector<string> sss;
sss.push_back("Start(::main)<SgFunctionDefinition> @1 :0");
sss.push_back("<SgFunctionParameterList> @1 :0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @1 :1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @1 :2");
sss.push_back("<SgBasicBlock> @2 :0");
sss.push_back("<SgVariableDeclaration> @3 :0");
sss.push_back("<SgInitializedName> k :0");
sss.push_back("<SgAssignInitializer> @3 :0");
sss.push_back("<SgIntVal> @3 :0");
sss.push_back("<SgIntVal> @3 :1");
sss.push_back("<SgAssignInitializer> @3 :1");
sss.push_back("<SgInitializedName> k :1");
sss.push_back("<SgVariableDeclaration> @3 :1");
sss.push_back("<SgBasicBlock> @2 :1");
sss.push_back("<SgVariableDeclaration> @4 :0");
sss.push_back("<SgInitializedName> x :0");
sss.push_back("<SgAssignInitializer> @4 :0");
sss.push_back("<SgIntVal> @4 :0");
sss.push_back("<SgIntVal> @4 :1");
sss.push_back("<SgAssignInitializer> @4 :1");
sss.push_back("<SgInitializedName> x :1");
sss.push_back("<SgVariableDeclaration> @4 :1");
sss.push_back("<SgBasicBlock> @2 :2");
sss.push_back("<SgIfStmt> @5 :0");
sss.push_back("<SgExprStatement> @5 :0");
sss.push_back("<SgOrOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgOrOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgOrOp> @5 :2");
sss.push_back("<SgExprStatement> @5 :1");
sss.push_back("<SgIfStmt> @5 :1");
sss.push_back("<SgBasicBlock> @8 :0");
sss.push_back("<SgExprStatement> @9 :0");
sss.push_back("<SgAssignOp> @9 :0");
sss.push_back("<SgVarRefExp> @9 :0");
sss.push_back("<SgAssignOp> @9 :1");
sss.push_back("<SgIntVal> @9 :0");
sss.push_back("<SgIntVal> @9 :1");
sss.push_back("<SgAssignOp> @9 :2");
sss.push_back("<SgExprStatement> @9 :1");
sss.push_back("<SgBasicBlock> @8 :1");
sss.push_back("<SgIfStmt> @5 :2");
sss.push_back("<SgBasicBlock> @2 :3");
sss.push_back("<SgReturnStmt> @11 :0");
sss.push_back("<SgIntVal> @11 :0");
sss.push_back("<SgIntVal> @11 :1");
sss.push_back("<SgReturnStmt> @11 :1");
sss.push_back("End(::main)<SgFunctionDefinition> @1 :3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @1 :0");
sss.push_back("<SgFunctionParameterList> @1 :0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @1 :1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @1 :2");
sss.push_back("<SgBasicBlock> @2 :0");
sss.push_back("<SgVariableDeclaration> @3 :0");
sss.push_back("<SgInitializedName> k :0");
sss.push_back("<SgAssignInitializer> @3 :0");
sss.push_back("<SgIntVal> @3 :0");
sss.push_back("<SgIntVal> @3 :1");
sss.push_back("<SgAssignInitializer> @3 :1");
sss.push_back("<SgInitializedName> k :1");
sss.push_back("<SgVariableDeclaration> @3 :1");
sss.push_back("<SgBasicBlock> @2 :1");
sss.push_back("<SgVariableDeclaration> @4 :0");
sss.push_back("<SgInitializedName> x :0");
sss.push_back("<SgAssignInitializer> @4 :0");
sss.push_back("<SgIntVal> @4 :0");
sss.push_back("<SgIntVal> @4 :1");
sss.push_back("<SgAssignInitializer> @4 :1");
sss.push_back("<SgInitializedName> x :1");
sss.push_back("<SgVariableDeclaration> @4 :1");
sss.push_back("<SgBasicBlock> @2 :2");
sss.push_back("<SgIfStmt> @5 :0");
sss.push_back("<SgExprStatement> @5 :0");
sss.push_back("<SgOrOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgOrOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgOrOp> @5 :2");
sss.push_back("<SgExprStatement> @5 :1");
sss.push_back("<SgIfStmt> @5 :1");
sss.push_back("<SgBasicBlock> @5 :0");
sss.push_back("<SgExprStatement> @6 :0");
sss.push_back("<SgAssignOp> @6 :0");
sss.push_back("<SgVarRefExp> @6 :0");
sss.push_back("<SgAssignOp> @6 :1");
sss.push_back("<SgIntVal> @6 :0");
sss.push_back("<SgIntVal> @6 :1");
sss.push_back("<SgAssignOp> @6 :2");
sss.push_back("<SgExprStatement> @6 :1");
sss.push_back("<SgBasicBlock> @5 :1");
sss.push_back("<SgIfStmt> @5 :2");
sss.push_back("<SgBasicBlock> @2 :3");
sss.push_back("<SgReturnStmt> @11 :0");
sss.push_back("<SgIntVal> @11 :0");
sss.push_back("<SgIntVal> @11 :1");
sss.push_back("<SgReturnStmt> @11 :1");
sss.push_back("End(::main)<SgFunctionDefinition> @1 :3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @1 :0");
sss.push_back("<SgFunctionParameterList> @1 :0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @1 :1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @1 :2");
sss.push_back("<SgBasicBlock> @2 :0");
sss.push_back("<SgVariableDeclaration> @3 :0");
sss.push_back("<SgInitializedName> k :0");
sss.push_back("<SgAssignInitializer> @3 :0");
sss.push_back("<SgIntVal> @3 :0");
sss.push_back("<SgIntVal> @3 :1");
sss.push_back("<SgAssignInitializer> @3 :1");
sss.push_back("<SgInitializedName> k :1");
sss.push_back("<SgVariableDeclaration> @3 :1");
sss.push_back("<SgBasicBlock> @2 :1");
sss.push_back("<SgVariableDeclaration> @4 :0");
sss.push_back("<SgInitializedName> x :0");
sss.push_back("<SgAssignInitializer> @4 :0");
sss.push_back("<SgIntVal> @4 :0");
sss.push_back("<SgIntVal> @4 :1");
sss.push_back("<SgAssignInitializer> @4 :1");
sss.push_back("<SgInitializedName> x :1");
sss.push_back("<SgVariableDeclaration> @4 :1");
sss.push_back("<SgBasicBlock> @2 :2");
sss.push_back("<SgIfStmt> @5 :0");
sss.push_back("<SgExprStatement> @5 :0");
sss.push_back("<SgOrOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgOrOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgOrOp> @5 :2");
sss.push_back("<SgExprStatement> @5 :1");
sss.push_back("<SgIfStmt> @5 :1");
sss.push_back("<SgBasicBlock> @8 :0");
sss.push_back("<SgExprStatement> @9 :0");
sss.push_back("<SgAssignOp> @9 :0");
sss.push_back("<SgVarRefExp> @9 :0");
sss.push_back("<SgAssignOp> @9 :1");
sss.push_back("<SgIntVal> @9 :0");
sss.push_back("<SgIntVal> @9 :1");
sss.push_back("<SgAssignOp> @9 :2");
sss.push_back("<SgExprStatement> @9 :1");
sss.push_back("<SgBasicBlock> @8 :1");
sss.push_back("<SgIfStmt> @5 :2");
sss.push_back("<SgBasicBlock> @2 :3");
sss.push_back("<SgReturnStmt> @11 :0");
sss.push_back("<SgIntVal> @11 :0");
sss.push_back("<SgIntVal> @11 :1");
sss.push_back("<SgReturnStmt> @11 :1");
sss.push_back("End(::main)<SgFunctionDefinition> @1 :3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @1 :0");
sss.push_back("<SgFunctionParameterList> @1 :0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @1 :1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @1 :2");
sss.push_back("<SgBasicBlock> @2 :0");
sss.push_back("<SgVariableDeclaration> @3 :0");
sss.push_back("<SgInitializedName> k :0");
sss.push_back("<SgAssignInitializer> @3 :0");
sss.push_back("<SgIntVal> @3 :0");
sss.push_back("<SgIntVal> @3 :1");
sss.push_back("<SgAssignInitializer> @3 :1");
sss.push_back("<SgInitializedName> k :1");
sss.push_back("<SgVariableDeclaration> @3 :1");
sss.push_back("<SgBasicBlock> @2 :1");
sss.push_back("<SgVariableDeclaration> @4 :0");
sss.push_back("<SgInitializedName> x :0");
sss.push_back("<SgAssignInitializer> @4 :0");
sss.push_back("<SgIntVal> @4 :0");
sss.push_back("<SgIntVal> @4 :1");
sss.push_back("<SgAssignInitializer> @4 :1");
sss.push_back("<SgInitializedName> x :1");
sss.push_back("<SgVariableDeclaration> @4 :1");
sss.push_back("<SgBasicBlock> @2 :2");
sss.push_back("<SgIfStmt> @5 :0");
sss.push_back("<SgExprStatement> @5 :0");
sss.push_back("<SgOrOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgOrOp> @5 :1");
sss.push_back("<SgOrOp> @5 :2");
sss.push_back("<SgExprStatement> @5 :1");
sss.push_back("<SgIfStmt> @5 :1");
sss.push_back("<SgBasicBlock> @8 :0");
sss.push_back("<SgExprStatement> @9 :0");
sss.push_back("<SgAssignOp> @9 :0");
sss.push_back("<SgVarRefExp> @9 :0");
sss.push_back("<SgAssignOp> @9 :1");
sss.push_back("<SgIntVal> @9 :0");
sss.push_back("<SgIntVal> @9 :1");
sss.push_back("<SgAssignOp> @9 :2");
sss.push_back("<SgExprStatement> @9 :1");
sss.push_back("<SgBasicBlock> @8 :1");
sss.push_back("<SgIfStmt> @5 :2");
sss.push_back("<SgBasicBlock> @2 :3");
sss.push_back("<SgReturnStmt> @11 :0");
sss.push_back("<SgIntVal> @11 :0");
sss.push_back("<SgIntVal> @11 :1");
sss.push_back("<SgReturnStmt> @11 :1");
sss.push_back("End(::main)<SgFunctionDefinition> @1 :3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @1 :0");
sss.push_back("<SgFunctionParameterList> @1 :0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @1 :1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @1 :2");
sss.push_back("<SgBasicBlock> @2 :0");
sss.push_back("<SgVariableDeclaration> @3 :0");
sss.push_back("<SgInitializedName> k :0");
sss.push_back("<SgAssignInitializer> @3 :0");
sss.push_back("<SgIntVal> @3 :0");
sss.push_back("<SgIntVal> @3 :1");
sss.push_back("<SgAssignInitializer> @3 :1");
sss.push_back("<SgInitializedName> k :1");
sss.push_back("<SgVariableDeclaration> @3 :1");
sss.push_back("<SgBasicBlock> @2 :1");
sss.push_back("<SgVariableDeclaration> @4 :0");
sss.push_back("<SgInitializedName> x :0");
sss.push_back("<SgAssignInitializer> @4 :0");
sss.push_back("<SgIntVal> @4 :0");
sss.push_back("<SgIntVal> @4 :1");
sss.push_back("<SgAssignInitializer> @4 :1");
sss.push_back("<SgInitializedName> x :1");
sss.push_back("<SgVariableDeclaration> @4 :1");
sss.push_back("<SgBasicBlock> @2 :2");
sss.push_back("<SgIfStmt> @5 :0");
sss.push_back("<SgExprStatement> @5 :0");
sss.push_back("<SgOrOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgOrOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgOrOp> @5 :2");
sss.push_back("<SgExprStatement> @5 :1");
sss.push_back("<SgIfStmt> @5 :1");
sss.push_back("<SgBasicBlock> @5 :0");
sss.push_back("<SgExprStatement> @6 :0");
sss.push_back("<SgAssignOp> @6 :0");
sss.push_back("<SgVarRefExp> @6 :0");
sss.push_back("<SgAssignOp> @6 :1");
sss.push_back("<SgIntVal> @6 :0");
sss.push_back("<SgIntVal> @6 :1");
sss.push_back("<SgAssignOp> @6 :2");
sss.push_back("<SgExprStatement> @6 :1");
sss.push_back("<SgBasicBlock> @5 :1");
sss.push_back("<SgIfStmt> @5 :2");
sss.push_back("<SgBasicBlock> @2 :3");
sss.push_back("<SgReturnStmt> @11 :0");
sss.push_back("<SgIntVal> @11 :0");
sss.push_back("<SgIntVal> @11 :1");
sss.push_back("<SgReturnStmt> @11 :1");
sss.push_back("End(::main)<SgFunctionDefinition> @1 :3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @1 :0");
sss.push_back("<SgFunctionParameterList> @1 :0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @1 :1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @1 :2");
sss.push_back("<SgBasicBlock> @2 :0");
sss.push_back("<SgVariableDeclaration> @3 :0");
sss.push_back("<SgInitializedName> k :0");
sss.push_back("<SgAssignInitializer> @3 :0");
sss.push_back("<SgIntVal> @3 :0");
sss.push_back("<SgIntVal> @3 :1");
sss.push_back("<SgAssignInitializer> @3 :1");
sss.push_back("<SgInitializedName> k :1");
sss.push_back("<SgVariableDeclaration> @3 :1");
sss.push_back("<SgBasicBlock> @2 :1");
sss.push_back("<SgVariableDeclaration> @4 :0");
sss.push_back("<SgInitializedName> x :0");
sss.push_back("<SgAssignInitializer> @4 :0");
sss.push_back("<SgIntVal> @4 :0");
sss.push_back("<SgIntVal> @4 :1");
sss.push_back("<SgAssignInitializer> @4 :1");
sss.push_back("<SgInitializedName> x :1");
sss.push_back("<SgVariableDeclaration> @4 :1");
sss.push_back("<SgBasicBlock> @2 :2");
sss.push_back("<SgIfStmt> @5 :0");
sss.push_back("<SgExprStatement> @5 :0");
sss.push_back("<SgOrOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgOrOp> @5 :1");
sss.push_back("<SgOrOp> @5 :2");
sss.push_back("<SgExprStatement> @5 :1");
sss.push_back("<SgIfStmt> @5 :1");
sss.push_back("<SgBasicBlock> @5 :0");
sss.push_back("<SgExprStatement> @6 :0");
sss.push_back("<SgAssignOp> @6 :0");
sss.push_back("<SgVarRefExp> @6 :0");
sss.push_back("<SgAssignOp> @6 :1");
sss.push_back("<SgIntVal> @6 :0");
sss.push_back("<SgIntVal> @6 :1");
sss.push_back("<SgAssignOp> @6 :2");
sss.push_back("<SgExprStatement> @6 :1");
sss.push_back("<SgBasicBlock> @5 :1");
sss.push_back("<SgIfStmt> @5 :2");
sss.push_back("<SgBasicBlock> @2 :3");
sss.push_back("<SgReturnStmt> @11 :0");
sss.push_back("<SgIntVal> @11 :0");
sss.push_back("<SgIntVal> @11 :1");
sss.push_back("<SgReturnStmt> @11 :1");
sss.push_back("End(::main)<SgFunctionDefinition> @1 :3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @1 :0");
sss.push_back("<SgFunctionParameterList> @1 :0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @1 :1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @1 :2");
sss.push_back("<SgBasicBlock> @2 :0");
sss.push_back("<SgVariableDeclaration> @3 :0");
sss.push_back("<SgInitializedName> k :0");
sss.push_back("<SgAssignInitializer> @3 :0");
sss.push_back("<SgIntVal> @3 :0");
sss.push_back("<SgIntVal> @3 :1");
sss.push_back("<SgAssignInitializer> @3 :1");
sss.push_back("<SgInitializedName> k :1");
sss.push_back("<SgVariableDeclaration> @3 :1");
sss.push_back("<SgBasicBlock> @2 :1");
sss.push_back("<SgVariableDeclaration> @4 :0");
sss.push_back("<SgInitializedName> x :0");
sss.push_back("<SgAssignInitializer> @4 :0");
sss.push_back("<SgIntVal> @4 :0");
sss.push_back("<SgIntVal> @4 :1");
sss.push_back("<SgAssignInitializer> @4 :1");
sss.push_back("<SgInitializedName> x :1");
sss.push_back("<SgVariableDeclaration> @4 :1");
sss.push_back("<SgBasicBlock> @2 :2");
sss.push_back("<SgIfStmt> @5 :0");
sss.push_back("<SgExprStatement> @5 :0");
sss.push_back("<SgOrOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgOrOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgOrOp> @5 :2");
sss.push_back("<SgExprStatement> @5 :1");
sss.push_back("<SgIfStmt> @5 :1");
sss.push_back("<SgBasicBlock> @8 :0");
sss.push_back("<SgExprStatement> @9 :0");
sss.push_back("<SgAssignOp> @9 :0");
sss.push_back("<SgVarRefExp> @9 :0");
sss.push_back("<SgAssignOp> @9 :1");
sss.push_back("<SgIntVal> @9 :0");
sss.push_back("<SgIntVal> @9 :1");
sss.push_back("<SgAssignOp> @9 :2");
sss.push_back("<SgExprStatement> @9 :1");
sss.push_back("<SgBasicBlock> @8 :1");
sss.push_back("<SgIfStmt> @5 :2");
sss.push_back("<SgBasicBlock> @2 :3");
sss.push_back("<SgReturnStmt> @11 :0");
sss.push_back("<SgIntVal> @11 :0");
sss.push_back("<SgIntVal> @11 :1");
sss.push_back("<SgReturnStmt> @11 :1");
sss.push_back("End(::main)<SgFunctionDefinition> @1 :3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @1 :0");
sss.push_back("<SgFunctionParameterList> @1 :0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @1 :1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @1 :2");
sss.push_back("<SgBasicBlock> @2 :0");
sss.push_back("<SgVariableDeclaration> @3 :0");
sss.push_back("<SgInitializedName> k :0");
sss.push_back("<SgAssignInitializer> @3 :0");
sss.push_back("<SgIntVal> @3 :0");
sss.push_back("<SgIntVal> @3 :1");
sss.push_back("<SgAssignInitializer> @3 :1");
sss.push_back("<SgInitializedName> k :1");
sss.push_back("<SgVariableDeclaration> @3 :1");
sss.push_back("<SgBasicBlock> @2 :1");
sss.push_back("<SgVariableDeclaration> @4 :0");
sss.push_back("<SgInitializedName> x :0");
sss.push_back("<SgAssignInitializer> @4 :0");
sss.push_back("<SgIntVal> @4 :0");
sss.push_back("<SgIntVal> @4 :1");
sss.push_back("<SgAssignInitializer> @4 :1");
sss.push_back("<SgInitializedName> x :1");
sss.push_back("<SgVariableDeclaration> @4 :1");
sss.push_back("<SgBasicBlock> @2 :2");
sss.push_back("<SgIfStmt> @5 :0");
sss.push_back("<SgExprStatement> @5 :0");
sss.push_back("<SgOrOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgOrOp> @5 :1");
sss.push_back("<SgOrOp> @5 :2");
sss.push_back("<SgExprStatement> @5 :1");
sss.push_back("<SgIfStmt> @5 :1");
sss.push_back("<SgBasicBlock> @8 :0");
sss.push_back("<SgExprStatement> @9 :0");
sss.push_back("<SgAssignOp> @9 :0");
sss.push_back("<SgVarRefExp> @9 :0");
sss.push_back("<SgAssignOp> @9 :1");
sss.push_back("<SgIntVal> @9 :0");
sss.push_back("<SgIntVal> @9 :1");
sss.push_back("<SgAssignOp> @9 :2");
sss.push_back("<SgExprStatement> @9 :1");
sss.push_back("<SgBasicBlock> @8 :1");
sss.push_back("<SgIfStmt> @5 :2");
sss.push_back("<SgBasicBlock> @2 :3");
sss.push_back("<SgReturnStmt> @11 :0");
sss.push_back("<SgIntVal> @11 :0");
sss.push_back("<SgIntVal> @11 :1");
sss.push_back("<SgReturnStmt> @11 :1");
sss.push_back("End(::main)<SgFunctionDefinition> @1 :3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @1 :0");
sss.push_back("<SgFunctionParameterList> @1 :0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @1 :1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @1 :2");
sss.push_back("<SgBasicBlock> @2 :0");
sss.push_back("<SgVariableDeclaration> @3 :0");
sss.push_back("<SgInitializedName> k :0");
sss.push_back("<SgAssignInitializer> @3 :0");
sss.push_back("<SgIntVal> @3 :0");
sss.push_back("<SgIntVal> @3 :1");
sss.push_back("<SgAssignInitializer> @3 :1");
sss.push_back("<SgInitializedName> k :1");
sss.push_back("<SgVariableDeclaration> @3 :1");
sss.push_back("<SgBasicBlock> @2 :1");
sss.push_back("<SgVariableDeclaration> @4 :0");
sss.push_back("<SgInitializedName> x :0");
sss.push_back("<SgAssignInitializer> @4 :0");
sss.push_back("<SgIntVal> @4 :0");
sss.push_back("<SgIntVal> @4 :1");
sss.push_back("<SgAssignInitializer> @4 :1");
sss.push_back("<SgInitializedName> x :1");
sss.push_back("<SgVariableDeclaration> @4 :1");
sss.push_back("<SgBasicBlock> @2 :2");
sss.push_back("<SgIfStmt> @5 :0");
sss.push_back("<SgExprStatement> @5 :0");
sss.push_back("<SgOrOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgOrOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgOrOp> @5 :2");
sss.push_back("<SgExprStatement> @5 :1");
sss.push_back("<SgIfStmt> @5 :1");
sss.push_back("<SgBasicBlock> @5 :0");
sss.push_back("<SgExprStatement> @6 :0");
sss.push_back("<SgAssignOp> @6 :0");
sss.push_back("<SgVarRefExp> @6 :0");
sss.push_back("<SgAssignOp> @6 :1");
sss.push_back("<SgIntVal> @6 :0");
sss.push_back("<SgIntVal> @6 :1");
sss.push_back("<SgAssignOp> @6 :2");
sss.push_back("<SgExprStatement> @6 :1");
sss.push_back("<SgBasicBlock> @5 :1");
sss.push_back("<SgIfStmt> @5 :2");
sss.push_back("<SgBasicBlock> @2 :3");
sss.push_back("<SgReturnStmt> @11 :0");
sss.push_back("<SgIntVal> @11 :0");
sss.push_back("<SgIntVal> @11 :1");
sss.push_back("<SgReturnStmt> @11 :1");
sss.push_back("End(::main)<SgFunctionDefinition> @1 :3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @1 :0");
sss.push_back("<SgFunctionParameterList> @1 :0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @1 :1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @1 :2");
sss.push_back("<SgBasicBlock> @2 :0");
sss.push_back("<SgVariableDeclaration> @3 :0");
sss.push_back("<SgInitializedName> k :0");
sss.push_back("<SgAssignInitializer> @3 :0");
sss.push_back("<SgIntVal> @3 :0");
sss.push_back("<SgIntVal> @3 :1");
sss.push_back("<SgAssignInitializer> @3 :1");
sss.push_back("<SgInitializedName> k :1");
sss.push_back("<SgVariableDeclaration> @3 :1");
sss.push_back("<SgBasicBlock> @2 :1");
sss.push_back("<SgVariableDeclaration> @4 :0");
sss.push_back("<SgInitializedName> x :0");
sss.push_back("<SgAssignInitializer> @4 :0");
sss.push_back("<SgIntVal> @4 :0");
sss.push_back("<SgIntVal> @4 :1");
sss.push_back("<SgAssignInitializer> @4 :1");
sss.push_back("<SgInitializedName> x :1");
sss.push_back("<SgVariableDeclaration> @4 :1");
sss.push_back("<SgBasicBlock> @2 :2");
sss.push_back("<SgIfStmt> @5 :0");
sss.push_back("<SgExprStatement> @5 :0");
sss.push_back("<SgOrOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgOrOp> @5 :1");
sss.push_back("<SgOrOp> @5 :2");
sss.push_back("<SgExprStatement> @5 :1");
sss.push_back("<SgIfStmt> @5 :1");
sss.push_back("<SgBasicBlock> @5 :0");
sss.push_back("<SgExprStatement> @6 :0");
sss.push_back("<SgAssignOp> @6 :0");
sss.push_back("<SgVarRefExp> @6 :0");
sss.push_back("<SgAssignOp> @6 :1");
sss.push_back("<SgIntVal> @6 :0");
sss.push_back("<SgIntVal> @6 :1");
sss.push_back("<SgAssignOp> @6 :2");
sss.push_back("<SgExprStatement> @6 :1");
sss.push_back("<SgBasicBlock> @5 :1");
sss.push_back("<SgIfStmt> @5 :2");
sss.push_back("<SgBasicBlock> @2 :3");
sss.push_back("<SgReturnStmt> @11 :0");
sss.push_back("<SgIntVal> @11 :0");
sss.push_back("<SgIntVal> @11 :1");
sss.push_back("<SgReturnStmt> @11 :1");
sss.push_back("End(::main)<SgFunctionDefinition> @1 :3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @1 :0");
sss.push_back("<SgFunctionParameterList> @1 :0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @1 :1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @1 :2");
sss.push_back("<SgBasicBlock> @2 :0");
sss.push_back("<SgVariableDeclaration> @3 :0");
sss.push_back("<SgInitializedName> k :0");
sss.push_back("<SgAssignInitializer> @3 :0");
sss.push_back("<SgIntVal> @3 :0");
sss.push_back("<SgIntVal> @3 :1");
sss.push_back("<SgAssignInitializer> @3 :1");
sss.push_back("<SgInitializedName> k :1");
sss.push_back("<SgVariableDeclaration> @3 :1");
sss.push_back("<SgBasicBlock> @2 :1");
sss.push_back("<SgVariableDeclaration> @4 :0");
sss.push_back("<SgInitializedName> x :0");
sss.push_back("<SgAssignInitializer> @4 :0");
sss.push_back("<SgIntVal> @4 :0");
sss.push_back("<SgIntVal> @4 :1");
sss.push_back("<SgAssignInitializer> @4 :1");
sss.push_back("<SgInitializedName> x :1");
sss.push_back("<SgVariableDeclaration> @4 :1");
sss.push_back("<SgBasicBlock> @2 :2");
sss.push_back("<SgIfStmt> @5 :0");
sss.push_back("<SgExprStatement> @5 :0");
sss.push_back("<SgOrOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgOrOp> @5 :1");
sss.push_back("<SgOrOp> @5 :2");
sss.push_back("<SgExprStatement> @5 :1");
sss.push_back("<SgIfStmt> @5 :1");
sss.push_back("<SgBasicBlock> @8 :0");
sss.push_back("<SgExprStatement> @9 :0");
sss.push_back("<SgAssignOp> @9 :0");
sss.push_back("<SgVarRefExp> @9 :0");
sss.push_back("<SgAssignOp> @9 :1");
sss.push_back("<SgIntVal> @9 :0");
sss.push_back("<SgIntVal> @9 :1");
sss.push_back("<SgAssignOp> @9 :2");
sss.push_back("<SgExprStatement> @9 :1");
sss.push_back("<SgBasicBlock> @8 :1");
sss.push_back("<SgIfStmt> @5 :2");
sss.push_back("<SgBasicBlock> @2 :3");
sss.push_back("<SgReturnStmt> @11 :0");
sss.push_back("<SgIntVal> @11 :0");
sss.push_back("<SgIntVal> @11 :1");
sss.push_back("<SgReturnStmt> @11 :1");
sss.push_back("End(::main)<SgFunctionDefinition> @1 :3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @1 :0");
sss.push_back("<SgFunctionParameterList> @1 :0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @1 :1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @1 :2");
sss.push_back("<SgBasicBlock> @2 :0");
sss.push_back("<SgVariableDeclaration> @3 :0");
sss.push_back("<SgInitializedName> k :0");
sss.push_back("<SgAssignInitializer> @3 :0");
sss.push_back("<SgIntVal> @3 :0");
sss.push_back("<SgIntVal> @3 :1");
sss.push_back("<SgAssignInitializer> @3 :1");
sss.push_back("<SgInitializedName> k :1");
sss.push_back("<SgVariableDeclaration> @3 :1");
sss.push_back("<SgBasicBlock> @2 :1");
sss.push_back("<SgVariableDeclaration> @4 :0");
sss.push_back("<SgInitializedName> x :0");
sss.push_back("<SgAssignInitializer> @4 :0");
sss.push_back("<SgIntVal> @4 :0");
sss.push_back("<SgIntVal> @4 :1");
sss.push_back("<SgAssignInitializer> @4 :1");
sss.push_back("<SgInitializedName> x :1");
sss.push_back("<SgVariableDeclaration> @4 :1");
sss.push_back("<SgBasicBlock> @2 :2");
sss.push_back("<SgIfStmt> @5 :0");
sss.push_back("<SgExprStatement> @5 :0");
sss.push_back("<SgOrOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgOrOp> @5 :1");
sss.push_back("<SgOrOp> @5 :2");
sss.push_back("<SgExprStatement> @5 :1");
sss.push_back("<SgIfStmt> @5 :1");
sss.push_back("<SgBasicBlock> @5 :0");
sss.push_back("<SgExprStatement> @6 :0");
sss.push_back("<SgAssignOp> @6 :0");
sss.push_back("<SgVarRefExp> @6 :0");
sss.push_back("<SgAssignOp> @6 :1");
sss.push_back("<SgIntVal> @6 :0");
sss.push_back("<SgIntVal> @6 :1");
sss.push_back("<SgAssignOp> @6 :2");
sss.push_back("<SgExprStatement> @6 :1");
sss.push_back("<SgBasicBlock> @5 :1");
sss.push_back("<SgIfStmt> @5 :2");
sss.push_back("<SgBasicBlock> @2 :3");
sss.push_back("<SgReturnStmt> @11 :0");
sss.push_back("<SgIntVal> @11 :0");
sss.push_back("<SgIntVal> @11 :1");
sss.push_back("<SgReturnStmt> @11 :1");
sss.push_back("End(::main)<SgFunctionDefinition> @1 :3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @1 :0");
sss.push_back("<SgFunctionParameterList> @1 :0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @1 :1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @1 :2");
sss.push_back("<SgBasicBlock> @2 :0");
sss.push_back("<SgVariableDeclaration> @3 :0");
sss.push_back("<SgInitializedName> k :0");
sss.push_back("<SgAssignInitializer> @3 :0");
sss.push_back("<SgIntVal> @3 :0");
sss.push_back("<SgIntVal> @3 :1");
sss.push_back("<SgAssignInitializer> @3 :1");
sss.push_back("<SgInitializedName> k :1");
sss.push_back("<SgVariableDeclaration> @3 :1");
sss.push_back("<SgBasicBlock> @2 :1");
sss.push_back("<SgVariableDeclaration> @4 :0");
sss.push_back("<SgInitializedName> x :0");
sss.push_back("<SgAssignInitializer> @4 :0");
sss.push_back("<SgIntVal> @4 :0");
sss.push_back("<SgIntVal> @4 :1");
sss.push_back("<SgAssignInitializer> @4 :1");
sss.push_back("<SgInitializedName> x :1");
sss.push_back("<SgVariableDeclaration> @4 :1");
sss.push_back("<SgBasicBlock> @2 :2");
sss.push_back("<SgIfStmt> @5 :0");
sss.push_back("<SgExprStatement> @5 :0");
sss.push_back("<SgOrOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgOrOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgOrOp> @5 :2");
sss.push_back("<SgExprStatement> @5 :1");
sss.push_back("<SgIfStmt> @5 :1");
sss.push_back("<SgBasicBlock> @8 :0");
sss.push_back("<SgExprStatement> @9 :0");
sss.push_back("<SgAssignOp> @9 :0");
sss.push_back("<SgVarRefExp> @9 :0");
sss.push_back("<SgAssignOp> @9 :1");
sss.push_back("<SgIntVal> @9 :0");
sss.push_back("<SgIntVal> @9 :1");
sss.push_back("<SgAssignOp> @9 :2");
sss.push_back("<SgExprStatement> @9 :1");
sss.push_back("<SgBasicBlock> @8 :1");
sss.push_back("<SgIfStmt> @5 :2");
sss.push_back("<SgBasicBlock> @2 :3");
sss.push_back("<SgReturnStmt> @11 :0");
sss.push_back("<SgIntVal> @11 :0");
sss.push_back("<SgIntVal> @11 :1");
sss.push_back("<SgReturnStmt> @11 :1");
sss.push_back("End(::main)<SgFunctionDefinition> @1 :3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @1 :0");
sss.push_back("<SgFunctionParameterList> @1 :0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @1 :1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @1 :2");
sss.push_back("<SgBasicBlock> @2 :0");
sss.push_back("<SgVariableDeclaration> @3 :0");
sss.push_back("<SgInitializedName> k :0");
sss.push_back("<SgAssignInitializer> @3 :0");
sss.push_back("<SgIntVal> @3 :0");
sss.push_back("<SgIntVal> @3 :1");
sss.push_back("<SgAssignInitializer> @3 :1");
sss.push_back("<SgInitializedName> k :1");
sss.push_back("<SgVariableDeclaration> @3 :1");
sss.push_back("<SgBasicBlock> @2 :1");
sss.push_back("<SgVariableDeclaration> @4 :0");
sss.push_back("<SgInitializedName> x :0");
sss.push_back("<SgAssignInitializer> @4 :0");
sss.push_back("<SgIntVal> @4 :0");
sss.push_back("<SgIntVal> @4 :1");
sss.push_back("<SgAssignInitializer> @4 :1");
sss.push_back("<SgInitializedName> x :1");
sss.push_back("<SgVariableDeclaration> @4 :1");
sss.push_back("<SgBasicBlock> @2 :2");
sss.push_back("<SgIfStmt> @5 :0");
sss.push_back("<SgExprStatement> @5 :0");
sss.push_back("<SgOrOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgOrOp> @5 :1");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgOrOp> @5 :2");
sss.push_back("<SgExprStatement> @5 :1");
sss.push_back("<SgIfStmt> @5 :1");
sss.push_back("<SgBasicBlock> @5 :0");
sss.push_back("<SgExprStatement> @6 :0");
sss.push_back("<SgAssignOp> @6 :0");
sss.push_back("<SgVarRefExp> @6 :0");
sss.push_back("<SgAssignOp> @6 :1");
sss.push_back("<SgIntVal> @6 :0");
sss.push_back("<SgIntVal> @6 :1");
sss.push_back("<SgAssignOp> @6 :2");
sss.push_back("<SgExprStatement> @6 :1");
sss.push_back("<SgBasicBlock> @5 :1");
sss.push_back("<SgIfStmt> @5 :2");
sss.push_back("<SgBasicBlock> @2 :3");
sss.push_back("<SgReturnStmt> @11 :0");
sss.push_back("<SgIntVal> @11 :0");
sss.push_back("<SgIntVal> @11 :1");
sss.push_back("<SgReturnStmt> @11 :1");
sss.push_back("End(::main)<SgFunctionDefinition> @1 :3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @1 :0");
sss.push_back("<SgFunctionParameterList> @1 :0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @1 :1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @1 :2");
sss.push_back("<SgBasicBlock> @2 :0");
sss.push_back("<SgVariableDeclaration> @3 :0");
sss.push_back("<SgInitializedName> k :0");
sss.push_back("<SgAssignInitializer> @3 :0");
sss.push_back("<SgIntVal> @3 :0");
sss.push_back("<SgIntVal> @3 :1");
sss.push_back("<SgAssignInitializer> @3 :1");
sss.push_back("<SgInitializedName> k :1");
sss.push_back("<SgVariableDeclaration> @3 :1");
sss.push_back("<SgBasicBlock> @2 :1");
sss.push_back("<SgVariableDeclaration> @4 :0");
sss.push_back("<SgInitializedName> x :0");
sss.push_back("<SgAssignInitializer> @4 :0");
sss.push_back("<SgIntVal> @4 :0");
sss.push_back("<SgIntVal> @4 :1");
sss.push_back("<SgAssignInitializer> @4 :1");
sss.push_back("<SgInitializedName> x :1");
sss.push_back("<SgVariableDeclaration> @4 :1");
sss.push_back("<SgBasicBlock> @2 :2");
sss.push_back("<SgIfStmt> @5 :0");
sss.push_back("<SgExprStatement> @5 :0");
sss.push_back("<SgOrOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgOrOp> @5 :1");
sss.push_back("<SgOrOp> @5 :2");
sss.push_back("<SgExprStatement> @5 :1");
sss.push_back("<SgIfStmt> @5 :1");
sss.push_back("<SgBasicBlock> @8 :0");
sss.push_back("<SgExprStatement> @9 :0");
sss.push_back("<SgAssignOp> @9 :0");
sss.push_back("<SgVarRefExp> @9 :0");
sss.push_back("<SgAssignOp> @9 :1");
sss.push_back("<SgIntVal> @9 :0");
sss.push_back("<SgIntVal> @9 :1");
sss.push_back("<SgAssignOp> @9 :2");
sss.push_back("<SgExprStatement> @9 :1");
sss.push_back("<SgBasicBlock> @8 :1");
sss.push_back("<SgIfStmt> @5 :2");
sss.push_back("<SgBasicBlock> @2 :3");
sss.push_back("<SgReturnStmt> @11 :0");
sss.push_back("<SgIntVal> @11 :0");
sss.push_back("<SgIntVal> @11 :1");
sss.push_back("<SgReturnStmt> @11 :1");
sss.push_back("End(::main)<SgFunctionDefinition> @1 :3");
sssv.insert(sss);
sss.clear();
sss.push_back("Start(::main)<SgFunctionDefinition> @1 :0");
sss.push_back("<SgFunctionParameterList> @1 :0");
sss.push_back("After parameters(::main)<SgFunctionDefinition> @1 :1");
sss.push_back("After pre-initialization(::main)<SgFunctionDefinition> @1 :2");
sss.push_back("<SgBasicBlock> @2 :0");
sss.push_back("<SgVariableDeclaration> @3 :0");
sss.push_back("<SgInitializedName> k :0");
sss.push_back("<SgAssignInitializer> @3 :0");
sss.push_back("<SgIntVal> @3 :0");
sss.push_back("<SgIntVal> @3 :1");
sss.push_back("<SgAssignInitializer> @3 :1");
sss.push_back("<SgInitializedName> k :1");
sss.push_back("<SgVariableDeclaration> @3 :1");
sss.push_back("<SgBasicBlock> @2 :1");
sss.push_back("<SgVariableDeclaration> @4 :0");
sss.push_back("<SgInitializedName> x :0");
sss.push_back("<SgAssignInitializer> @4 :0");
sss.push_back("<SgIntVal> @4 :0");
sss.push_back("<SgIntVal> @4 :1");
sss.push_back("<SgAssignInitializer> @4 :1");
sss.push_back("<SgInitializedName> x :1");
sss.push_back("<SgVariableDeclaration> @4 :1");
sss.push_back("<SgBasicBlock> @2 :2");
sss.push_back("<SgIfStmt> @5 :0");
sss.push_back("<SgExprStatement> @5 :0");
sss.push_back("<SgOrOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgAndOp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :0");
sss.push_back("<SgBoolValExp> @5 :1");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgAndOp> @5 :1");
sss.push_back("<SgAndOp> @5 :2");
sss.push_back("<SgOrOp> @5 :1");
sss.push_back("<SgOrOp> @5 :2");
sss.push_back("<SgExprStatement> @5 :1");
sss.push_back("<SgIfStmt> @5 :1");
sss.push_back("<SgBasicBlock> @5 :0");
sss.push_back("<SgExprStatement> @6 :0");
sss.push_back("<SgAssignOp> @6 :0");
sss.push_back("<SgVarRefExp> @6 :0");
sss.push_back("<SgAssignOp> @6 :1");
sss.push_back("<SgIntVal> @6 :0");
sss.push_back("<SgIntVal> @6 :1");
sss.push_back("<SgAssignOp> @6 :2");
sss.push_back("<SgExprStatement> @6 :1");
sss.push_back("<SgBasicBlock> @5 :1");
sss.push_back("<SgIfStmt> @5 :2");
sss.push_back("<SgBasicBlock> @2 :3");
sss.push_back("<SgReturnStmt> @11 :0");
sss.push_back("<SgIntVal> @11 :0");
sss.push_back("<SgIntVal> @11 :1");
sss.push_back("<SgReturnStmt> @11 :1");
sss.push_back("End(::main)<SgFunctionDefinition> @1 :3");
sssv.insert(sss);
sss.clear();
vis->sssv = sssv;
vis->constructPathAnalyzer(mg, true, 0, 0, true);
std::cout << "finished" << std::endl;
std::cout << " paths: " << vis->paths.size() << std::endl;
delete vis;
}
Ejemplo n.º 13
0
int
main (int argc, char *argv[])
{
  vector<string> argvList(argv, argv+argc);
  //Processing debugging and annotation options
  //  autopar_command_processing(argvList);
  argvList = commandline_processing (argvList);
  // enable parsing user-defined pragma if enable_diff is true
  // -rose:openmp:parse_only
  if (enable_diff)
    argvList.push_back("-rose:openmp:parse_only");
  SgProject *project = frontend (argvList);
  ROSE_ASSERT (project != NULL);

  // register midend signal handling function
  if (KEEP_GOING_CAUGHT_MIDEND_SIGNAL)
  {
    std::cout
      << "[WARN] "
      << "Configured to keep going after catching a "
      << "signal in AutoPar"
      << std::endl;
    Rose::KeepGoing::setMidendErrorCode (project, 100);
    goto label_end;
  }   

  // create a block to avoid jump crosses initialization of candidateFuncDefs etc.
  {                             
    std::vector<SgFunctionDefinition* > candidateFuncDefs; 
    findCandidateFunctionDefinitions (project, candidateFuncDefs);
    normalizeLoops (candidateFuncDefs);

    //Prepare liveness analysis etc.
    //Too much output for analysis debugging info.
    //initialize_analysis (project,enable_debug);   
    initialize_analysis (project, false);   

    // This is a bit redundant with findCandidateFunctionDefinitions ()
    // But we do need the per file control to decide if omp.h is needed for each file
    //
    // For each source file in the project
    SgFilePtrList & ptr_list = project->get_fileList();
    for (SgFilePtrList::iterator iter = ptr_list.begin(); iter!=ptr_list.end();
        iter++)
    {
      SgFile* sageFile = (*iter);
      SgSourceFile * sfile = isSgSourceFile(sageFile);
      ROSE_ASSERT(sfile);
      SgGlobal *root = sfile->get_globalScope();

      Rose_STL_Container<SgNode*> defList = NodeQuery::querySubTree(sfile, V_SgFunctionDefinition); 
      bool hasOpenMP= false; // flag to indicate if omp.h is needed in this file

      //For each function body in the scope
      //for (SgDeclarationStatementPtrList::iterator p = declList.begin(); p != declList.end(); ++p) 
      for (Rose_STL_Container<SgNode*>::iterator p = defList.begin(); p != defList.end(); ++p) 
      {

        //      cout<<"\t loop at:"<< cur_loop->get_file_info()->get_line() <<endl;

        SgFunctionDefinition *defn = isSgFunctionDefinition(*p);
        ROSE_ASSERT (defn != NULL);

        SgFunctionDeclaration *func = defn->get_declaration();
        ROSE_ASSERT (func != NULL);

        //ignore functions in system headers, Can keep them to test robustness
        if (defn->get_file_info()->get_filename()!=sageFile->get_file_info()->get_filename())
        {
          continue;
        }

        SgBasicBlock *body = defn->get_body();  
        // For each loop 
        Rose_STL_Container<SgNode*> loops = NodeQuery::querySubTree(defn,V_SgForStatement); 
        if (loops.size()==0) 
        {
          if (enable_debug)
            cout<<"\t skipped since no for loops are found in this function"<<endl;
          continue;
        }

#if 0 // Moved to be executed before running liveness analysis.
        // normalize C99 style for (int i= x, ...) to C89 style: int i;  (i=x, ...)
        // Liao, 10/22/2009. Thank Jeff Keasler for spotting this bug
        for (Rose_STL_Container<SgNode*>::iterator iter = loops.begin();
            iter!= loops.end(); iter++ )
        {
          SgForStatement* cur_loop = isSgForStatement(*iter);
          ROSE_ASSERT(cur_loop);
          SageInterface::normalizeForLoopInitDeclaration(cur_loop);
        }
#endif
        // X. Replace operators with their equivalent counterparts defined 
        // in "inline" annotations
        AstInterfaceImpl faImpl_1(body);
        CPPAstInterface fa_body(&faImpl_1);
        OperatorInlineRewrite()( fa_body, AstNodePtrImpl(body));

        // Pass annotations to arrayInterface and use them to collect 
        // alias info. function info etc.  
        ArrayAnnotation* annot = ArrayAnnotation::get_inst(); 
        ArrayInterface array_interface(*annot);
        array_interface.initialize(fa_body, AstNodePtrImpl(defn));
        array_interface.observe(fa_body);

        //FR(06/07/2011): aliasinfo was not set which caused segfault
        LoopTransformInterface::set_aliasInfo(&array_interface);

        for (Rose_STL_Container<SgNode*>::iterator iter = loops.begin(); 
            iter!= loops.end(); iter++ ) 
        {
          SgNode* current_loop = *iter;

          if (enable_debug)
          {
            SgForStatement * fl = isSgForStatement(current_loop);
            cout<<"\t\t Considering loop at "<< fl->get_file_info()->get_line()<<endl;
          }
          //X. Parallelize loop one by one
          // getLoopInvariant() will actually check if the loop has canonical forms 
          // which can be handled by dependence analysis
          SgInitializedName* invarname = getLoopInvariant(current_loop);
          if (invarname != NULL)
          {
            bool ret = ParallelizeOutermostLoop(current_loop, &array_interface, annot);
            if (ret) // if at least one loop is parallelized, we set hasOpenMP to be true for the entire file.
              hasOpenMP = true;  
          }
          else // cannot grab loop index from a non-conforming loop, skip parallelization
          {
            if (enable_debug)
              cout<<"Skipping a non-canonical loop at line:"<<current_loop->get_file_info()->get_line()<<"..."<<endl;
            // We should not reset it to false. The last loop may not be parallelizable. But a previous one may be.  
            //hasOpenMP = false;
          }
        }// end for loops
      } // end for-loop for declarations

      // insert omp.h if needed
      if (hasOpenMP && !enable_diff)
      {
        SageInterface::insertHeader("omp.h",PreprocessingInfo::after,false,root);
        if (enable_patch)
          generatePatchFile(sfile); 
      }
      // compare user-defined and compiler-generated OmpAttributes
      if (enable_diff)
        diffUserDefinedAndCompilerGeneratedOpenMP(sfile); 
    } //end for-loop of files

#if 1
    // undo loop normalization
    std::map <SgForStatement* , bool >::iterator iter = trans_records.forLoopInitNormalizationTable.begin();
    for (; iter!= trans_records.forLoopInitNormalizationTable.end(); iter ++) 
    {
      SgForStatement* for_loop = (*iter).first; 
      unnormalizeForLoopInitDeclaration (for_loop);
    }
#endif
    // Qing's loop normalization is not robust enough to pass all tests
    //AstTests::runAllTests(project);


    // clean up resources for analyses
    release_analysis();
  }

label_end: 
  // Report errors
  if (keep_going)
  {
    std::vector<std::string> orig_rose_cmdline(argv, argv+argc);
    Rose::KeepGoing::generate_reports (project, orig_rose_cmdline);
  }

  //project->unparse();
  return backend (project);
}
Ejemplo n.º 14
0
int main(int argc, char *argv[]) {
  ss << "#include \"SgGraphTemplate.h\"\n";
  ss << "#include \"graphProcessing.h\"\n";
  ss << "#include \"staticCFG.h\"\n";
  ss << "using namespace std;\n";
  ss << "using namespace boost;\n";






  //ss << "set<vector<string> >  sssv;\n";
  //ss << "vector<string> sss;\n";
  ss << "typedef myGraph CFGforT;\n";

  
  SgProject* proj = frontend(argc,argv);
  ROSE_ASSERT (proj != NULL);

  SgFunctionDeclaration* mainDefDecl = SageInterface::findMain(proj);

  SgFunctionDefinition* mainDef = mainDefDecl->get_definition();
   visitorTraversal* vis = new visitorTraversal();
    StaticCFG::CFG cfg(mainDef);


//    stringstream ss;
    string fileName= StringUtility::stripPathFromFileName(mainDef->get_file_info()->get_filenameString());
    string Cfilename = fileName+"."+ mainDef->get_declaration()->get_name() +"test.C";
    
   // cfgToDot(mainDef,dotFileName1);
    //cfg->buildFullCFG();
    SgIncidenceDirectedGraph* g = new SgIncidenceDirectedGraph();
    g = cfg.getGraph();
    myGraph* mg = new myGraph();
    mg = instantiateGraph(g, cfg);
    //vis->constructPathAnalyzer(mg, true, 0, 0, true);

   // std::cout << "took: " << timeDifference(t2, t1) << std::endl;
    //cfg.clearNodesAndEdges();
    //std::cout << "finished" << std::endl;
 //   std::cout << "tltnodes: " << vis->tltnodes << " paths: " << vis->paths << std::endl;
 //   delete vis;
//}


ss << "class visitorTraversal : public SgGraphTraversal<CFGforT>\n";
ss << "  {\n";
ss << "     public:\n";
ss << "     vector<string> sss;\n";
ss << "     set<vector<string> > sssv;\n";
//vis->constructPathAnalyzer(mg, true, 0, 0, true);
ss << "         void analyzePath(std::vector<VertexID>& pth);\n";
ss << "         SgIncidenceDirectedGraph* g;\n";
ss << "          myGraph* orig;\n";
ss << "          StaticCFG::CFG* cfg;\n";
ss << "          std::vector<std::vector<string> > paths;\n";
ss << "   };\n";

ss << "void visitorTraversal::analyzePath(std::vector<VertexID>& pathR) {\n";
ss << "    std::vector<string> path;\n";
ss << "   for (unsigned int j = 0; j < pathR.size(); j++) {\n";
ss << "       SgGraphNode* R = getGraphNode[pathR[j]];\n";
ss << "      CFGNode cf = cfg->toCFGNode(R);\n";
ss << "       string str = cf.toString();";
ss << "str.erase(std::remove(str.begin(), str.end(), '\\n'), str.end());\n";

ss << "       path.push_back(str);\n";
ss << "    }\n";
ss << "    paths.push_back(path);\n";
ss << "   // ROSE_ASSERT(sssv.find(path) != sssv.end());\n";

ss << "}\n";

//ss << "set<vector<string> > sssv;\n";

ss << "int main(int argc, char *argv[]) {\n";
ss << "SgProject* proj = frontend(argc,argv);\n";
ss << "ROSE_ASSERT (proj != NULL);\n";
ss << "SgFunctionDeclaration* mainDefDecl = SageInterface::findMain(proj);\n";
ss << "SgFunctionDefinition* mainDef = mainDefDecl->get_definition();\n";
ss << "visitorTraversal* vis = new visitorTraversal();\n";
ss << "StaticCFG::CFG cfg(mainDef);\n";
ss << "stringstream ss;\n";
ss << "string fileName= StringUtility::stripPathFromFileName(mainDef->get_file_info()->get_filenameString());\n";
ss << "string dotFileName1=fileName+\".\"+ mainDef->get_declaration()->get_name() +\".dot\";\n";
ss << "cfgToDot(mainDef,dotFileName1);\n";
ss << "SgIncidenceDirectedGraph* g = new SgIncidenceDirectedGraph();\n";
ss << "g = cfg.getGraph();\n";
ss << "myGraph* mg = new myGraph();\n";
ss << "mg = instantiateGraph(g, cfg);\n";
//ss << "vis->tltnodes = 0;\n";
//ss << "vis->paths = 0;\n";
ss << "std::set<std::vector<string> > sssv;\n";
ss << "std::vector<string> sss;\n";
vis->constructPathAnalyzer(mg, true, 0, 0, true);
ss << "vis->sssv = sssv;\n";
ss << "vis->constructPathAnalyzer(mg, true, 0, 0, true);\n";
ss << "ROSE_ASSERT(vis->sssv.size() == vis->paths.size());\n";
ss << "std::cout << \"finished\" << std::endl;\n";
ss << "std::cout << \" paths: \" << vis->paths.size() << std::endl;\n";
ss << "delete vis;\n";
ss << "}\n";
string sst = ss.str();
ofstream myfile;
myfile.open(Cfilename.c_str());
myfile << sst;
myfile.close();
delete vis;
return 0;
}
Ejemplo n.º 15
0
int
main (int argc, char *argv[])
{
  vector<string> argvList(argv, argv+argc);
  //Processing debugging and annotation options
  autopar_command_processing(argvList);
  // enable parsing user-defined pragma if enable_diff is true
  // -rose:openmp:parse_only
  if (enable_diff)
    argvList.push_back("-rose:openmp:parse_only");
  SgProject *project = frontend (argvList);
  ROSE_ASSERT (project != NULL);

#if 1 // This has to happen before analyses are called.
       // For each loop 
       VariantVector vv (V_SgForStatement); 
        Rose_STL_Container<SgNode*> loops = NodeQuery::queryMemoryPool(vv); 

      // normalize C99 style for (int i= x, ...) to C89 style: int i;  (i=x, ...)
       // Liao, 10/22/2009. Thank Jeff Keasler for spotting this bug
         for (Rose_STL_Container<SgNode*>::iterator iter = loops.begin();
                     iter!= loops.end(); iter++ )
         {
           SgForStatement* cur_loop = isSgForStatement(*iter);
           ROSE_ASSERT(cur_loop);
           SageInterface::normalizeForLoopInitDeclaration(cur_loop);
         }

#endif
  //Prepare liveness analysis etc.
  initialize_analysis (project,false);   
  // For each source file in the project
    SgFilePtrList & ptr_list = project->get_fileList();
    for (SgFilePtrList::iterator iter = ptr_list.begin(); iter!=ptr_list.end();
        iter++)
   {
     SgFile* sageFile = (*iter);
     SgSourceFile * sfile = isSgSourceFile(sageFile);
     ROSE_ASSERT(sfile);
     SgGlobal *root = sfile->get_globalScope();
     SgDeclarationStatementPtrList& declList = root->get_declarations ();
     bool hasOpenMP= false; // flag to indicate if omp.h is needed in this file

    //For each function body in the scope
     for (SgDeclarationStatementPtrList::iterator p = declList.begin(); p != declList.end(); ++p) 
     {
        SgFunctionDeclaration *func = isSgFunctionDeclaration(*p);
        if (func == 0)  continue;
        SgFunctionDefinition *defn = func->get_definition();
        if (defn == 0)  continue;
         //ignore functions in system headers, Can keep them to test robustness
        if (defn->get_file_info()->get_filename()!=sageFile->get_file_info()->get_filename())
          continue;
        SgBasicBlock *body = defn->get_body();  
       // For each loop 
        Rose_STL_Container<SgNode*> loops = NodeQuery::querySubTree(defn,V_SgForStatement); 
        if (loops.size()==0) continue;

#if 0 // Moved to be executed before running liveness analysis.
      // normalize C99 style for (int i= x, ...) to C89 style: int i;  (i=x, ...)
       // Liao, 10/22/2009. Thank Jeff Keasler for spotting this bug
         for (Rose_STL_Container<SgNode*>::iterator iter = loops.begin();
                     iter!= loops.end(); iter++ )
         {
           SgForStatement* cur_loop = isSgForStatement(*iter);
           ROSE_ASSERT(cur_loop);
           SageInterface::normalizeForLoopInitDeclaration(cur_loop);
         }
#endif
        // X. Replace operators with their equivalent counterparts defined 
        // in "inline" annotations
        AstInterfaceImpl faImpl_1(body);
        CPPAstInterface fa_body(&faImpl_1);
        OperatorInlineRewrite()( fa_body, AstNodePtrImpl(body));
         
	 // Pass annotations to arrayInterface and use them to collect 
         // alias info. function info etc.  
         ArrayAnnotation* annot = ArrayAnnotation::get_inst(); 
         ArrayInterface array_interface(*annot);
         array_interface.initialize(fa_body, AstNodePtrImpl(defn));
         array_interface.observe(fa_body);
	
	//FR(06/07/2011): aliasinfo was not set which caused segfault
	LoopTransformInterface::set_aliasInfo(&array_interface);
       
        // X. Loop normalization for all loops within body
        NormalizeForLoop(fa_body, AstNodePtrImpl(body));

	for (Rose_STL_Container<SgNode*>::iterator iter = loops.begin(); 
	    iter!= loops.end(); iter++ ) 
	{
	  SgNode* current_loop = *iter;
	  //X. Parallelize loop one by one
          // getLoopInvariant() will actually check if the loop has canonical forms 
          // which can be handled by dependence analysis
          SgInitializedName* invarname = getLoopInvariant(current_loop);
          if (invarname != NULL)
          {
             hasOpenMP = ParallelizeOutermostLoop(current_loop, &array_interface, annot);
          }
           else // cannot grab loop index from a non-conforming loop, skip parallelization
           {
            if (enable_debug)
              cout<<"Skipping a non-canonical loop at line:"<<current_loop->get_file_info()->get_line()<<"..."<<endl;
             hasOpenMP = false;
           }
	}// end for loops
      } // end for-loop for declarations
     // insert omp.h if needed
     if (hasOpenMP && !enable_diff)
     {
       SageInterface::insertHeader("omp.h",PreprocessingInfo::after,false,root);
       if (enable_patch)
         generatePatchFile(sfile); 
     }
     // compare user-defined and compiler-generated OmpAttributes
     if (enable_diff)
       diffUserDefinedAndCompilerGeneratedOpenMP(sfile); 
   } //end for-loop of files

  // Qing's loop normalization is not robust enough to pass all tests
  //AstTests::runAllTests(project);
  
  release_analysis();
  //project->unparse();
  return backend (project);
}