diff options
Diffstat (limited to 'gcc/cobol/structs.cc')
-rw-r--r-- | gcc/cobol/structs.cc | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/gcc/cobol/structs.cc b/gcc/cobol/structs.cc index 39c8a42..7a4db97 100644 --- a/gcc/cobol/structs.cc +++ b/gcc/cobol/structs.cc @@ -55,7 +55,6 @@ #include "cobol-system.h" #include "coretypes.h" #include "tree.h" -#define HOWEVER_GCC_DEFINES_TREE 1 #include "../../libgcobol/ec.h" #include "../../libgcobol/common-defs.h" #include "util.h" @@ -157,8 +156,8 @@ tree cblc_field_p_type_node; tree cblc_field_pp_type_node; tree cblc_file_type_node; tree cblc_file_p_type_node; +tree cbl_enabled_exception_type_node; tree cblc_goto_type_node; -tree cblc_int128_type_node; // The following functions return type_decl nodes for the various structures @@ -178,7 +177,7 @@ create_cblc_field_t() struct cblc_field_t *parent;// This field's immediate parent field size_t occurs_lower; // non-zero for a table size_t occurs_upper; // non-zero for a table - size_t attr; // See cbl_field_attr_t + uint64_t attr; // See cbl_field_attr_t signed char type; // A one-byte copy of cbl_field_type_t signed char level; // This variable's level in the naming heirarchy signed char digits; // Digits specified in PIC string; e.g. 5 for 99v999 @@ -198,7 +197,7 @@ create_cblc_field_t() CHAR_P, "parent", SIZE_T, "occurs_lower", SIZE_T, "occurs_upper", - SIZE_T, "attr", + ULONGLONG, "attr", SCHAR, "type", SCHAR, "level", SCHAR, "digits", @@ -218,6 +217,7 @@ create_cblc_file_t() typedef struct cblc_file_t { char *name; // This is the name of the structure; might be the name of an environment variable + size_t symbol_index; // The symbol table index of the related cbl_file_t structure char *filename; // The name of the file to be opened FILE *file_pointer; // The FILE *pointer cblc_field_t *default_record; // The record_area @@ -252,8 +252,9 @@ typedef struct cblc_file_t tree retval = NULL_TREE; retval = gg_get_filelevel_struct_type_decl( "cblc_file_t", - 30, + 31, CHAR_P, "name", + SIZE_T, "symbol_table_index", CHAR_P, "filename", FILE_P, "file_pointer", cblc_field_p_type_node, "default_record", @@ -288,30 +289,25 @@ typedef struct cblc_file_t } static tree -create_cblc_int128_t() +create_cbl_enabled_exception_t() { /* - // GCC-13 can't initialize __int64 variables, which is something we need to - // be able to do. So, I created this union. The array can be initialized, - // and thus we do an end run around the problem. Annoying, but not fatally - // so. - - typedef union cblc_int128_t + struct cbl_enabled_exception_t { - unsigned char array16[16]; - __uint128 uval128; - __int128 sval128; - } cblc_int128_t; + bool enabled, location; + ec_type_t ec; + size_t file; + }; */ tree retval = NULL_TREE; - tree array_type = build_array_type_nelts(UCHAR, 16); - retval = gg_get_filelevel_union_type_decl( - "cblc_int128_t", - 3, - array_type, "array16" , - UINT128, "uval128" , - INT128, "sval128" ); + retval = gg_get_filelevel_struct_type_decl( "cbl_enabled_exception_t", + 4, + BOOL, "enabled", + BOOL, "location", + UINT, "ec", + SIZE_T, "file"); retval = TREE_TYPE(retval); + return retval; } @@ -327,7 +323,7 @@ create_our_type_nodes() cblc_field_pp_type_node = build_pointer_type(cblc_field_p_type_node); cblc_file_type_node = create_cblc_file_t(); cblc_file_p_type_node = build_pointer_type(cblc_file_type_node); - cblc_int128_type_node = create_cblc_int128_t(); + cbl_enabled_exception_type_node = create_cbl_enabled_exception_t(); } } |