changeset 704:d05e327cbc50

removed trailing space in stub codegear
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Aug 2020 06:53:13 +0900
parents cf517d3f5ab9
children cf82fc3512dd
files src/parallel_execution/generate_stub.pl src/parallel_execution/perlTests/BoundedBuffer.c src/parallel_execution/perlTests/testfiles/twice/main.c
diffstat 3 files changed, 33 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/parallel_execution/generate_stub.pl	Sat Aug 22 19:59:28 2020 +0900
+++ b/src/parallel_execution/generate_stub.pl	Sun Aug 23 06:53:13 2020 +0900
@@ -8,6 +8,7 @@
 
 use FindBin;
 use lib "$FindBin::Bin/lib";
+use DDP {deparse => 1};
 
 use Gears::Interface;
 use Gears::Util;
@@ -201,8 +202,26 @@
                   }
                 }
 
+
+                unless (exists $call_interfaces{$filename}->{$typeName}) {
+                  warn "[WARN] forget #interface'$typeName'";
+                  $call_interfaces{$filename}->{$typeName} = 1;
+                  my $interface_path = $interfaceNameToHeaderPath->{$typeName};
+                  if ($interface_path) {
+                      &getDataGear($interface_path);
+                      &getCodeGear($interface_path);
+                  }
+                }
+
                 my $res = findExistsOutputDataGear($typeName, $method);
                 if ($res) {
+                  my @parsedArgs = split /,/ , $tmpArgs;
+                  if (scalar(@parsedArgs) != 1) {
+                    p $tmpArgs;
+                    p @parsedArgs;
+                    warn '[WARN] TBD';
+                  }
+                  #p $res;
                    $specialyEmitStubCodeGears{$currentCodeGear} = $res;
                 }
             } elsif (/^}$/) {
@@ -338,7 +357,7 @@
     my($fd,$prevCodeGearName,$dataGearName) = @_;
     print $fd "__code ", $prevCodeGearName ,"_stub(struct Context* $context_name) {\n";
     print $fd $dataGearName;
-    print $fd "\n} \n\n";
+    print $fd "\n}\n\n";
     return 1;
 }
 
--- a/src/parallel_execution/perlTests/BoundedBuffer.c	Sat Aug 22 19:59:28 2020 +0900
+++ b/src/parallel_execution/perlTests/BoundedBuffer.c	Sun Aug 23 06:53:13 2020 +0900
@@ -28,7 +28,7 @@
 	Data* data = Gearef(context, Buffer)->data;
 	enum Code next = Gearef(context, Buffer)->next;
 	goto putBoundedBuffer(context, buffer, data, next);
