Commit 656067d2 authored by Maxime Perrotin's avatar Maxime Perrotin

Align with latest ocarina

Ocarina does not generate the generated-activity.ad? files anymore when
there are no ports in the system
parent e76b0170
......@@ -60,6 +60,7 @@ void ada_wrappers_preamble(FV * fv)
{
int hasparam = 0;
int mix = 0;
bool has_async_ri = false;
if (NULL == ads || NULL == adb)
return;
......@@ -73,19 +74,26 @@ void ada_wrappers_preamble(FV * fv)
fprintf(adb,
"-- This file was generated automatically: DO NOT MODIFY IT !\n\n");
fprintf(adb,
"-- pragma Style_Checks (Off);\n"
"-- pragma Warnings (Off);\n\n"
"with PolyORB_HI_Generated.Activity,\n"
" PolyORB_HI.Utils;\n"
"use PolyORB_HI_Generated.Activity,\n"
" PolyORB_HI.Utils;\n\n");
"with PolyORB_HI.Utils;\n"
"use PolyORB_HI.Utils;\n");
/* Generates "with PolyORB_HI.Generated.Activity if there is at least one async RI */
FOREACH(i, Interface, fv->interfaces, {
if (RI == i->direction && asynch == i->synchronism) has_async_ri = true;
});
if (has_async_ri) {
fprintf(adb,
"with PolyORB_HI_Generated.Activity;\n"
"use PolyORB_HI_Generated.Activity;\n");
}
fprintf(ads, "with Interfaces.C;\n");
/* Generates "with PolyORB_HI.Generated.Types IF at least one async IF has a param */
FOREACH(i, Interface, fv->interfaces, {
CheckForParams(i, &hasparam);
})
});
if (hasparam) {
fprintf(ads, "with PolyORB_HI_Generated.Types;\n");
}
......
......@@ -960,13 +960,30 @@ void Add_api(Process *node, FV_list *all_fv)
"package %s is\n",
fv->name);
fprintf (code, "-- TASTE API (do not edit this code manually)\n"
"with PolyORB_HI_Generated.Activity,\n"
" PolyORB_HI_Generated.Deployment;\n"
"use PolyORB_HI_Generated.Activity,\n"
" PolyORB_HI_Generated.Deployment;\n\n"
"package body %s is\n",
fv->name);
// check if Generated.Activity is needed, ie. if there is at least
// one sporadic pi
bool needs_activity = false;
FOREACH(function, FV, all_fv, {
FOREACH(pi, Interface, function->interfaces, {
if(PI == pi->direction && asynch == pi->synchronism
&& cyclic != pi->rcm && NULL != Find_All_Calling_FV(pi)) {
needs_activity = true;
}
});
});
fprintf (code, "-- TASTE API (do not edit this code manually)\n");
if (needs_activity) {
fprintf (code, "with PolyORB_HI_Generated.Activity;\n"
"use PolyORB_HI_Generated.Activity;\n");
}
fprintf (code, "with PolyORB_HI_Generated.Deployment;\n"
"use PolyORB_HI_Generated.Deployment;\n\n"
"package body %s is\n",
fv->name);
}
FOREACH(function, FV, all_fv, {
if (false == function->is_component_type) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment