本文整理汇总了C++中symbol_table::find方法的典型用法代码示例。如果您正苦于以下问题:C++ symbol_table::find方法的具体用法?C++ symbol_table::find怎么用?C++ symbol_table::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类symbol_table
的用法示例。
在下文中一共展示了symbol_table::find方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: find_typeTable
symbol* find_typeTable (const string* key) {
auto found = typeTable.find(key);
if (found == typeTable.end()){
return NULL;
} else {
return found->second;
}
}
示例2: grabStructSymbol
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;
}
示例3: reset_patterns
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;
}
}
示例4: traverse_block_two
/** 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);
}
示例5: set_patterns
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]);
}
}
示例6: lookup_string
symbol_data lookup_string(const char * str, std::size_t length)
{
static symbol_table table;
return table.find(str, length);
}