From a00347601a4c22ddc5f8285a02958902bf962a3c Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Fri, 19 Jan 2018 17:13:57 -0600
Subject: [PATCH] Shortcut straight to ecm.map_constant when emitting
 (potentially large) array literals (#118)

---
 loopy/target/c/__init__.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/loopy/target/c/__init__.py b/loopy/target/c/__init__.py
index 9536fc711..25a8e29ba 100644
--- a/loopy/target/c/__init__.py
+++ b/loopy/target/c/__init__.py
@@ -194,7 +194,6 @@ def generate_array_literal(codegen_state, array, value):
 
     ecm = codegen_state.expression_to_code_mapper
 
-    from pymbolic.mapper.stringifier import PREC_NONE
     from loopy.expression import dtype_to_type_context
     from loopy.symbolic import ArrayLiteral
 
@@ -203,7 +202,7 @@ def generate_array_literal(codegen_state, array, value):
             codegen_state.ast_builder.get_c_expression_to_code_mapper(),
             ArrayLiteral(
                 tuple(
-                    ecm(d_i, PREC_NONE, type_context, array.dtype).expr
+                    ecm.map_constant(d_i, type_context)
                     for d_i in data)))
 
 # }}}
-- 
GitLab