本文整理汇总了C++中tl::Symbol::get_internal_symbol方法的典型用法代码示例。如果您正苦于以下问题:C++ Symbol::get_internal_symbol方法的具体用法?C++ Symbol::get_internal_symbol怎么用?C++ Symbol::get_internal_symbol使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tl::Symbol
的用法示例。
在下文中一共展示了Symbol::get_internal_symbol方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: append_module_to_scope
void Fortran::append_module_to_scope(TL::Symbol module,
TL::Scope scope)
{
ERROR_CONDITION(!module.is_valid() || !module.is_fortran_module(), "Symbol must be a Fortran module", 0);
scope_entry_t* used_modules_info
= ::get_or_create_used_modules_symbol_info(scope.get_decl_context());
P_LIST_ADD_ONCE(used_modules_info->entity_specs.related_symbols,
used_modules_info->entity_specs.num_related_symbols,
module.get_internal_symbol());
if (!module.get_internal_symbol()->entity_specs.is_builtin)
fortran_load_module(module.get_internal_symbol()->symbol_name, /* intrinsic */ 0, make_locus("", 0, 0));
}
示例2: build_empty_body_for_function
void build_empty_body_for_function(
TL::Symbol function_symbol,
Nodecl::NodeclBase &function_code,
Nodecl::NodeclBase &empty_stmt)
{
empty_stmt = Nodecl::EmptyStatement::make(make_locus("", 0, 0));
Nodecl::List stmt_list = Nodecl::List::make(empty_stmt);
if (IS_C_LANGUAGE || IS_CXX_LANGUAGE)
{
Nodecl::CompoundStatement compound_statement =
Nodecl::CompoundStatement::make(stmt_list,
/* destructors */ Nodecl::NodeclBase::null(),
make_locus("", 0, 0));
stmt_list = Nodecl::List::make(compound_statement);
}
Nodecl::NodeclBase context = Nodecl::Context::make(
stmt_list,
function_symbol.get_related_scope(), make_locus("", 0, 0));
function_symbol.get_internal_symbol()->defined = 1;
if (function_symbol.is_dependent_function())
{
function_code = Nodecl::TemplateFunctionCode::make(context,
// Initializers
Nodecl::NodeclBase::null(),
function_symbol,
make_locus("", 0, 0));
}
else
{
function_code = Nodecl::FunctionCode::make(context,
// Initializers
Nodecl::NodeclBase::null(),
function_symbol,
make_locus("", 0, 0));
}
function_symbol.get_internal_symbol()->entity_specs.function_code = function_code.get_internal_nodecl();
}
示例3: as_symbol
std::string as_symbol(TL::Symbol s)
{
return symbol_to_source(s.get_internal_symbol());
}
示例4: loop_spawn_worksharing
//.........这里部分代码省略.........
wd_description,
outline_info,
construct);
std::string dyn_props_var = "nanos_wd_dyn_props";
Source dynamic_wd_info;
dynamic_wd_info << "nanos_wd_dyn_props_t " << dyn_props_var << ";";
fill_dynamic_properties(dyn_props_var,
/* priority_expr */ nodecl_null(), /* final_expr */ nodecl_null(), /* is_implicit */ 0, dynamic_wd_info);
pm_specific_code
<< struct_arg_type_name << " *ol_args = (" << struct_arg_type_name <<"*) 0;"
<< const_wd_info
<< "nanos_wd_t nanos_wd_ = (nanos_wd_t) 0;"
<< dynamic_wd_info
<< "static nanos_slicer_t replicate = (nanos_slicer_t)0;"
<< "if (replicate == (nanos_slicer_t)0)"
<< "replicate = nanos_find_slicer(\"replicate\");"
<< "if (replicate == (nanos_slicer_t)0)"
<< "nanos_handle_error(NANOS_UNIMPLEMENTED);"
<< "nanos_err = nanos_create_sliced_wd(&nanos_wd_, "
<< "nanos_wd_const_data.base.num_devices, nanos_wd_const_data.devices, "
<< "(size_t)" << struct_size << ", nanos_wd_const_data.base.data_alignment, "
<< "(void**)&ol_args, nanos_current_wd(), replicate,"
<< "&nanos_wd_const_data.base.props, &" << dyn_props_var << ", 0, (nanos_copy_data_t**)0,"
<< "0, (nanos_region_dimension_internal_t**)0"
<< ");"
<< "if (nanos_err != NANOS_OK)"
<< "nanos_handle_error(nanos_err);"
<< statement_placeholder(fill_outline_arguments_tree)
<< "nanos_err = nanos_submit(nanos_wd_, 0, (nanos_data_access_t *) 0, (nanos_team_t) 0);"
<< "if (nanos_err != NANOS_OK)"
<< "nanos_handle_error(nanos_err);"
;
}
TL::Source implicit_barrier_or_tw;
if (!distribute_environment.find_first<Nodecl::OpenMP::BarrierAtEnd>().is_null())
{
implicit_barrier_or_tw << get_implicit_sync_end_construct_source();
}
Source spawn_code;
spawn_code
<< "{"
<< as_type(get_bool_type()) << " single_guard;"
<< "nanos_err_t nanos_err;"
<< schedule_setup
<< "nanos_ws_info_loop_t nanos_setup_info_loop;"
<< "nanos_setup_info_loop.lower_bound = " << as_expression(lower) << ";"
<< "nanos_setup_info_loop.upper_bound = " << as_expression(upper) << ";"
<< "nanos_setup_info_loop.loop_step = " << as_expression(step) << ";"
<< "nanos_setup_info_loop.chunk_size = nanos_chunk;"
<< worksharing_creation
<< pm_specific_code
<< implicit_barrier_or_tw
<< "}"
;
Source fill_outline_arguments, fill_immediate_arguments;
fill_arguments(construct, outline_info, fill_outline_arguments, fill_immediate_arguments);
if (IS_FORTRAN_LANGUAGE)
Source::source_language = SourceLanguage::C;
Nodecl::NodeclBase spawn_code_tree = spawn_code.parse_statement(construct);
if (IS_FORTRAN_LANGUAGE)
Source::source_language = SourceLanguage::Current;
Nodecl::NodeclBase arguments_tree;
TL::Source *fill_arguments;
if (!_lowering->in_ompss_mode())
{
// OpenMP
arguments_tree = fill_immediate_arguments_tree;
fill_arguments = &fill_immediate_arguments;
}
else
{
// OmpSs
arguments_tree = fill_outline_arguments_tree;
fill_arguments = &fill_outline_arguments;
}
// Now attach the slicer symbol to its final scope (see tl-lower-for-worksharing.cpp)
const decl_context_t* spawn_inner_context = arguments_tree.retrieve_context().get_decl_context();
slicer_descriptor.get_internal_symbol()->decl_context = spawn_inner_context;
::insert_entry(spawn_inner_context->current_scope, slicer_descriptor.get_internal_symbol());
// Parse the arguments
Nodecl::NodeclBase new_tree = fill_arguments->parse_statement(arguments_tree);
arguments_tree.replace(new_tree);
// Finally, replace the construct by the tree that represents the spawn code
construct.replace(spawn_code_tree);
}