-} 
+}
 
 __code putBoundedBuffer1(struct Context *context,struct BoundedBuffer* buffer, union Data* data, enum Code next) {
     struct Semaphore* semaphore = buffer->lock;
@@ -43,7 +43,7 @@
 	Data* data = Gearef(context, Buffer)->data;
 	enum Code next = Gearef(context, Buffer)->next;
 	goto putBoundedBuffer1(context, buffer, data, next);
-} 
+}
 
 __code putBoundedBuffer2(struct Context *context,struct BoundedBuffer* buffer, union Data* data, enum Code next) {
     struct Element* element = &ALLOCATE(context, Element)->Element;
@@ -64,7 +64,7 @@
 	Data* data = Gearef(context, Buffer)->data;
 	enum Code next = Gearef(context, Buffer)->next;
 	goto putBoundedBuffer2(context, buffer, data, next);
-} 
+}
 
 __code putBoundedBuffer3(struct Context *context,struct BoundedBuffer* buffer, union Data* data, enum Code next) {
     struct Semaphore* semaphore = buffer->fullCount;
@@ -79,7 +79,7 @@
 	Data* data = Gearef(context, Buffer)->data;
 	enum Code next = Gearef(context, Buffer)->next;
 	goto putBoundedBuffer3(context, buffer, data, next);
-} 
+}
 
 __code putBoundedBuffer4(struct Context *context,struct BoundedBuffer* buffer, union Data* data, enum Code next) {
     context->before = C_putBoundedBuffer4;
@@ -91,7 +91,7 @@
 	Data* data = Gearef(context, Buffer)->data;
 	enum Code next = Gearef(context, Buffer)->next;
 	goto putBoundedBuffer4(context, buffer, data, next);
-} 
+}
 
 __code takeBoundedBuffer(struct Context *context,struct BoundedBuffer* buffer, enum Code next,union Data **O_data) {
 	Data* data  __attribute__((unused))  = *O_data;
@@ -107,7 +107,7 @@
 	enum Code next = Gearef(context, Buffer)->next;
 	Data** O_data = &Gearef(context, Buffer)->data;
 	goto takeBoundedBuffer(context, buffer, next, O_data);
-} 
+}
 
 __code takeBoundedBuffer1(struct Context *context,struct BoundedBuffer* buffer, enum Code next,union Data **O_data) {
 	Data* data  __attribute__((unused))  = *O_data;
@@ -123,7 +123,7 @@
 	enum Code next = Gearef(context, Buffer)->next;
 	Data** O_data = &Gearef(context, Buffer)->data;
 	goto takeBoundedBuffer1(context, buffer, next, O_data);
-} 
+}
 
 __code takeBoundedBuffer2(struct Context *context,struct BoundedBuffer* buffer, enum Code next,union Data **O_data) {
 	Data* data  __attribute__((unused))  = *O_data;
@@ -144,7 +144,7 @@
 	enum Code next = Gearef(context, Buffer)->next;
 	Data** O_data = &Gearef(context, Buffer)->data;
 	goto takeBoundedBuffer2(context, buffer, next, O_data);
-} 
+}
 
 __code takeBoundedBuffer3(struct Context *context,struct BoundedBuffer* buffer, enum Code next,union Data **O_data) {
 	Data* data  __attribute__((unused))  = *O_data;
@@ -160,7 +160,7 @@
 	enum Code next = Gearef(context, Buffer)->next;
 	Data** O_data = &Gearef(context, Buffer)->data;
 	goto takeBoundedBuffer3(context, buffer, next, O_data);
-} 
+}
 
 __code takeBoundedBuffer4(struct Context *context,struct BoundedBuffer* buffer, enum Code next,union Data **O_data) {
 	Data* data  __attribute__((unused))  = *O_data;
@@ -173,5 +173,5 @@
 	enum Code next = Gearef(context, Buffer)->next;
 	Data** O_data = &Gearef(context, Buffer)->data;
 	goto takeBoundedBuffer4(context, buffer, next, O_data);
-} 
+}
 
--- a/src/parallel_execution/perlTests/testfiles/twice/main.c	Sat Aug 22 19:59:28 2020 +0900
+++ b/src/parallel_execution/perlTests/testfiles/twice/main.c	Sun Aug 23 06:53:13 2020 +0900
@@ -25,7 +25,7 @@
 	LoopCounter* loopCounter = Gearef(context, LoopCounter);
 	TaskManager* taskManager = Gearef(context, TaskManager);
 	goto initDataGears(context, loopCounter, taskManager);
-} 
+}
 
 __code code1(struct Context *context,struct LoopCounter* loopCounter) {
     printf("cpus:\t\t%d\n", cpu_num);
@@ -45,7 +45,7 @@
 __code code1_stub(struct Context* context) {
 	LoopCounter* loopCounter = Gearef(context, LoopCounter);
 	goto code1(context, loopCounter);
-} 
+}
 
 __code createTask1(struct Context *context,struct LoopCounter* loopCounter, struct TaskManager* taskManager) {
     Array* array1 = &ALLOCATE(context, Array)->Array;
@@ -112,7 +112,7 @@
 	LoopCounter* loopCounter = Gearef(context, LoopCounter);
 	TaskManager* taskManager = Gearef(context, TaskManager);
 	goto createTask1(context, loopCounter, taskManager);
-} 
+}
 
 __code code2(struct Context *context,struct TaskManager* taskManager) {
     Gearef(context, TaskManager)->taskManager = (union Data*) taskManager;