Exemplo n.º 1
0
symbol* find_typeTable (const string* key) {
  auto found = typeTable.find(key);
  if (found == typeTable.end()){
    return NULL;
  } else {
    return found->second;
  }
}
Exemplo n.º 2
0
symbol* grabStructSymbol (const string* ident)
{
  auto table_check = typeTable.find(ident);
  if(table_check != typeTable.end())
    {
      return table_check->second;
    }
  fprintf(stderr, "oc: %s struct does not exist\n", ident->c_str());
  return NULL;
}
Exemplo n.º 3
0
void affineStatement::reset_patterns( const symbol_table& new_table )
{
	Datum * parent;
	AccessPattern * new_pat;
	symbol_table::const_iterator it;
	
	for ( int i = 0 ; i < Reads.size() ; i++ ) {
		parent = Reads[i]->get_parent();
		it = new_table.find(parent->get_name());
		new_pat = it->second.get_pattern(Reads[i]->get_id());
		Reads[i] = new_pat;
	}
	
	for ( int i = 0 ; i < Writes.size() ; i++ ) {
		parent = Writes[i]->get_parent();
		it = new_table.find(parent->get_name());
		new_pat = it->second.get_pattern(Writes[i]->get_id());
		Writes[i] = new_pat;
	}
}
Exemplo n.º 4
0
/** Traverse block and find name of symbol */
static string traverse_block_two(symbol_table mymap,string tname){
  // find in map
  symbol_table::iterator got = mymap.find (&tname);

  // if symbool found, return symbol
  if ( got != mymap.end() ) {
    string type = *(got->first);
    return type;
  }

  // otherwise, keep traversing
  return traverse_block_two(*got->second->fields,tname);
}
Exemplo n.º 5
0
Arquivo: Nodes.cpp Projeto: 8l/rose
void Statement::set_patterns( symbol_table& data )
{
	SgExpression * exp = myStatement->get_expression();
	IO lhsIO;
	vector<AccessPattern*> patList;
	
	if ( !isSgBinaryOp(exp) ) {
		if ( isSgUnaryOp(exp) )
			search_for_access_patterns( isSgUnaryOp(exp)->get_operand(), patList, INOUT );
		else
			report_error("Unrecognized expression statement",exp);

	} else {
		lhsIO = ( isSgAssignOp(exp) ) ? OUT : INOUT;

		/* Left hand side */
		search_for_access_patterns( isSgBinaryOp(exp)->get_lhs_operand(), patList, lhsIO );
		
		/* Right hand side */
		search_for_access_patterns( isSgBinaryOp(exp)->get_rhs_operand(), patList, IN );
	}
	
	for ( int i = 0 ; i < patList.size() ; i++ ) { 
		
		int dim = patList[i]->get_dim();
		SgExpression * exp = patList[i]->get_refExp();
		
		for ( int j = 0 ; j < dim ; j++ )
			exp = isSgPntrArrRefExp(exp)->get_lhs_operand();
		
		string ap_name = isSgVarRefExp(exp)->get_symbol()->get_name().getString();
		
		symbol_table::iterator it = data.find(ap_name);
		it->second.add_pattern(patList[i]);
		add_pattern(patList[i]);
	}
}
Exemplo n.º 6
0
 symbol_data lookup_string(const char * str, std::size_t length)
 {
     static symbol_table table;
     return table.find(str, length);
 }