mirror of
https://gcc.gnu.org/git/gcc.git
synced 2026-02-22 03:46:53 -05:00
COBOL often requires the conversion of binary integers to string of characters. These changes replace a naive routine that peels decimal digits from a binary value one digit at a time, with a divide-and-conquer algorithm that is twice as fast even for a couple of digits, and is about eight times faster past ten digits. Included here are some minor fixes to the lexer and parser. gcc/cobol/ChangeLog: * cbldiag.h (location_dump): Source code formatting. * parse.y: error_msg formatting. * scan.l: Remove UTF-8 character from regex pattern. * scan_ante.h (numstr_of): error_msg formatting. * show_parse.h (class ANALYZE): Suppress cppcheck error. * util.cc (cbl_field_t::report_invalid_initial_value): error_msg formatting. libgcobol/ChangeLog: * Makefile.am: Include new stringbin.cc file. * Makefile.in: Regenerated. * libgcobol.cc (__gg__power_of_ten): Improve error message. (__gg__binary_to_string): Deleted. (__gg__binary_to_string_internal): Deleted. (int128_to_field): Use new conversion routine. (__gg__move): Use new conversion routine. * stringbin.cc: New file. Implements new conversion routine. * stringbin.h: New file. Likewise.
71 lines
2.1 KiB
Makefile
71 lines
2.1 KiB
Makefile
# Copyright (C) 2025 Free Software Foundation, Inc.
|
|
# Contributed by the Symas Corporation, 2025
|
|
|
|
# This file is part of GCC.
|
|
|
|
# GCC is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 3, or (at your option)
|
|
# any later version.
|
|
|
|
# GCC is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with GCC; see the file COPYING3. If not see
|
|
# <http://www.gnu.org/licenses/>.
|
|
|
|
# Written de novo for libgcobol.
|
|
|
|
AUTOMAKE_OPTIONS = 1.8 foreign
|
|
ACLOCAL_AMFLAGS = -I .. -I ../config
|
|
|
|
# May be used by various substitution variables.
|
|
gcc_version := $(shell @get_gcc_base_ver@ $(top_srcdir)/../gcc/BASE-VER)
|
|
|
|
# Skip the whole process if we are not building libgcobol.
|
|
if BUILD_LIBGCOBOL
|
|
toolexeclib_LTLIBRARIES = libgcobol.la
|
|
toolexeclib_DATA = libgcobol.spec
|
|
|
|
##
|
|
## 2.2.12 Automatic Dependency Tracking
|
|
## Automake generates code for automatic dependency tracking by default
|
|
##
|
|
libgcobol_la_SOURCES = \
|
|
charmaps.cc \
|
|
constants.cc \
|
|
gfileio.cc \
|
|
gmath.cc \
|
|
intrinsic.cc \
|
|
io.cc \
|
|
libgcobol.cc \
|
|
stringbin.cc \
|
|
valconv.cc
|
|
|
|
WARN_CFLAGS = -W -Wall -Wwrite-strings
|
|
|
|
AM_CPPFLAGS = -I. -I$(srcdir) $(LIBQUADINCLUDE)
|
|
AM_CFLAGS = $(XCFLAGS)
|
|
AM_CXXFLAGS = $(XCFLAGS)
|
|
AM_CXXFLAGS += $(WARN_CFLAGS)
|
|
AM_CXXFLAGS += -DIN_TARGET_LIBS
|
|
AM_CXXFLAGS += -fno-strict-aliasing
|
|
|
|
if ENABLE_DARWIN_AT_RPATH
|
|
# Handle embedded rpaths for Darwin.
|
|
extra_ldflags_libgcobol += -Wc,-nodefaultrpaths
|
|
extra_ldflags_libgcobol += -Wl,-rpath,@loader_path
|
|
endif
|
|
|
|
# We want to link with the c++ runtime.
|
|
libgcobol_la_LINK = $(CXXLINK) $(libgcobol_la_LDFLAGS)
|
|
version_arg = -version-info $(LIBGCOBOL_VERSION)
|
|
libgcobol_la_LDFLAGS = $(LTLDFLAGS) $(LIBQUADLIB) $(LTLIBICONV) \
|
|
$(extra_ldflags_libgcobol) $(LIBS) $(version_arg)
|
|
libgcobol_la_DEPENDENCIES = libgcobol.spec $(LIBQUADLIB_DEP)
|
|
|
|
endif BUILD_LIBGCOBOL
|