From ba7f1578508905ad897f0d9d3e8512281e89b2f1 Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Fri, 2 Feb 2024 12:01:31 -0800 Subject: [PATCH] Print address space pointers properly. --- src/terralib.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/terralib.lua b/src/terralib.lua index 77181729..8ea57c61 100644 --- a/src/terralib.lua +++ b/src/terralib.lua @@ -1277,7 +1277,12 @@ do if status then return r end end return self.name - elseif self:ispointer() then return "&"..tostring(self.type) + elseif self:ispointer() then + if not self.addressspace or self.addressspace == 0 then + return "&"..tostring(self.type) + else + return "pointer("..tostring(self.type)..","..tostring(self.addressspace)..")" + end elseif self:isvector() then return "vector("..tostring(self.type)..","..tostring(self.N)..")" elseif self:isfunction() then return mkstring(self.parameters,"{",",",self.isvararg and " ...}" or "}").." -> "..tostring(self.returntype) elseif self:isarray() then