void Core::collapse_check_loop(TL::PragmaCustomStatement construct) { TL::PragmaCustomClause collapse = construct.get_pragma_line().get_clause("collapse"); if (!collapse.is_defined()) return; TL::ObjectList<Nodecl::NodeclBase> expr_list = collapse.get_arguments_as_expressions(construct); if (expr_list.size() != 1) { error_printf("%s: error: collapse clause needs exactly one argument\n", locus_to_str(construct.get_locus())); return; } Nodecl::NodeclBase expr = expr_list[0]; if (!expr.is_constant() || !is_any_int_type(expr.get_type().get_internal_type())) { error_printf("%s: error: collapse clause requires an integer constant expression\n", locus_to_str(construct.get_locus())); return; } const_value_t* cval = expr.get_constant(); if (!const_value_is_one(cval)) { error_printf("%s: error: only collapse(1) is supported\n", locus_to_str(construct.get_locus())); return; } }
void Lower::lower_taskwait(const Nodecl::OpenMP::Taskwait& node) { TL::Symbol nanos_taskwait_sym = TL::Scope::get_global_scope().get_symbol_from_name("nanos_taskwait"); ERROR_CONDITION(!nanos_taskwait_sym.is_valid() || !nanos_taskwait_sym.is_function(), "Invalid symbol", 0); const char* locus = locus_to_str(node.get_locus()); Nodecl::NodeclBase taskwait_tree = Nodecl::ExpressionStatement::make( Nodecl::FunctionCall::make( nanos_taskwait_sym.make_nodecl(/* set_ref_type */ true, node.get_locus()), /* args */ Nodecl::List::make( const_value_to_nodecl( const_value_make_string_null_ended( locus, strlen(locus)))), /* alternate-name */ Nodecl::NodeclBase::null(), /* function-form */ Nodecl::NodeclBase::null(), TL::Type::get_void_type(), node.get_locus())); node.replace(taskwait_tree); }
Nodecl::NodeclVisitor<void>::Ret NeonVectorBackend::unhandled_node(const Nodecl::NodeclBase& n) { internal_error("NEON Backend: Unknown node %s at %s.", ast_print_node_type(n.get_kind()), locus_to_str(n.get_locus())); return Ret(); }
type_t* solve_class_template(type_t* template_type, type_t* specialized_type, template_parameter_list_t** deduced_template_arguments, const locus_t* locus) { template_parameter_list_t* specialized = template_specialized_type_get_template_arguments( get_actual_class_type(specialized_type)); int i; int num_specializations = template_type_get_num_specializations(template_type); type_t** matching_set = NULL; int num_matching_set = 0; template_parameter_list_t **deduction_results = NULL; int num_deductions = 0; for (i = 0; i < num_specializations; i++) { type_t* current_specialized_type = template_type_get_specialization_num(template_type, i); DEBUG_CODE() { scope_entry_t* entry = named_type_get_symbol(current_specialized_type); fprintf(stderr, "SOLVETEMPLATE: Checking with specialization defined in '%s'\n", locus_to_str(entry->locus)); } // We do not want these for instantiation purposes if (!named_type_get_symbol(current_specialized_type)->entity_specs.is_instantiable) { DEBUG_CODE() { scope_entry_t* entry = named_type_get_symbol(current_specialized_type); fprintf(stderr, "SOLVETEMPLATE: Discarding '%s' (%s) since it has been created by the typesystem\n", print_type_str(current_specialized_type, entry->decl_context), locus_to_str(entry->locus)); } continue; }
std::string Symbol::get_locus_str() const { return locus_to_str(_symbol->locus); }