Add osl extbody extension support
authorLnc <hnc@singularity.fr>
Thu, 3 Oct 2013 15:38:27 +0000 (17:38 +0200)
committerDongkyun, Son <dongkyun.s@samsung.com>
Tue, 15 Dec 2015 01:03:13 +0000 (10:03 +0900)
source/pprint.c

index 2db7542..f0b7110 100644 (file)
@@ -53,6 +53,7 @@
 #ifdef OSL_SUPPORT
 #include <osl/util.h>
 #include <osl/body.h>
+#include <osl/extensions/extbody.h>
 #include <osl/statement.h>
 #include <osl/scop.h>
 #endif
@@ -311,8 +312,15 @@ int pprint_osl_body(struct cloogoptions *options, FILE *dst,
       stmt = stmt->next;
 
     /* Ensure it has a printable body. */
-    if ((osl_generic_has_URI(stmt->body, OSL_URI_BODY)) &&
-        ((body = stmt->body->data) != NULL) &&
+    body = NULL;
+    if (osl_generic_has_URI(stmt->body, OSL_URI_BODY)) {
+      body = stmt->body->data;
+    } else if (osl_generic_has_URI(stmt->body, OSL_URI_EXTBODY)) {
+      if (stmt->body->data != NULL) {
+        body = ((osl_extbody_p)(stmt->body->data))->body;
+      }
+    }
+    if ((body != NULL) &&
         (body->expression != NULL) &&
         (body->iterators != NULL)) {
       expr = osl_util_identifier_substitution(body->expression->string[0],