diff options
Diffstat (limited to 'gcc/cobol/cobol1.cc')
-rw-r--r-- | gcc/cobol/cobol1.cc | 58 |
1 files changed, 19 insertions, 39 deletions
diff --git a/gcc/cobol/cobol1.cc b/gcc/cobol/cobol1.cc index d175ab1..4bd79f1 100644 --- a/gcc/cobol/cobol1.cc +++ b/gcc/cobol/cobol1.cc @@ -20,15 +20,15 @@ along with GCC; see the file COPYING3. If not see #include "cobol-system.h" -#include "coretypes.h" -#include "tree.h" -#include "diagnostic.h" -#include "opts.h" -#include "debug.h" -#include "langhooks.h" -#include "langhooks-def.h" -#include "target.h" -#include "stringpool.h" +#include <coretypes.h> +#include <tree.h> +#include <diagnostic.h> +#include <opts.h> +#include <debug.h> +#include <langhooks.h> +#include <langhooks-def.h> +#include <target.h> +#include <stringpool.h> #include "../../libgcobol/ec.h" #include "../../libgcobol/common-defs.h" #include "util.h" @@ -39,7 +39,6 @@ along with GCC; see the file COPYING3. If not see #include "genapi.h" #include "../../libgcobol/exceptl.h" #include "exceptg.h" -#include "util.h" #include "gengen.h" // This has some GTY(()) markers #include "structs.h" // This has some GTY(()) markers @@ -166,8 +165,8 @@ create_our_type_nodes_init() long_double_ten_node = build_real_from_int_cst( LONGDOUBLE, build_int_cst_type(INT,10)); - sizeof_size_t = build_int_cst_type(SIZE_T, sizeof(size_t)); - sizeof_pointer = build_int_cst_type(SIZE_T, sizeof(void *)); + sizeof_size_t = build_int_cst_type(SIZE_T, int_size_in_bytes(SIZE_T)); + sizeof_pointer = build_int_cst_type(SIZE_T, int_size_in_bytes(VOID_P)); bool_true_node = build2(EQ_EXPR, integer_type_node, @@ -294,7 +293,7 @@ cobol_langhook_init_options_struct (struct gcc_options *opts) { cobol_set_debugging( false, false, false ); - copybook_directory_add( getenv("GCOB_COPYBOOK") ); + copybook_directory_add( getenv("GCOBOL_COPYBOOK") ); } static unsigned int @@ -357,6 +356,10 @@ cobol_langhook_handle_option (size_t scode, copybook_extension_add(cobol_copyext); return true; + case OPT_M: + cobol_set_pp_option('M'); + return true; + case OPT_fstatic_call: use_static_call( arg? true : false ); return true; @@ -385,10 +388,6 @@ cobol_langhook_handle_option (size_t scode, return true; } - case OPT_fmax_errors: - flag_max_errors = atoi(arg); - return true; - case OPT_ffixed_form: cobol_set_indicator_column(-7); return true; @@ -413,8 +412,8 @@ cobol_langhook_handle_option (size_t scode, } return true; case OPT_include: - if( ! include_file_add(cobol_include) ) { - cbl_errx( "could not include %s", cobol_include); + if( ! include_file_add(arg) ) { + cbl_errx( "could not include %s", arg); } return true; @@ -572,7 +571,7 @@ cobol_name_mangler(const char *cobol_name_) } // Allocate enough space for a prepended underscore and a final '\0' - char *cobol_name = (char *)xmalloc(strlen(cobol_name_)+2); + char *cobol_name = static_cast<char *>(xmalloc(strlen(cobol_name_)+2)); size_t n = 0; if( cobol_name_[0] >= '0' && cobol_name_[0] <= '9' ) { @@ -646,22 +645,6 @@ cobol_get_sarif_source_language(const char *) return "cobol"; } -bool -cobol_langhook_post_options(const char**) - { - // This flag, when set to 0, results in calls to gg_exit working properly. - // I don't know why it is necessary. There is something going on with the - // definition of __gg__data_return_code in constants.cc, and with how it - // is used through var_decl_return_code in genapi.cc. Without it, the value - // delivered to exit@PLT is zero, and not __gg__data_return_code - // Dubner, 2025-04-04. - flag_strict_aliasing = 0; - - /* Returning false means that the backend should be used. */ - return false; - } - - #undef LANG_HOOKS_BUILTIN_FUNCTION #undef LANG_HOOKS_GETDECLS #undef LANG_HOOKS_GLOBAL_BINDINGS_P @@ -676,7 +659,6 @@ cobol_langhook_post_options(const char**) ////#undef LANG_HOOKS_TYPE_FOR_SIZE #undef LANG_HOOKS_SET_DECL_ASSEMBLER_NAME #undef LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE -#undef LANG_HOOKS_POST_OPTIONS // We use GCC in the name, not GNU, as others do, // because "GnuCOBOL" refers to a different GNU project. @@ -702,8 +684,6 @@ cobol_langhook_post_options(const char**) #define LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE cobol_get_sarif_source_language -#define LANG_HOOKS_POST_OPTIONS cobol_langhook_post_options - struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; #include "gt-cobol-cobol1.h" |