aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreao <andreao@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-09 10:20:23 +0000
committerandreao <andreao@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-09 10:20:23 +0000
commitbe7dc88cb692b73070d05602cb7711fe180f465d (patch)
treeb85bb79846ee296f66bc0e41f33a4cfa17bf7adf
parentbe91090d7cfb87ae2b7b47f76d6c9bde6a21b2b4 (diff)
get CIL type definitions from .def file
export method value_type_p git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/st/cli-be@149410 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/config/cil32/cil-stack.c13
-rw-r--r--gcc/config/cil32/cil-stack.h38
2 files changed, 12 insertions, 39 deletions
diff --git a/gcc/config/cil32/cil-stack.c b/gcc/config/cil32/cil-stack.c
index 6a5e7d8bf9c..9023d855b53 100644
--- a/gcc/config/cil32/cil-stack.c
+++ b/gcc/config/cil32/cil-stack.c
@@ -47,7 +47,6 @@ Erven Rohou <erven.rohou@inria.fr>
* Local functions prototypes *
******************************************************************************/
-static bool value_type_p (tree);
static bool vector_type_p (tree);
static cil_type_t cil_binary_op_type (enum cil_opcode, cil_type_t, cil_type_t);
@@ -407,7 +406,7 @@ cil_stack_after_stmt (cil_stack stack, cil_stmt stmt)
case CIL_ASM:
/* TODO: Specify a way for asm statements to tell the compiler how
- many stack slots they need. */
+ many stack slots they need. */
break;
default:
@@ -607,7 +606,7 @@ cil_unsigned_int_p (cil_type_t type)
/* Return the CIL stack representation for scalar type TYPE. */
cil_type_t
-scalar_to_cil (tree type)
+scalar_to_cil (const_tree type)
{
unsigned HOST_WIDE_INT size;
@@ -627,7 +626,7 @@ scalar_to_cil (tree type)
case 64: return TYPE_UNSIGNED (type) ? CIL_UNSIGNED_INT64 : CIL_INT64;
default:
internal_error ("Unsupported integer size "
- HOST_WIDE_INT_PRINT_UNSIGNED"\n", size);
+ HOST_WIDE_INT_PRINT_UNSIGNED"\n", size);
}
case REAL_TYPE:
@@ -716,14 +715,14 @@ scalar_to_cil (tree type)
/* Return TRUE if the type specified by TYPE is loaded on the stack as a
value type, FALSE otherwise. */
-static bool
-value_type_p (tree type)
+bool
+value_type_p (const_tree type)
{
switch (TREE_CODE (type))
{
case ARRAY_TYPE:
if (!TYPE_DOMAIN (type) || ARRAY_TYPE_VARLENGTH (type))
- return false; /* Incomplete array types are treated life pointers. */
+ return false; /* Incomplete array types are treated life pointers. */
/* FALLTHROUGH */
case RECORD_TYPE:
diff --git a/gcc/config/cil32/cil-stack.h b/gcc/config/cil32/cil-stack.h
index d827dcdcf08..4edc9b25281 100644
--- a/gcc/config/cil32/cil-stack.h
+++ b/gcc/config/cil32/cil-stack.h
@@ -48,37 +48,10 @@ Erven Rohou <erven.rohou@inria.fr>
enum cil_type
{
- CIL_NO_TYPE,
- CIL_INT8, /* Signed 8-bit integer */
- CIL_INT16, /* Signed 16-bit integer */
- CIL_INT32, /* Signed 32-bit integer */
- CIL_INT64, /* Signed 64-bit integer */
- CIL_NATIVE_INT, /* Signed native integer */
- CIL_UNSIGNED_INT8, /* Unsigned 8-bit integer */
- CIL_UNSIGNED_INT16, /* Unsigned 16-bit integer */
- CIL_UNSIGNED_INT32, /* Unsigned 32-bit integer */
- CIL_UNSIGNED_INT64, /* Unsigned 64-bit integer */
- CIL_NATIVE_UNSIGNED_INT, /* Unsigned native integer */
- CIL_FLOAT, /* On-stack floating-point type*/
- CIL_FLOAT32, /* Single precision floating-point */
- CIL_FLOAT64, /* Double precision floating-point */
- CIL_POINTER, /* Generic pointer */
- CIL_VALUE_TYPE, /* Generic value type */
- /* 4-byte vector types */
- CIL_V2HI, /* Vector of 2 16-bit integers */
- CIL_V4QI, /* Vector of 4 8-bit integers */
- /* 8-byte vector types */
- CIL_V2SI, /* Vector of 2 32-bit integers */
- CIL_V4HI, /* Vector of 4 16-bit integers */
- CIL_V8QI, /* Vector of 8 8-bit integers */
- CIL_V2SF, /* Vector of 2 32-bit single precision floats */
- /* 16-byte vector types */
- CIL_V2DI, /* Vector of 2 64-bit integers */
- CIL_V4SI, /* Vector of 4 32-bit integers */
- CIL_V8HI, /* Vector of 8 16-bit integers */
- CIL_V16QI, /* Vector of 16 8-bit integers */
- CIL_V2DF, /* Vector of 2 64-bit double precision floats */
- CIL_V4SF /* Vector of 4 32-bit single precision floats */
+#define CIL_TYPEDEF(A,B) A,
+#include "cil-types.def"
+#undef CIL_TYPEDEF
+CIL_NUM_STACKTYPES
};
typedef enum cil_type cil_type_t;
@@ -136,6 +109,7 @@ extern bool cil_pointer_p (cil_type_t);
extern bool cil_int_or_smaller_p (cil_type_t);
extern bool cil_long_p (cil_type_t);
extern bool cil_unsigned_int_p (cil_type_t);
-extern cil_type_t scalar_to_cil (tree);
+extern cil_type_t scalar_to_cil (const_tree);
+extern bool value_type_p (const_tree);
#endif /* CIL_STACK_H */