From ef474d24145b85f933d06a1648b0d9cbf6695fe5 Mon Sep 17 00:00:00 2001 From: jistone Date: Fri, 22 Dec 2006 02:34:05 +0000 Subject: 2006-12-21 Josh Stone PR 3671 * parse.cxx (parser::parse_global): Allow a maxsize on global arrays. * staptree.h (struct vardecl): Add the maxsize field. * staptree.cxx (vardecl::vardecl): Init. maxsize. (vardecl::set_arity): Don't allow arity 0 when there's a maxsize. (vardecl::compatible_arity): Ditto. (vardecl::print): Include maxsize in output. (target_symbol::print): Ditto. * translate.cxx (struct mapvar, mapvar::mapvar): Add maxsize. (mapvar::init): Init maps with the given maxsize if specified, else keep using MAXMAPENTRIES. (mapvar::set): Make the error message give the maxsize. (mapvar::add): Ditto, and check for overflow on pmap add. (c_unparser::getmap): Pass the maxsize from the vardecl to mapvar. --- staptree.h | 1 + 1 file changed, 1 insertion(+) (limited to 'staptree.h') diff --git a/staptree.h b/staptree.h index d4eea008..7585a01f 100644 --- a/staptree.h +++ b/staptree.h @@ -395,6 +395,7 @@ struct vardecl: public symboldecl void set_arity (int arity); bool compatible_arity (int a); int arity; // -1: unknown; 0: scalar; >0: array + int maxsize; // upperbound on size for arrays std::vector index_types; // for arrays only literal *init; // for global scalars only }; -- cgit