Merge ^/head r358400 through r358465.
This commit is contained in:
commit
91019ea7d4
@ -87,7 +87,6 @@ X${COMPILER}?= ${${COMPILER}}
|
||||
# a cross compiler.
|
||||
.if ${XCC:N${CCACHE_BIN}:M/*}
|
||||
MK_CLANG_BOOTSTRAP= no
|
||||
MK_GCC_BOOTSTRAP= no
|
||||
.endif
|
||||
|
||||
# Pull in compiler metadata from buildworld/toolchain if possible to avoid
|
||||
@ -207,8 +206,6 @@ _WANT_TOOLCHAIN_CROSS_VARS= t
|
||||
# Which compiler is expected to be used?
|
||||
.if ${MK_CLANG_BOOTSTRAP} == "yes"
|
||||
WANT_COMPILER_TYPE= clang
|
||||
.elif ${MK_GCC_BOOTSTRAP} == "yes"
|
||||
WANT_COMPILER_TYPE= gcc
|
||||
.else
|
||||
WANT_COMPILER_TYPE=
|
||||
.endif
|
||||
@ -224,15 +221,6 @@ WANT_COMPILER_VERSION_FILE= lib/clang/include/clang/Basic/Version.inc
|
||||
WANT_COMPILER_VERSION!= \
|
||||
awk '$$2 == "CLANG_VERSION" {split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \
|
||||
${SRCDIR}/${WANT_COMPILER_VERSION_FILE} || echo unknown
|
||||
.elif ${WANT_COMPILER_TYPE} == "gcc"
|
||||
WANT_COMPILER_FREEBSD_VERSION_FILE= gnu/usr.bin/cc/cc_tools/freebsd-native.h
|
||||
WANT_COMPILER_FREEBSD_VERSION!= \
|
||||
awk '$$2 == "FBSD_CC_VER" {printf("%d\n", $$3)}' \
|
||||
${SRCDIR}/${WANT_COMPILER_FREEBSD_VERSION_FILE} || echo unknown
|
||||
WANT_COMPILER_VERSION_FILE= contrib/gcc/BASE-VER
|
||||
WANT_COMPILER_VERSION!= \
|
||||
awk -F. '{print $$1 * 10000 + $$2 * 100 + $$3}' \
|
||||
${SRCDIR}/${WANT_COMPILER_VERSION_FILE} || echo unknown
|
||||
.endif
|
||||
.export WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_VERSION
|
||||
.endif # !defined(WANT_COMPILER_FREEBSD_VERSION)
|
||||
@ -243,7 +231,7 @@ WANT_COMPILER_VERSION!= \
|
||||
# TARGET_ARCH!=MACHINE_ARCH.
|
||||
.if ${MK_SYSTEM_COMPILER} == "yes" && \
|
||||
defined(WANT_COMPILER_FREEBSD_VERSION) && \
|
||||
(${MK_CLANG_BOOTSTRAP} == "yes" || ${MK_GCC_BOOTSTRAP} == "yes") && \
|
||||
${MK_CLANG_BOOTSTRAP} == "yes" && \
|
||||
!make(xdev*) && \
|
||||
${X_COMPILER_TYPE} == ${WANT_COMPILER_TYPE} && \
|
||||
(${X_COMPILER_TYPE} == "clang" || ${TARGET_ARCH} == ${MACHINE_ARCH}) && \
|
||||
@ -251,7 +239,6 @@ WANT_COMPILER_VERSION!= \
|
||||
${X_COMPILER_FREEBSD_VERSION} == ${WANT_COMPILER_FREEBSD_VERSION}
|
||||
# Everything matches, disable the bootstrap compiler.
|
||||
MK_CLANG_BOOTSTRAP= no
|
||||
MK_GCC_BOOTSTRAP= no
|
||||
USING_SYSTEM_COMPILER= yes
|
||||
.endif # ${WANT_COMPILER_TYPE} == ${COMPILER_TYPE}
|
||||
|
||||
@ -305,7 +292,7 @@ USING_SYSTEM_LINKER?= no
|
||||
|
||||
TEST_SYSTEM_COMPILER_VARS= \
|
||||
USING_SYSTEM_COMPILER MK_SYSTEM_COMPILER \
|
||||
MK_CROSS_COMPILER MK_CLANG_BOOTSTRAP MK_GCC_BOOTSTRAP \
|
||||
MK_CROSS_COMPILER MK_CLANG_BOOTSTRAP \
|
||||
WANT_COMPILER_TYPE WANT_COMPILER_VERSION WANT_COMPILER_VERSION_FILE \
|
||||
WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_FREEBSD_VERSION_FILE \
|
||||
CC COMPILER_TYPE COMPILER_FEATURES COMPILER_VERSION \
|
||||
@ -2128,10 +2115,6 @@ BOOTSTRAPPING_OSRELDATE:= 0
|
||||
_strfile= usr.bin/fortune/strfile
|
||||
.endif
|
||||
|
||||
.if ${MK_GCC} != "no" && ${MK_CXX} != "no"
|
||||
_gperf= gnu/usr.bin/gperf
|
||||
.endif
|
||||
|
||||
.if ${MK_VT} != "no"
|
||||
_vtfontcvt= usr.bin/vtfontcvt
|
||||
.endif
|
||||
@ -2377,7 +2360,6 @@ bootstrap-tools: ${_bt}-links .PHONY
|
||||
${_clang_tblgen} \
|
||||
${_kerberos5_bootstrap_tools} \
|
||||
${_strfile} \
|
||||
${_gperf} \
|
||||
${_dtc} \
|
||||
${_cat} \
|
||||
${_kbdcontrol} \
|
||||
@ -2419,10 +2401,6 @@ bootstrap-tools: ${_bt}-${_tool}
|
||||
_share= share/syscons/scrnmaps
|
||||
.endif
|
||||
|
||||
.if ${MK_GCC} != "no"
|
||||
_gcc_tools= gnu/usr.bin/cc/cc_tools
|
||||
.endif
|
||||
|
||||
.if ${MK_RESCUE} != "no"
|
||||
# rescue includes programs that have build-tools targets
|
||||
_rescue=rescue/rescue
|
||||
@ -2460,8 +2438,7 @@ _bt_clean= ${CLEANDIR}
|
||||
${_libmagic} \
|
||||
usr.bin/mkesdb_static \
|
||||
usr.bin/mkcsmapper_static \
|
||||
usr.bin/vi/catalog \
|
||||
${_gcc_tools}
|
||||
usr.bin/vi/catalog
|
||||
build-tools_${_tool}: .PHONY
|
||||
${_+_}@${ECHODIR} "===> ${_tool} (${_bt_clean:D${_bt_clean},}obj,build-tools)"; \
|
||||
cd ${.CURDIR}/${_tool}; \
|
||||
@ -2530,9 +2507,6 @@ _lld= usr.bin/clang/lld
|
||||
.if ${MK_CLANG_BOOTSTRAP} != "no" || ${MK_LLD_BOOTSTRAP} != "no"
|
||||
_clang_libs= lib/clang
|
||||
.endif
|
||||
.if ${MK_GCC_BOOTSTRAP} != "no"
|
||||
_gcc= gnu/usr.bin/cc
|
||||
.endif
|
||||
.if ${MK_USB} != "no"
|
||||
_usb_tools= stand/usb/tools
|
||||
.endif
|
||||
@ -2551,7 +2525,6 @@ cross-tools: .MAKE .PHONY
|
||||
${_binutils} \
|
||||
${_elftctools} \
|
||||
${_dtrace_tools} \
|
||||
${_gcc} \
|
||||
${_btxld} \
|
||||
${_usb_tools}
|
||||
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \
|
||||
@ -2647,9 +2620,6 @@ SUBDIR_DEPEND_usr.bin/clang= lib/clang
|
||||
NXBDIRS+= lib/clang
|
||||
NXBDIRS+= usr.bin/clang
|
||||
.endif
|
||||
.if ${MK_GCC} != "no"
|
||||
NXBDIRS+= gnu/usr.bin/cc
|
||||
.endif
|
||||
.if ${MK_BINUTILS} != "no"
|
||||
NXBDIRS+= gnu/usr.bin/binutils
|
||||
.endif
|
||||
@ -2713,27 +2683,23 @@ NXBMAKE+= ${NXBMAKEENV} ${MAKE} -f Makefile.inc1 ${NXBMAKEARGS} \
|
||||
TARGET=${NXB_TARGET} TARGET_ARCH=${NXB_TARGET_ARCH} \
|
||||
TARGET_TRIPLE=${MACHINE_TRIPLE:Q}
|
||||
# NXBDIRS is improperly based on MACHINE rather than NXB_TARGET. Need to
|
||||
# invoke a sub-make to reevaluate MK_GCC, etc, for NXBDIRS.
|
||||
# invoke a sub-make to reevaluate MK_CLANG, etc, for NXBDIRS.
|
||||
NXBMAKE+= SUBDIR_OVERRIDE='$${NXBDIRS:M*}'
|
||||
# Need to avoid the -isystem logic when using clang as an external toolchain
|
||||
# even if the TARGET being built for wants GCC.
|
||||
NXBMAKE+= WANT_COMPILER_TYPE='$${X_COMPILER_TYPE}'
|
||||
native-xtools: .PHONY
|
||||
${_+_}cd ${.CURDIR}; ${NXBTMAKE} _cleanobj MK_GCC=yes
|
||||
${_+_}cd ${.CURDIR}; ${NXBTMAKE} _cleanobj
|
||||
# Build the bootstrap/host/cross tools that produce native binaries
|
||||
# Pass along MK_GCC=yes to ensure GCC-needed build tools are built.
|
||||
# We don't quite know what the NXB_TARGET wants so just build it.
|
||||
${_+_}cd ${.CURDIR}; ${NXBTMAKE} kernel-toolchain MK_GCC=yes
|
||||
${_+_}cd ${.CURDIR}; ${NXBTMAKE} kernel-toolchain
|
||||
# Populate includes/libraries sysroot that produce native binaries.
|
||||
# This is split out from 'toolchain' above mostly so that target LLVM
|
||||
# libraries have a proper LLVM_DEFAULT_TARGET_TRIPLE without
|
||||
# polluting the cross-compiler build. The LLVM/GCC libs are skipped
|
||||
# here to avoid the problem but are kept in 'toolchain' so that
|
||||
# needed build tools are built.
|
||||
${_+_}cd ${.CURDIR}; ${NXBTMAKE} _includes MK_CLANG=no MK_GCC=no
|
||||
${_+_}cd ${.CURDIR}; ${NXBTMAKE} _libraries MK_CLANG=no MK_GCC=no
|
||||
# Clean out improper TARGET=MACHINE files
|
||||
${_+_}cd ${.CURDIR}/gnu/usr.bin/cc/cc_tools; ${NXBTMAKE} cleandir
|
||||
${_+_}cd ${.CURDIR}; ${NXBTMAKE} _includes MK_CLANG=no
|
||||
${_+_}cd ${.CURDIR}; ${NXBTMAKE} _libraries MK_CLANG=no
|
||||
.if !defined(NO_OBJWALK)
|
||||
${_+_}cd ${.CURDIR}; ${NXBMAKE} _obj
|
||||
.endif
|
||||
@ -2781,7 +2747,7 @@ _prereq_libs+= lib/libssp_nonshared
|
||||
|
||||
# These dependencies are not automatically generated:
|
||||
#
|
||||
# gnu/lib/libgcc, lib/csu and lib/libc must be built before
|
||||
# lib/csu and lib/libc must be built before
|
||||
# all shared libraries for ELF.
|
||||
#
|
||||
_startup_libs= lib/csu
|
||||
@ -2791,7 +2757,6 @@ _startup_libs+= lib/libc_nonshared
|
||||
_startup_libs+= lib/libcxxrt
|
||||
.endif
|
||||
|
||||
.if ${MK_LLVM_LIBUNWIND} != "no"
|
||||
_prereq_libs+= lib/libgcc_eh lib/libgcc_s
|
||||
_startup_libs+= lib/libgcc_eh lib/libgcc_s
|
||||
|
||||
@ -2800,7 +2765,6 @@ lib/libgcc_s__L: lib/libc_nonshared__L
|
||||
.if ${MK_LIBCPLUSPLUS} != "no"
|
||||
lib/libcxxrt__L: lib/libgcc_s__L
|
||||
.endif
|
||||
.endif
|
||||
|
||||
_prebuild_libs= ${_kerberos5_lib_libasn1} \
|
||||
${_kerberos5_lib_libhdb} \
|
||||
@ -2832,12 +2796,6 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \
|
||||
${_secure_lib_libcrypto} ${_secure_lib_libssl} \
|
||||
${_lib_libldns} ${_secure_lib_libssh}
|
||||
|
||||
.if ${MK_GNUCXX} != "no"
|
||||
_prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++
|
||||
gnu/lib/libstdc++__L: lib/msun__L
|
||||
gnu/lib/libsupc++__L: gnu/lib/libstdc++__L
|
||||
.endif
|
||||
|
||||
.if ${MK_DIALOG} != "no"
|
||||
_prebuild_libs+= gnu/lib/libdialog
|
||||
gnu/lib/libdialog__L: lib/msun__L lib/ncurses/ncursesw__L
|
||||
@ -2995,12 +2953,8 @@ lib/libradius__L: lib/libmd__L
|
||||
|
||||
lib/libproc__L: \
|
||||
${_cddl_lib_libctf:D${_cddl_lib_libctf}__L} lib/libelf__L lib/librtld_db__L lib/libutil__L
|
||||
.if ${MK_CXX} != "no"
|
||||
.if ${MK_LIBCPLUSPLUS} != "no"
|
||||
.if ${MK_CXX} != "no" && ${MK_LIBCPLUSPLUS} != "no"
|
||||
lib/libproc__L: lib/libcxxrt__L
|
||||
.else # This implies MK_GNUCXX != "no"; see lib/libproc
|
||||
lib/libproc__L: gnu/lib/libsupc++__L
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.for _lib in ${_prereq_libs}
|
||||
@ -3358,7 +3312,6 @@ _xb-worldtmp: .PHONY
|
||||
_xb-bootstrap-tools: .PHONY
|
||||
.for _tool in \
|
||||
${_clang_tblgen} \
|
||||
${_gperf} \
|
||||
${_yacc}
|
||||
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \
|
||||
cd ${.CURDIR}/${_tool}; \
|
||||
@ -3377,8 +3330,7 @@ XDEVDIRS= \
|
||||
${_binutils} \
|
||||
${_elftctools} \
|
||||
usr.bin/ar \
|
||||
${_clang} \
|
||||
${_gcc}
|
||||
${_clang}
|
||||
|
||||
_xb-cross-tools: .PHONY
|
||||
.for _tool in ${XDEVDIRS}
|
||||
|
@ -273,6 +273,621 @@ OLD_DIRS+=usr/lib/clang/9.0.1/lib/freebsd
|
||||
OLD_DIRS+=usr/lib/clang/9.0.1/lib
|
||||
OLD_DIRS+=usr/lib/clang/9.0.1
|
||||
|
||||
# 20200229: GCC 4.2.1 removed
|
||||
.if !defined(WITH_PORT_BASE_GCC)
|
||||
OLD_FILES+=usr/bin/g++
|
||||
OLD_FILES+=usr/bin/gcc
|
||||
OLD_FILES+=usr/share/man/man1/g++.1.gz
|
||||
OLD_FILES+=usr/share/man/man1/gcc.1.gz
|
||||
.endif
|
||||
OLD_FILES+=usr/bin/gcpp
|
||||
OLD_FILES+=usr/bin/gperf
|
||||
OLD_FILES+=usr/include/c++/4.2/algorithm
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/algo.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/algobase.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/alloc.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/backward_warning.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/bvector.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/complex.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/defalloc.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/deque.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/fstream.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/function.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/hash_map.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/hash_set.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/hashtable.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/heap.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/iomanip.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/iostream.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/istream.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/iterator.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/list.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/map.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/multimap.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/multiset.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/new.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/ostream.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/pair.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/queue.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/rope.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/set.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/slist.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/stack.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/stream.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/streambuf.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/strstream
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/tempbuf.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/tree.h
|
||||
OLD_FILES+=usr/include/c++/4.2/backward/vector.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/allocator.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/atomic_word.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/basic_file.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/basic_ios.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/basic_ios.tcc
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/basic_string.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/basic_string.tcc
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/boost_concept_check.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/c++allocator.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/c++config.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/c++io.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/c++locale.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/c++locale_internal.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/char_traits.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/cmath.tcc
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/codecvt.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/compatibility.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/concept_check.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/cpp_type_traits.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/cpu_defines.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/ctype_base.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/ctype_inline.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/ctype_noninline.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/cxxabi_tweaks.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/deque.tcc
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/fstream.tcc
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/functexcept.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/gslice.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/gslice_array.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/gthr-default.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/gthr-posix.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/gthr-single.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/gthr-tpf.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/gthr.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/indirect_array.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/ios_base.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/istream.tcc
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/list.tcc
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/locale_classes.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/locale_facets.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/locale_facets.tcc
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/localefwd.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/mask_array.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/messages_members.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/os_defines.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/ostream.tcc
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/ostream_insert.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/postypes.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/slice_array.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/sstream.tcc
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_algo.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_algobase.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_bvector.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_construct.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_deque.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_function.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_heap.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_iterator.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_iterator_base_funcs.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_iterator_base_types.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_list.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_map.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_multimap.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_multiset.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_numeric.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_pair.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_queue.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_raw_storage_iter.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_relops.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_set.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_stack.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_tempbuf.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_tree.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_uninitialized.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stl_vector.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stream_iterator.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/streambuf.tcc
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/streambuf_iterator.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/stringfwd.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/time_members.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/valarray_after.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/valarray_array.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/valarray_array.tcc
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/valarray_before.h
|
||||
OLD_FILES+=usr/include/c++/4.2/bits/vector.tcc
|
||||
OLD_FILES+=usr/include/c++/4.2/bitset
|
||||
OLD_FILES+=usr/include/c++/4.2/cassert
|
||||
OLD_FILES+=usr/include/c++/4.2/cctype
|
||||
OLD_FILES+=usr/include/c++/4.2/cerrno
|
||||
OLD_FILES+=usr/include/c++/4.2/cfloat
|
||||
OLD_FILES+=usr/include/c++/4.2/ciso646
|
||||
OLD_FILES+=usr/include/c++/4.2/climits
|
||||
OLD_FILES+=usr/include/c++/4.2/clocale
|
||||
OLD_FILES+=usr/include/c++/4.2/cmath
|
||||
OLD_FILES+=usr/include/c++/4.2/complex
|
||||
OLD_FILES+=usr/include/c++/4.2/csetjmp
|
||||
OLD_FILES+=usr/include/c++/4.2/csignal
|
||||
OLD_FILES+=usr/include/c++/4.2/cstdarg
|
||||
OLD_FILES+=usr/include/c++/4.2/cstddef
|
||||
OLD_FILES+=usr/include/c++/4.2/cstdio
|
||||
OLD_FILES+=usr/include/c++/4.2/cstdlib
|
||||
OLD_FILES+=usr/include/c++/4.2/cstring
|
||||
OLD_FILES+=usr/include/c++/4.2/ctime
|
||||
OLD_FILES+=usr/include/c++/4.2/cwchar
|
||||
OLD_FILES+=usr/include/c++/4.2/cwctype
|
||||
OLD_FILES+=usr/include/c++/4.2/cxxabi.h
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/bitset
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/debug.h
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/deque
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/formatter.h
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/functions.h
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/hash_map
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/hash_map.h
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/hash_multimap.h
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/hash_multiset.h
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/hash_set
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/hash_set.h
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/list
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/macros.h
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/map
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/map.h
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/multimap.h
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/multiset.h
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/safe_base.h
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/safe_iterator.h
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/safe_iterator.tcc
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/safe_sequence.h
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/set
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/set.h
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/string
|
||||
OLD_FILES+=usr/include/c++/4.2/debug/vector
|
||||
OLD_FILES+=usr/include/c++/4.2/deque
|
||||
OLD_FILES+=usr/include/c++/4.2/exception
|
||||
OLD_FILES+=usr/include/c++/4.2/exception_defines.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/algorithm
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/array_allocator.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/atomicity.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/bitmap_allocator.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/codecvt_specializations.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/concurrence.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/debug_allocator.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/functional
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/hash_fun.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/hash_map
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/hash_set
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/hashtable.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/iterator
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/malloc_allocator.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/memory
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/mt_allocator.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/new_allocator.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/numeric
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/numeric_traits.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/assoc_container.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/basic_tree_policy/basic_tree_policy_base.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/basic_tree_policy/null_node_metadata.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/basic_tree_policy/traits.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/basic_types.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/bin_search_tree_/bin_search_tree_.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/bin_search_tree_/cond_dtor_entry_dealtor.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/bin_search_tree_/cond_key_dtor_entry_dealtor.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/bin_search_tree_/constructors_destructor_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/bin_search_tree_/debug_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/bin_search_tree_/erase_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/bin_search_tree_/find_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/bin_search_tree_/info_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/bin_search_tree_/insert_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/bin_search_tree_/iterators_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/bin_search_tree_/node_iterators.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/bin_search_tree_/point_iterators.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/bin_search_tree_/policy_access_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/bin_search_tree_/r_erase_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/bin_search_tree_/rotate_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/bin_search_tree_/split_join_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/bin_search_tree_/traits.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binary_heap_/const_iterator.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binary_heap_/const_point_iterator.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binary_heap_/constructors_destructor_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binary_heap_/debug_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binary_heap_/entry_cmp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binary_heap_/entry_pred.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binary_heap_/erase_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binary_heap_/find_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binary_heap_/info_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binary_heap_/insert_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binary_heap_/iterators_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binary_heap_/policy_access_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binary_heap_/resize_policy.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binary_heap_/split_join_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binary_heap_/trace_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binomial_heap_/binomial_heap_.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binomial_heap_/constructors_destructor_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binomial_heap_/debug_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binomial_heap_base_/binomial_heap_base_.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binomial_heap_base_/constructors_destructor_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binomial_heap_base_/debug_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binomial_heap_base_/erase_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binomial_heap_base_/find_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binomial_heap_base_/insert_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/binomial_heap_base_/split_join_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/cc_ht_map_.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/cmp_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/cond_key_dtor_entry_dealtor.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/debug_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/debug_no_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/debug_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/entry_list_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/erase_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/erase_no_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/erase_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/find_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/find_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/info_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/insert_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/insert_no_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/insert_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/iterators_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/policy_access_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/resize_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/resize_no_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/resize_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/size_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/standard_policies.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cc_hash_table_map_/trace_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/cond_dealtor.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/constructors_destructor_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/container_base_dispatch.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/eq_fn/eq_by_less.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/eq_fn/hash_eq_fn.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_no_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/constructor_destructor_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/debug_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/debug_no_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/debug_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/erase_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/erase_no_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/erase_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/find_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/find_no_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/find_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/gp_ht_map_.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/info_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/insert_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/insert_no_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/insert_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/iterator_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/policy_access_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/resize_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/resize_no_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/resize_store_hash_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/standard_policies.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/gp_hash_table_map_/trace_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/hash_fn/direct_mask_range_hashing_imp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/hash_fn/direct_mod_range_hashing_imp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/hash_fn/linear_probe_fn_imp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/hash_fn/mask_based_range_hashing.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/hash_fn/mod_based_range_hashing.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/hash_fn/probe_fn_base.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/hash_fn/quadratic_probe_fn_imp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/hash_fn/ranged_hash_fn.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/hash_fn/ranged_probe_fn.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/hash_fn/sample_probe_fn.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/hash_fn/sample_range_hashing.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/hash_fn/sample_ranged_hash_fn.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/hash_fn/sample_ranged_probe_fn.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/const_iterator.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/const_point_iterator.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/constructors_destructor_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/debug_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/erase_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/info_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/insert_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/iterators_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/left_child_next_sibling_heap_.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/node.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/null_metadata.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/policy_access_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/left_child_next_sibling_heap_/trace_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/list_update_map_/constructor_destructor_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/list_update_map_/debug_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/list_update_map_/entry_metadata_base.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/list_update_map_/erase_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/list_update_map_/find_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/list_update_map_/info_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/list_update_map_/insert_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/list_update_map_/iterators_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/list_update_map_/lu_map_.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/list_update_map_/trace_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/list_update_policy/counter_lu_metadata.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/list_update_policy/counter_lu_policy_imp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/list_update_policy/mtf_lu_policy_imp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/list_update_policy/sample_update_policy.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/map_debug_base.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/ov_tree_map_/cond_dtor.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/ov_tree_map_/constructors_destructor_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/ov_tree_map_/debug_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/ov_tree_map_/erase_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/ov_tree_map_/info_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/ov_tree_map_/insert_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/ov_tree_map_/iterators_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/ov_tree_map_/node_iterators.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/ov_tree_map_/ov_tree_map_.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/ov_tree_map_/policy_access_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/ov_tree_map_/split_join_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/ov_tree_map_/traits.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pairing_heap_/constructors_destructor_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pairing_heap_/debug_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pairing_heap_/erase_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pairing_heap_/find_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pairing_heap_/insert_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pairing_heap_/pairing_heap_.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pairing_heap_/split_join_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/child_iterator.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/cond_dtor_entry_dealtor.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/const_child_iterator.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/constructors_destructor_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/debug_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/erase_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/find_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/head.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/info_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/insert_join_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/internal_node.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/iterators_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/leaf.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/node_base.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/node_iterators.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/node_metadata_base.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/pat_trie_.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/point_iterators.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/policy_access_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/r_erase_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/rotate_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/split_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/split_join_branch_bag.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/synth_e_access_traits.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/trace_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/traits.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/pat_trie_/update_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/priority_queue_base_dispatch.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rb_tree_map_/constructors_destructor_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rb_tree_map_/debug_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rb_tree_map_/erase_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rb_tree_map_/find_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rb_tree_map_/info_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rb_tree_map_/insert_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rb_tree_map_/node.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rb_tree_map_/rb_tree_.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rb_tree_map_/split_join_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rb_tree_map_/traits.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rc_binomial_heap_/constructors_destructor_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rc_binomial_heap_/debug_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rc_binomial_heap_/erase_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rc_binomial_heap_/insert_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rc_binomial_heap_/rc.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rc_binomial_heap_/rc_binomial_heap_.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rc_binomial_heap_/split_join_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/rc_binomial_heap_/trace_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/resize_policy/cc_hash_max_collision_check_resize_trigger_imp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/resize_policy/hash_exponential_size_policy_imp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_imp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/resize_policy/hash_load_check_resize_trigger_size_base.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/resize_policy/hash_prime_size_policy_imp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/resize_policy/hash_standard_resize_policy_imp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/resize_policy/sample_resize_trigger.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/resize_policy/sample_size_policy.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/splay_tree_/constructors_destructor_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/splay_tree_/debug_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/splay_tree_/erase_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/splay_tree_/find_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/splay_tree_/info_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/splay_tree_/insert_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/splay_tree_/node.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/splay_tree_/splay_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/splay_tree_/splay_tree_.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/splay_tree_/split_join_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/splay_tree_/traits.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/standard_policies.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/thin_heap_/constructors_destructor_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/thin_heap_/debug_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/thin_heap_/erase_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/thin_heap_/find_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/thin_heap_/insert_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/thin_heap_/split_join_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/thin_heap_/thin_heap_.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/thin_heap_/trace_fn_imps.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/tree_policy/node_metadata_selector.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/tree_policy/null_node_update_imp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/tree_policy/order_statistics_imp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/tree_policy/sample_tree_node_update.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/tree_trace_base.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/trie_policy/node_metadata_selector.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/trie_policy/null_node_update_imp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/trie_policy/order_statistics_imp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/trie_policy/prefix_search_node_update_imp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/trie_policy/sample_trie_e_access_traits.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/trie_policy/sample_trie_node_update.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/trie_policy/string_trie_e_access_traits_imp.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/trie_policy/trie_policy_base.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/type_utils.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/types_traits.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/unordered_iterator/const_iterator.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/unordered_iterator/const_point_iterator.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/unordered_iterator/iterator.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/detail/unordered_iterator/point_iterator.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/exception.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/hash_policy.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/list_update_policy.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/priority_queue.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/tag_and_trait.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/tree_policy.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pb_ds/trie_policy.hpp
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pod_char_traits.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/pool_allocator.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/rb_tree
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/rc_string_base.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/rope
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/ropeimpl.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/slist
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/sso_string_base.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/stdio_filebuf.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/stdio_sync_filebuf.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/throw_allocator.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/type_traits.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/typelist.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/vstring.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/vstring.tcc
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/vstring_fwd.h
|
||||
OLD_FILES+=usr/include/c++/4.2/ext/vstring_util.h
|
||||
OLD_FILES+=usr/include/c++/4.2/fstream
|
||||
OLD_FILES+=usr/include/c++/4.2/functional
|
||||
OLD_FILES+=usr/include/c++/4.2/iomanip
|
||||
OLD_FILES+=usr/include/c++/4.2/ios
|
||||
OLD_FILES+=usr/include/c++/4.2/iosfwd
|
||||
OLD_FILES+=usr/include/c++/4.2/iostream
|
||||
OLD_FILES+=usr/include/c++/4.2/istream
|
||||
OLD_FILES+=usr/include/c++/4.2/iterator
|
||||
OLD_FILES+=usr/include/c++/4.2/limits
|
||||
OLD_FILES+=usr/include/c++/4.2/list
|
||||
OLD_FILES+=usr/include/c++/4.2/locale
|
||||
OLD_FILES+=usr/include/c++/4.2/map
|
||||
OLD_FILES+=usr/include/c++/4.2/memory
|
||||
OLD_FILES+=usr/include/c++/4.2/new
|
||||
OLD_FILES+=usr/include/c++/4.2/numeric
|
||||
OLD_FILES+=usr/include/c++/4.2/ostream
|
||||
OLD_FILES+=usr/include/c++/4.2/queue
|
||||
OLD_FILES+=usr/include/c++/4.2/set
|
||||
OLD_FILES+=usr/include/c++/4.2/sstream
|
||||
OLD_FILES+=usr/include/c++/4.2/stack
|
||||
OLD_FILES+=usr/include/c++/4.2/stdexcept
|
||||
OLD_FILES+=usr/include/c++/4.2/streambuf
|
||||
OLD_FILES+=usr/include/c++/4.2/string
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/array
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/bind_iterate.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/bind_repeat.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/boost_shared_ptr.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/cctype
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/cfenv
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/cfloat
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/cinttypes
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/climits
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/cmath
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/common.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/complex
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/cstdarg
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/cstdbool
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/cstdint
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/cstdio
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/cstdlib
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/ctgmath
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/ctime
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/ctype.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/cwchar
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/cwctype
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/fenv.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/float.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/functional
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/functional_hash.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/functional_iterate.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/hashtable
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/hashtable_policy.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/inttypes.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/limits.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/math.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/memory
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/mu_iterate.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/random
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/random.tcc
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/ref_fwd.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/ref_wrap_iterate.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/repeat.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/stdarg.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/stdbool.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/stdint.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/stdio.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/stdlib.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/tgmath.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/tuple
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/tuple_defs.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/tuple_iterate.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/type_traits
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/type_traits_fwd.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/unordered_map
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/unordered_set
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/utility
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/wchar.h
|
||||
OLD_FILES+=usr/include/c++/4.2/tr1/wctype.h
|
||||
OLD_FILES+=usr/include/c++/4.2/typeinfo
|
||||
OLD_FILES+=usr/include/c++/4.2/utility
|
||||
OLD_FILES+=usr/include/c++/4.2/valarray
|
||||
OLD_FILES+=usr/include/c++/4.2/vector
|
||||
.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
|
||||
OLD_FILES+=usr/include/gcc/4.2/__wmmintrin_aes.h
|
||||
OLD_FILES+=usr/include/gcc/4.2/__wmmintrin_pclmul.h
|
||||
OLD_FILES+=usr/include/gcc/4.2/ammintrin.h
|
||||
OLD_FILES+=usr/include/gcc/4.2/emmintrin.h
|
||||
OLD_FILES+=usr/include/gcc/4.2/mm3dnow.h
|
||||
OLD_FILES+=usr/include/gcc/4.2/mm_malloc.h
|
||||
OLD_FILES+=usr/include/gcc/4.2/mmintrin.h
|
||||
OLD_FILES+=usr/include/gcc/4.2/pmmintrin.h
|
||||
OLD_FILES+=usr/include/gcc/4.2/tmmintrin.h
|
||||
OLD_FILES+=usr/include/gcc/4.2/wmmintrin.h
|
||||
OLD_FILES+=usr/include/gcc/4.2/xmmintrin.h
|
||||
.elif ${TARGET_ARCH} == "arm"
|
||||
OLD_FILES+=usr/include/gcc/4.2/mmintrin.h
|
||||
.elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64"
|
||||
OLD_FILES+=usr/include/gcc/4.2/altivec.h
|
||||
OLD_FILES+=usr/include/gcc/4.2/ppc-asm.h
|
||||
OLD_FILES+=usr/include/gcc/4.2/spe.h
|
||||
.endif
|
||||
OLD_FILES+=usr/lib/libgcov.a
|
||||
OLD_FILES+=usr/lib/libgomp.a
|
||||
OLD_FILES+=usr/lib/libstdc++.a
|
||||
OLD_FILES+=usr/lib/libstdc++.so
|
||||
OLD_LIBS+=usr/lib/libstdc++.so.6
|
||||
OLD_FILES+=usr/lib/libstdc++_p.a
|
||||
OLD_FILES+=usr/lib/libsupc++.a
|
||||
OLD_FILES+=usr/lib/libsupc++.so
|
||||
OLD_LIBS+=usr/lib/libsupc++.so.1
|
||||
OLD_FILES+=usr/lib/libsupc++_p.a
|
||||
.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64"
|
||||
OLD_FILES+=usr/lib32/libstdc++.a
|
||||
OLD_FILES+=usr/lib32/libstdc++.so
|
||||
OLD_LIBS+=usr/lib32/libstdc++.so.6
|
||||
OLD_FILES+=usr/lib32/libstdc++_p.a
|
||||
OLD_FILES+=usr/lib32/libsupc++.a
|
||||
OLD_FILES+=usr/lib32/libsupc++.so
|
||||
OLD_LIBS+=usr/lib32/libsupc++.so.1
|
||||
OLD_FILES+=usr/lib32/libsupc++_p.a
|
||||
.endif
|
||||
OLD_FILES+=usr/libexec/cc1plus
|
||||
OLD_LIBS+=usr/lib/libgomp.so.1
|
||||
OLD_FILES+=usr/lib/libgomp_p.a
|
||||
OLD_FILES+=usr/lib32/libgcov.a
|
||||
OLD_FILES+=usr/lib32/libgomp.a
|
||||
OLD_LIBS+=usr/lib32/libgomp.so.1
|
||||
OLD_FILES+=usr/lib32/libgomp_p.a
|
||||
OLD_FILES+=usr/libexec/cc1
|
||||
OLD_FILES+=usr/libexec/cc1plus
|
||||
OLD_FILES+=usr/share/man/man1/gcpp.1.gz
|
||||
OLD_FILES+=usr/share/man/man1/gperf.1.gz
|
||||
OLD_FILES+=usr/share/man/man1/gperf.7.gz
|
||||
|
||||
# 20200220: Upgrade of ncurses, shlib bumped to version 9
|
||||
OLD_LIBS+=lib/libncurses.so.8
|
||||
OLD_LIBS+=lib/libncursesw.so.8
|
||||
|
10
UPDATING
10
UPDATING
@ -32,6 +32,16 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW:
|
||||
information about prerequisites and upgrading, if you are not already
|
||||
using clang 3.5.0 or higher.
|
||||
|
||||
20200229:
|
||||
The WITHOUT_LLVM_LIBUNWIND option has been removed. LLVM's libunwind
|
||||
is used by all supported CPU architectures.
|
||||
|
||||
20200229:
|
||||
GCC 4.2.1 has been removed from the tree. The WITH_GCC,
|
||||
WITH_GCC_BOOTSTRAP, and WITH_GNUCXX options are no longer available.
|
||||
Users who wish to build FreeBSD with GCC must use the external toolchain
|
||||
ports or packages.
|
||||
|
||||
20200220:
|
||||
ncurses has been updated to a newer version (6.2-20200215). Given the ABI
|
||||
has changed, users will have to rebuild all the ports that are linked to
|
||||
|
@ -1105,7 +1105,7 @@ dt_vopen(int version, int flags, int *errp,
|
||||
dt_provmod_open(&provmod, &df);
|
||||
|
||||
dtfd = open("/dev/dtrace/dtrace", O_RDWR | O_CLOEXEC);
|
||||
err = errno; /* save errno from opening dtfd */
|
||||
err = dtfd == -1 ? errno : 0; /* save errno from opening dtfd */
|
||||
#if defined(__FreeBSD__)
|
||||
/*
|
||||
* Automatically load the 'dtraceall' module if we couldn't open the
|
||||
|
@ -49,7 +49,6 @@
|
||||
# The output, is a set of absolute paths with "SB" like:
|
||||
#.nf
|
||||
#
|
||||
# $SB/obj-i386/bsd/gnu/lib/libgcc
|
||||
# $SB/obj-i386/bsd/include
|
||||
# $SB/obj-i386/bsd/lib/csu/i386
|
||||
# $SB/obj-i386/bsd/lib/libc
|
||||
|
@ -1 +0,0 @@
|
||||
4.2.1
|
@ -1,340 +0,0 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program 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 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
@ -1,504 +0,0 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,951 +0,0 @@
|
||||
2010-03-16 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 7760213
|
||||
* c-common.h (HasByrefArray): New decl.
|
||||
* c-common.c (HasByrefArray): New definition.
|
||||
* c-typeck.c (build_external_ref): Diagnose access of
|
||||
__block array.
|
||||
|
||||
2010-03-12 Jim Grosbach <grosbach@apple.com>
|
||||
|
||||
Radar 7744816
|
||||
|
||||
* expmed.c (synth_mult): Remove incorrect special case handling for
|
||||
0xffffffff.
|
||||
|
||||
2010-03-12 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 7735196
|
||||
* c-parser.c (build_block_struct_initlist):
|
||||
Set BLOCK_USE_STRET flag in block descriptor for
|
||||
blocks which return their aggregate value in memory.
|
||||
* c-common.h (BLOCK_USE_STRET): New flag.
|
||||
|
||||
2010-03-05 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 7721728
|
||||
* c-typeck.c (build_external_ref): Diagnose
|
||||
importation of copied-in variables.
|
||||
|
||||
2009-03-12 Caroline Tice <ctice@apple.com>
|
||||
|
||||
Radar 6144634
|
||||
* c-parser.c (c_parser_statement_after_labels): When
|
||||
re-setting the expression location at the end, use the input
|
||||
location for Block pointer assignments.
|
||||
|
||||
2009-02-11 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6573923
|
||||
* c-decl.c (synth_block_byref_id_object_copy_func,
|
||||
synth_block_byref_id_object_dispose_func): Set BLOCK_BYREF_CALLER
|
||||
flag in call to copy/dispose helper functions.
|
||||
* c-common.h (BLOCK_BYREF_CALLER): New flag.
|
||||
|
||||
2008-12-21 Caroline Tice <ctice@apple.com>
|
||||
|
||||
Radar 6455678
|
||||
* cp/typeck.c (original_type): Stop if the type
|
||||
and its DECL_ORIGINAL_TYPE are the same.
|
||||
|
||||
2008-12-18 Bill Wendling <wendling@apple.com>
|
||||
|
||||
Radar 6457359
|
||||
* c-parser.c (build_block_struct_initlist): Changed type.
|
||||
* cp/parser.c (build_block_struct_initlist): Ditto.
|
||||
|
||||
2008-12-02 Caroline Tice <ctice@apple.com>
|
||||
|
||||
Radar 6386976
|
||||
* objcp/objcp-decl.h (TYPE_HAS_OBJCXX_INFO): New macro.
|
||||
* objcp/objcp-lang.c (objcp-decl.h): New include statement, with
|
||||
required define.
|
||||
(LANG_HOOKS_IS_RUNTIME_SPECIFIC_TYPE): Redefine for
|
||||
obj-c++.
|
||||
(objcxx_is_runtime_type): New function.
|
||||
|
||||
2008-12-02 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6411649
|
||||
* funciton.h: Added new field.
|
||||
* c-common.c (build_block_helper_name): Produce a unique
|
||||
block number per each enclosing function when building
|
||||
the block helper function name.
|
||||
|
||||
2008-11-18 Stuart Hastings <stuart@apple.com>
|
||||
|
||||
Radar 6353006
|
||||
* tree.c (generic_block_literal_struct_type): Fix APPLE LOCAL.
|
||||
* langhooks-def.h (lhd_build_generic_block_struct_type): Fix
|
||||
APPLE LOCAL.
|
||||
|
||||
2008-11-07 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5847976
|
||||
* c-decl.c (synth_block_byref_id_object_copy_func): Takes a new
|
||||
'flag' argument and generates the much simplified API.
|
||||
(synth_block_byref_id_object_dispose_func): Ditto.
|
||||
(new_block_byref_decl): Hack to prevent issuing bogus warning
|
||||
on a field declared as __weak.
|
||||
(init_byref_decl): Takes an additional 'flag' argument
|
||||
and passes it down to synth_block_byref_id_object_copy_func and
|
||||
synth_block_byref_id_object_dispose_func.
|
||||
(finish_decl): Computes the flag for the block variable declaration.
|
||||
* c-common.c (build_block_byref_release_decl,
|
||||
build_block_byref_assign_copy_decl): Removed.
|
||||
(build_block_byref_release_exp): Use the new API.
|
||||
(build_block_object_assign_decl, build_block_object_assign_call_exp,
|
||||
build_block_object_dispose_decl, build_block_object_dispose_call_exp): New.
|
||||
(build_indirect_object_id_exp): Fixed a code gen bug which was exposed in
|
||||
c/c++ mode, but not in ObjC/ObjC++ mode.
|
||||
* c-common.h (build_block_object_assign_call_exp,
|
||||
build_block_object_dispose_call_exp,
|
||||
objc_is_gcable_type): New decls.
|
||||
Declaration of several new flags.
|
||||
(cast_to_pointer_to_id): Removed.
|
||||
* stub-objc.c (objc_is_gcable_type): New
|
||||
(copy_in_object, retain_block_component, release_block_component): Removed.
|
||||
(cast_to_pointer_to_id): Removed.
|
||||
* c-parser.c (build_block_struct_initlist): Remove call to copy_in_object.
|
||||
(synth_copy_helper_block_func): Generates much simplified API.
|
||||
(synth_destroy_helper_block_func): Ditto.
|
||||
(block_object_dispose): Removed.
|
||||
* config/darwin-c.c (darwin_cpp_builtins): Define __weak even when
|
||||
-fobjc-gc is off.
|
||||
|
||||
2008-10-31 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6175959
|
||||
* stub-objc.c (block_requires_copying): Object pointers with
|
||||
NSObject attribute also require copy/release API.
|
||||
* c-parser.c (synth_copy_helper_block_func): Use the new API
|
||||
_Block_object_assign for ObjC object copying.
|
||||
(block_object_dispose): New
|
||||
(synth_destroy_helper_block_func): Call block_object_dispose
|
||||
to use new _Block_object_dispose API for ObjC object release.
|
||||
|
||||
2008-10-27 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6231433
|
||||
* c-typeck.c (objc_compare_types, objc_have_common_type):
|
||||
Take an extra argument for better diagnostics.
|
||||
* c-common.c (objc_compare_types, objc_have_common_type):
|
||||
Take extra argument.
|
||||
* stub-objc.c: Ditto
|
||||
|
||||
2008-10-24 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6305545
|
||||
* cgraph.h (lower_if_nested_functions): New decl.
|
||||
* tree-gimple.h (lower_nested_functions): Takes one more arg.
|
||||
* cgraphunit.c (lower_if_nested_functions): New
|
||||
* tree-nested.c (lower_nested_functions): Skip structors.
|
||||
|
||||
2008-10-24 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5847213 (minor tweak)
|
||||
* c-decl.c (build_block_descriptor_type):
|
||||
Make descriptor_ptr_type and descriptor_ptr_type_with_copydispose
|
||||
visible to pch.
|
||||
|
||||
2008-10-23 Caroline Tice <ctice@apple.com>
|
||||
|
||||
Radar 6300081
|
||||
* tree.c(build_block_pointer_type): Add call to
|
||||
build_generic_block_struct_type to initialize
|
||||
generic_block_literal_struct_type if necessary.
|
||||
* cp/parser.c (build_generic_block_struct_type): Update comments.
|
||||
(build_block_struct_type): Remove call to
|
||||
build_generic_block_struct_type.
|
||||
(make_block_pointer_declarator): Likewise.
|
||||
* c-decl.c (make_block_pointer_declarator): Likewise.
|
||||
* c-parser.c (build_block_struct_type): Likewise.
|
||||
(build_generic_block_struct_type): Update comments.
|
||||
|
||||
2008-10-22 Caroline Tice <ctice@apple.com>
|
||||
|
||||
Radar 6300081 & Radar 6163705
|
||||
* tree.h (generic_block_literal_struct_type): Extern global variable
|
||||
decl.
|
||||
(build_generic_block_struct_type): New extern function decl.
|
||||
* cp/parser (build_generic_block_struct_type): New function.
|
||||
(build_block_struct_type): Call build_generic_block_struct_type
|
||||
to initialize generic_block_literal_struct_type.
|
||||
(make_block_pointer_declarator): Likewise.
|
||||
(declare_block_prologue_local_vars): Temporarily set input_location
|
||||
to 1 before the start of the block function; re-set input_location at
|
||||
the end of this function.
|
||||
* dwarf2out.c (add_type_attribute): If the type is a
|
||||
BLOCK_POINTER_TYPE, assign it to be a pointer to a
|
||||
generic_block_literal_struct_type.
|
||||
* c-decl.c (make_block_pointer_declarator): Call
|
||||
build_generic_block_struct_type to initialize
|
||||
generic_block_literal_struct_type.
|
||||
* c-common.c (generic_block_literal_struct_type): New global variable.
|
||||
* c-parser.c (build_generic_block_struct_type): New function.
|
||||
(build_block_struct_type): Call build_generic_block_struct_type
|
||||
to initialize generic_block_literal_struct_type.
|
||||
* testsuite/gcc.apple/block-debug-1.c: Fix test to work with new
|
||||
compiler modifications.
|
||||
* testsuite/gcc.apple/block-debug-2.c: Likewise.
|
||||
* testsuite/g++.apple/block-debug-1.C: Likewise.
|
||||
* testsuite/g++.apple/block-debug-2.C: Likewise.
|
||||
|
||||
2008-10-10 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5847213 - New Block ABI
|
||||
* dwarf2out.c (add_type_attribute): Unusuable code
|
||||
for radar 5811943 is removed.
|
||||
* c-decl.c (build_block_byref_decl): Removed unneeded
|
||||
build of block_original_byref_decl_list.
|
||||
(build_block_internal_types): Removed.
|
||||
(build_block_descriptor_type): New routine to build the descriptor type.
|
||||
(make_block_pointer_declarator): Unused code is removed.
|
||||
* c-typeck.c (build_block_call): New code gen for block calls.
|
||||
* c-common.c (invoke_impl_ptr_type): Removed.
|
||||
* c-common.h (block_original_byref_decl_list, build_block_internal_types): Removed
|
||||
(build_block_descriptor_type, BLOCK_HAS_DESCRIPTOR): Decls added.
|
||||
* c-parser.c (build_block_struct_type): Block literal expression internal type
|
||||
is redeclared into its new layout.
|
||||
(build_block_struct_initlist): Initializer list for above type is redone.
|
||||
(build_descriptor_block_decl): New routine to declare the descriptor variable
|
||||
(build_block_literal_tmp): Modified for the new type and initiazation.
|
||||
|
||||
2008-10-06 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6268817
|
||||
* c-decl.c (check_for_loop_decls): Block helper function
|
||||
is OK if declared in a for-loop main statement block.
|
||||
|
||||
2008-10-02 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6246527
|
||||
* attribs.c (decl_attributes): Added support for adding attributes
|
||||
on block pointer variable declarations.
|
||||
* c-common.c (block_delta_format_args): Add
|
||||
(any_recognized_block_attribute): Add
|
||||
* c-common.h (any_recognized_block_attribute): New decl.
|
||||
* c-parser.c (c_parser_block_literal_expr): Call to do the delta
|
||||
on printf attribute.
|
||||
|
||||
2008-09-30 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6225809
|
||||
* c-decl.c (build_block_byref_decl): Add __block vaiables
|
||||
to intervening blocks.
|
||||
|
||||
2008-09-25 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6237713
|
||||
* c-common.c (handle_noreturn_attribute): Add 'noreturn'
|
||||
attribute to block pointer decls.
|
||||
* c-parser.c (c_parser_block_literal_expr): Parse and set
|
||||
attributes on block literals.
|
||||
|
||||
2008-09-25 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6244520 - minor addition
|
||||
* c-common.c (build_indirect_object_id_exp): offset needs
|
||||
be updated to accomodate addition of the new field.
|
||||
|
||||
2008-09-16 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6214617
|
||||
* c-common: New flag BLOCK_HAS_CXX_OBJ replaces BLOCK_NO_COPY.
|
||||
(BlockImportsCxxObjects): New field replaces BlockHasByrefVar.
|
||||
* c-parser.c (build_block_struct_type): Remove setting of
|
||||
BLOCK_NO_COPY flag.
|
||||
|
||||
2008-09-16 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6217257
|
||||
* c-common.c (handle_blocks_attribute): Diagnose
|
||||
vla __block declarations.
|
||||
|
||||
2008-09-12 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6212722 (tweak)
|
||||
* c-decl.c (build_block_ref_decl): Use array_to_pointer_conversion
|
||||
and function_to_pointer_conversion.
|
||||
* c-typeck.c (array_to_pointer_conversion, function_to_pointer_conversion):
|
||||
Made them global.
|
||||
* c-common.h (array_to_pointer_conversion, function_to_pointer_conversion):
|
||||
Declare.
|
||||
|
||||
2008-09-09 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6169580
|
||||
* c-commmon.c (build_block_helper_name): Fix bug in
|
||||
block helper function name mangling.
|
||||
|
||||
2008-09-03 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6185344
|
||||
* c-typeck.c (c_finish_return): Don't do block specific
|
||||
stuff when block has a return type.
|
||||
* c-common.h (block_sema_info): block_has_return_type is
|
||||
a new field.
|
||||
* c-parser.c (c_parser_direct_declarator): Terminate type
|
||||
parsing for block return types.
|
||||
(c_parser_block_literal_expr): Added support to parse and
|
||||
handle explicit return type for blocks.
|
||||
|
||||
2008-08-28 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6160536
|
||||
* c-commmon.c (build_block_helper_name): New
|
||||
* c-common.h (build_block_helper_name): New decl.
|
||||
* c-parser.c (c_parser_block_literal_expr): Call
|
||||
build_block_helper_name to build pretty helper function
|
||||
name.
|
||||
|
||||
2008-08-28 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6180456
|
||||
* c-decl.c (synth_block_byref_id_object_copy_func): Different
|
||||
API for copying __block declared objects in c.
|
||||
(synth_block_byref_id_object_dispose_func): Different API
|
||||
for releasing __block declared objects in c.
|
||||
* c-common.c (block_byref_assign_copy_decl): New
|
||||
(build_indirect_object_id_exp): Cast to 'id *' in objective-c
|
||||
mode only.
|
||||
* c-common.h (build_block_byref_assign_copy_decl): New decl.
|
||||
* c-parser.c (synth_copy_helper_block_func): Refactored code
|
||||
to call build_block_byref_assign_copy_decl().
|
||||
|
||||
2008-08-24 Caroline Tice <ctice@apple.com>
|
||||
|
||||
Radars 6144664, 6145471, 6144634
|
||||
c-decl.c (build_block_byref_decl): Assign the source
|
||||
location for each byref decl to the source location of
|
||||
the helper function decl.
|
||||
(build_block_ref_decl): Ditto for ref decls.
|
||||
|
||||
2008-08-14 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5822844
|
||||
* c-typeck.c (digest_init): Handler block as initializer.
|
||||
(c_finish_return): check for completed block before
|
||||
analyzing block's return expression.
|
||||
* varasm.c (output_constant): Allow outputting block data.
|
||||
* c-common.h (BLOCK_IS_GLOBAL): New flag.
|
||||
(block_is_complete): New field in block data structure.
|
||||
* c-parser.c (build_block_struct_initlist): New initializer and
|
||||
flag for global block data.
|
||||
(build_block_literal_tmp): Temporary data for global block is
|
||||
declared as global static.
|
||||
(c_parser_block_literal_expr): Removed diagnostics for global blocks.
|
||||
Moved fixing helper function type earlier before its tree is built.
|
||||
|
||||
2008-08-06 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6014138
|
||||
* c-decl.c (build_block_byref_decl): In the presence of nested "{"
|
||||
move up the scope chain until reaching the main function body's scope.
|
||||
|
||||
2008-08-04 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6040305 - work in progress.
|
||||
* c-decl.c (build_indirect_object_id_exp): Removed.
|
||||
* c-common.c (build_indirect_object_id_exp): Added
|
||||
* c-common.h (build_indirect_object_id_exp): New decl.
|
||||
* config/darwin-c.c (darwin_cpp_builtins): Define __byref
|
||||
in c++ mode as well.
|
||||
|
||||
2008-07-18 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6083129 - twiked
|
||||
* c-decl.c (release_all_local_byrefs_at_return): Do not release
|
||||
imported __byref variables in the block.
|
||||
* c-parser.c (gen_block_byref_release_exp): Do not release __byref
|
||||
variables outside of the block when returning from the block.
|
||||
|
||||
2008-07-15 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5988451
|
||||
* c-decl.c (build_block_ref_decl): Insert copied in variable
|
||||
in each enclosing block which does not use it.
|
||||
(begin_block): Remove setting of "the_scope" field of the block.
|
||||
(in_imm_block): Fix effect of changing the "the_scope" field.
|
||||
(lookup_name_in_block): Do not skip over copied-in variables when
|
||||
looking up a variable in the block.
|
||||
* c-parser.c (c_parser_block_literal_expr): Set block's "the_scope" field
|
||||
to the helper function's outer-most body scope.
|
||||
|
||||
2008-07-08 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 6048570
|
||||
* c-typeck.c (c_finish_return): Error on returning a block on the stack.
|
||||
|
||||
2008-06-05 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5988995
|
||||
* c-typeck.c (types_are_closure_compatible): Nested block pointer
|
||||
types must be considered when matching block types.
|
||||
|
||||
2008-06-05 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5982990
|
||||
* c-parser.c (c_parser_objc_synch_compound_statement): New
|
||||
(c_parser_objc_synchronized_statement): Call
|
||||
c_parser_objc_synch_compound_statement.
|
||||
|
||||
2008-06-04 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5985368
|
||||
* c-parser.c (c_parser_declaration_or_fndef): Better diagnostics for
|
||||
a bad block definition.
|
||||
|
||||
2008-05-23 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5925781
|
||||
* c-common.c (handle_nonnull_attribute): Support block pointer
|
||||
just like a pointer for nonnull attribute.
|
||||
(check_nonnull_arg): Ditto.
|
||||
|
||||
2008-05-20 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5932809 - minor change for runtime delight.
|
||||
* c-parser.c (build_closure_struct_type): Add strcutor fields
|
||||
for __byref 'id' object blocks as well.
|
||||
(build_closure_struct_initlist): And their initializers.
|
||||
|
||||
2008-04-30 Caroline Tice <ctice@apple.com>
|
||||
|
||||
Radar 5811961
|
||||
* c-decl.c: (declare_closure_prologue_local_vars): Set the source
|
||||
location for the new decl expr statement to be the source location of
|
||||
the decl tree.
|
||||
|
||||
2008-04-25 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5803005 (tweaked)
|
||||
* c-typeck.c (build_external_ref): Refactored global decl checks.
|
||||
|
||||
2008-04-24 Caroline Tice <ctice@apple.com>
|
||||
|
||||
Radar 5811943
|
||||
* tree.h (TYPE_CLOSURE_IMPL_STRUCT): New macro.
|
||||
(lang_flag_2): Use previously unused field in tree_type to indicate
|
||||
closure structs.
|
||||
* dwarf2out.c (c-common.h): New include statement.
|
||||
(dwarf_attr_name): Add case for DW_AT_APPLE_closure.
|
||||
(gen_variable_die): Give pointers to closures the
|
||||
invoke_impl_ptr_type.
|
||||
(gen_struct_or_union_type_die): Add DW_AT_APPLE_closure
|
||||
to structs that define closures.
|
||||
* dwarf2.h (DW_AT_APPLE_closure): New Dwarf attribute.
|
||||
* c-typeck.c (invoke_impl_ptr_type): Move declaration from here to
|
||||
c-common.c
|
||||
(build_closure_internal_types): Set TYPE_CLOSURE_IMPL_STRUCT
|
||||
flag for closure structs.
|
||||
* c-common.c (invoke_impl_ptr_type): Move declaration to here from
|
||||
c-typeck.c.
|
||||
|
||||
2008-04-23 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5882266
|
||||
* c-typeck.c (types_are_closure_compatible): Check for underlying
|
||||
pointer types as well.
|
||||
|
||||
2008-04-15 Stuart Hastings <stuart@apple.com>
|
||||
|
||||
Radar 5862465
|
||||
* tree.h (PTR_OR_REF_CHECK, POINTER_TYPE_P): Add
|
||||
CLOSURE_POINTER_TYPE.
|
||||
* fold-const.c (fold_convert): Add CLOSURE_POINTER_TYPE.
|
||||
* testsuite/gcc.apple/closure-5862465.c: New.
|
||||
|
||||
2008-03-31 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5831855
|
||||
* c-typeck.c (convert_for_assignment): Block and 'id' types
|
||||
are interchangeable.
|
||||
|
||||
2008-03-28 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5809099
|
||||
* convert.c (convert_to_pointer): Allow typecast of closure
|
||||
pointer to 'id'.
|
||||
(convert_to_closure_pointer): Allow typecast of 'id'
|
||||
of a closure pointer expression.
|
||||
|
||||
2008-03-25 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5811887 (minor change)
|
||||
* c-opts.c (c_common_post_options): Remove conditional check
|
||||
of pedantic when setting flag_blocks.
|
||||
|
||||
2008-03-24 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5811887
|
||||
* c-cppbuiltin.c: flag_closures renamed to flag_blocks
|
||||
* c-parser.c: Ditto.
|
||||
* c.opt: flag_closures renamed to flag_blocks. flag_blocks
|
||||
defaulted to -1.
|
||||
* c-opts.c (c_common_post_options): All flavors of c99, blocks are off by
|
||||
default unless requested via -fblocks.
|
||||
|
||||
2008-03-24 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5814025
|
||||
* c-tree.h (make_closure_pointer_declarator): Takes
|
||||
additional argument.
|
||||
* c-decl.c (grokdeclarator): Get 'const'-ness of closure
|
||||
pointer.
|
||||
(make_closure_pointer_declarator): Takes additional argument for
|
||||
const/volatile.
|
||||
* c-parser.c (c_parser_declarator): Pass down attribute info.
|
||||
to make_closure_pointer_declarator.
|
||||
|
||||
2008-03-20 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5802025
|
||||
* c-common.h (objc_build_property_getter_func_call): New decl.
|
||||
* stub-objc.c (objc_build_property_getter_func_call): New stub.
|
||||
|
||||
2008-03-18 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5803600
|
||||
* c-decl.c (add_closure_global_byref_list,
|
||||
in_closure_global_byref_list): New defs.
|
||||
* c-common.h (add_closure_global_byref_list,
|
||||
in_closure_global_byref_list): New decls.
|
||||
* c-typeck.c (build_external_ref): global variables
|
||||
declared as 'byref' are enterred in their own list
|
||||
of such declarations per each closure.
|
||||
* c-parser.c (c_parser_postfix_expression): Remove previous fix.
|
||||
(c_parser_closure_byref_declaration): Check for global
|
||||
'byref' by calling in_closure_global_byref_list.
|
||||
|
||||
2008-03-13 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5795493
|
||||
* c-typeck.c: Renamed typesAreClosureCompatible to
|
||||
types_are_closure_compatible.
|
||||
|
||||
2008-03-11 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5732232 (Related to change of command option/macro)
|
||||
* c-cppbuiltin.c: __CLOSURES__ macro rename __BLOCKS__
|
||||
* c.opt: -fclosures change to -fblocks.
|
||||
|
||||
2008-03-10 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5782740 - part 2 (bug fix).
|
||||
* c-parser.c (synth_copy_helper_closure,
|
||||
synth_destroy_helper_closure): set DECL_ARG_TYPE field of input
|
||||
arguments for the two synthesized helper functions.
|
||||
|
||||
2008-02-21 Caroline Tice <ctice@apple.com>
|
||||
|
||||
Radar 5741070
|
||||
* objc/objc-act.c (objc_finish_message_expr): Find
|
||||
the record-type tree from the class interface, and mark the record
|
||||
type as used, for emitting debug info.
|
||||
* cp/cp-objcp-common.c (c_return_interface_record_type): New function.
|
||||
* cp/cp-tree.h (c_return_interface_record_type): New extern function
|
||||
declaration.
|
||||
* c-tree.h (c_return_interface_record_type): Likewise
|
||||
* c-decl.c (c_return_interface_record_type): New function.
|
||||
|
||||
2007-08-22 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4947311
|
||||
* c-common.h (objc_declare_protocols, objc_start_protocol): Decl changed.
|
||||
* stub-objc.c (objc_declare_protocols, objc_start_protocol): Changed.
|
||||
* c-parser.c (c_parser_external_declaration): Call to
|
||||
c_parser_objc_protocol_definition takes additional argument.
|
||||
(c_parser_declaration_or_fndef): Protocols with attributes are processed
|
||||
here by passing it to c_parser_objc_protocol_definition.
|
||||
(c_parser_objc_protocol_definition): Takes additional argument and passes
|
||||
it to objc_declare_protocols or objc_start_protocol.
|
||||
|
||||
2007-07-13 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5277239
|
||||
* c-parser.c (c_parser_next_token_starts_declspecs): Exclude
|
||||
objc2's property dot-syntax as a declarator.
|
||||
(c_parser_postfix_expression): Convert property dot-syntax on
|
||||
class objects into a property reference expression.
|
||||
|
||||
2007-07-10 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5285911
|
||||
* tree.h (CALL_EXPR_OBJC_PROPERTY_GETTER): Macro removed.
|
||||
* c-typeck.c (build_component_ref): Call
|
||||
objc_build_property_reference_expr instead of objc_build_getter_call.
|
||||
(build_modify_expr): Call objc_property_reference_expr instead of
|
||||
objc_property_call.
|
||||
* c-common.h (objc_build_getter_call, objc_property_call): Decl removed.
|
||||
(objc_build_property_reference_expr, objc_property_reference_expr): Decl.
|
||||
added.
|
||||
* stub-objc.c (objc_build_getter_call, objc_property_call): Stub removed.
|
||||
(objc_build_property_reference_expr, objc_property_reference_expr):
|
||||
Stub added.
|
||||
|
||||
2007-06-29 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5276085
|
||||
* c-parser.c (c_parser_binary_expression) : objc_generate_weak_read
|
||||
replaced with call to objc_build_weak_reference_tree
|
||||
* c-typeck.c (build_modify_expr, c_objc_common_truthvalue_conversion):
|
||||
objc_remove_weak_read replaced with call to objc_weak_reference_expr.
|
||||
* c-common.h (objc_weak_reference_expr,
|
||||
objc_build_weak_reference_tree) : New decl.
|
||||
(objc_generate_weak_read, objc_remove_weak_read): remove.
|
||||
* stub-objc.c (objc_weak_reference_expr,
|
||||
objc_build_weak_reference_tree): New stub.
|
||||
(objc_generate_weak_read, objc_remove_weak_read): remove.
|
||||
|
||||
2007-05-23 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5195402
|
||||
* c-format.c (handle_format_arg_attribute): Check for NSString *
|
||||
and CFStringRef as valid formatting types.
|
||||
(check_format_string): Ditto.
|
||||
* c-common.h (objc_check_format_nsstring,
|
||||
objc_check_cfstringref_type): New decls.
|
||||
* stub-objc.c (objc_check_nsstring_pointer_type): New stub.
|
||||
* config/darwin-c.c (objc_check_cfstringref_type): New
|
||||
(objc_check_format_cfstring): Call objc_check_cfstringref_type
|
||||
for valid CFStringRef argument type.
|
||||
* config/darwin-protos.h (objc_check_cfstringref_type): New decl.
|
||||
* config/darwin.h (CFSTRING_TYPE_CHECK): New macro.
|
||||
|
||||
2007-05-18 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 5202926
|
||||
* c-common.h (objc_anonymous_local_objc_name): New decl.
|
||||
* config/darwin-protos.h (objc_anonymous_local_objc_name): Decl.
|
||||
* stub-objc.c (objc_anonymous_local_objc_name): New stub.
|
||||
* config/darwin.h (ASM_OUTPUT_LABELREF) Call
|
||||
objc_anonymous_local_objc_name.
|
||||
|
||||
2007-05-07 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4157812
|
||||
* c-common.h (objc_build_keyword_decl): Takes a new argument.
|
||||
* stub-objc.c (objc_build_keyword_decl): Ditto.
|
||||
* c-parser.c (c_parser_objc_method_decl): Recognize optional
|
||||
method's argument attribute.
|
||||
(c_parser_objc_method_decl): Handle errornous selector.
|
||||
|
||||
2007-05-02 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4502186
|
||||
* c-typeck.c (convert_for_assignment): Remove synthesized 'volatile'
|
||||
type before doing type comparison.
|
||||
|
||||
2007-03-29 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4564694
|
||||
* c-parse.c (c_parser_objc_class_instance_variables): Add @package
|
||||
support to syntax.
|
||||
* c-common.h (RID_AT_PACKAGE): Add
|
||||
|
||||
2007-03-29 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4947014 - objc atomic property
|
||||
* c-common.h (RID_NONATOMIC): Add
|
||||
* c-parse.c (c_parser_objc_property_attribute) : Recognize 'nonatomic'
|
||||
as new property.
|
||||
|
||||
2007-03-23 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4985544
|
||||
* c-format.c (enum format_type): New entry for NSString format.
|
||||
(format_typ): Has a new entry for NSString format.
|
||||
(decode_format_attr): Error on use of NSString format on a
|
||||
non-objective-c program.
|
||||
(objc_check_nsformat_arg): New.
|
||||
(check_format_info): Call back for NSString is objc_check_nsformat_arg
|
||||
(handle_format_attribute): Use objc_check_format_nsstring for
|
||||
NSString format.
|
||||
* c-common.h (objc_NSString_format): New decl.
|
||||
(objc_check_format_nsstring): New decl.
|
||||
* stub-objc.c (objc_NSString_format, objc_check_format_nsstring): New
|
||||
stubs.
|
||||
* config/darwin-protos.h (darwin_cfstring_type_node): New decl.
|
||||
* config/darwin.c (darwin_cfstring_type_node): New
|
||||
* config/darwin.h (TARGET_CFSTRING_P): New macro
|
||||
|
||||
2007-03-23 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4985544
|
||||
* c-format.c (enum format_type): New entry for NSString format.
|
||||
(format_typ): Has a new entry for NSString format.
|
||||
(decode_format_attr): Error on use of NSString format on a
|
||||
non-objective-c program.
|
||||
(objc_check_nsformat_arg): New.
|
||||
(check_format_info): Call back for NSString is objc_check_nsformat_arg
|
||||
(handle_format_attribute): Use objc_check_format_nsstring for
|
||||
NSString format.
|
||||
* c-common.h (objc_NSString_format): New decl.
|
||||
(objc_check_format_nsstring): New decl.
|
||||
* stub-objc.c (objc_NSString_format, objc_check_format_nsstring): New
|
||||
stubs.
|
||||
* config/darwin-protos.h (darwin_cfstring_type_node): New decl.
|
||||
* config/darwin.c (darwin_cfstring_type_node): New
|
||||
* config/darwin.h (TARGET_CFSTRING_P): New macro
|
||||
|
||||
2007-03-22 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4965989
|
||||
* c-parser.c (c_parser_objc_class_definition): Add supprt for anonymous
|
||||
category syntax.
|
||||
|
||||
2007-03-21 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 2848255
|
||||
* c-parser.c (c_parser_objc_try_catch_statement): Parse @catch(...).
|
||||
* c.opt: Add -fobjc-zerocost-exceptions option.
|
||||
* c-opts.c (c_common_post_options): Set the flags for
|
||||
-fobjc-zerocost-exceptions.
|
||||
* c-common.h: Add some declarations.
|
||||
* stub-objc.c (objc2_valid_objc_catch_type, objc2_build_throw_call):
|
||||
New stubs.
|
||||
* config/darwin.h (OBJC_FLAG_OBJC_ABI): Check for proper
|
||||
use of -fobjc-zerocost-exceptions option.
|
||||
|
||||
2006-11-06 Fariborz Jahanian <fjahania@apple.com>
|
||||
|
||||
Radar 4781080 (part 2)
|
||||
* targhooks.c (default_objc_fpreturn_msgcall): Takes 2nd argument.
|
||||
* targhooks.h (default_objc_fpreturn_msgcall): Changed Decl.
|
||||
* target.h (objc_fpreturn_msgcall): Changed Decl.
|
||||
* config/i386/i386.h (OBJC_FPRETURN_MSGCALL): Changed Decl.
|
||||
* config/i386/i386-protos.h (ix86_objc_fpreturn_msgcall): Changed Decl.
|
||||
* config/i386/i386.c (ix86_objc_fpreturn_msgcall): Changed definition.
|
||||
2006-09-15 Fariborz Jahanian <fjahania@apple.com>
|
||||
|
||||
Radar 4727659
|
||||
* c-common.c (handle_noreturn_attribute): Handle method_decl
|
||||
nodes as well.
|
||||
|
||||
2006-09-01 Fariborz Jahanian <fjahania@apple.com>
|
||||
|
||||
Radar 4712269
|
||||
* c-common.h (objc_build_incr_decr_setter_call): New decl.
|
||||
* stub-objc.c (objc_build_incr_decr_setter_call): New stub.
|
||||
* c-typeck.c (build_unary_op): Call objc_build_incr_decr_setter_call
|
||||
for potential ince/decr pre/post expressions involving properties.
|
||||
|
||||
2006-08-31 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4697411
|
||||
* c-common.h (objc_volatilize_component_ref): New decl.
|
||||
* c-typeck.c (build_component_ref): Call objc_volatilize_component_ref.
|
||||
* stub-objc.c (objc_volatilize_component_ref): New stub.
|
||||
|
||||
2006-07-18 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4592503
|
||||
* c-decl.c (finish_struct): Check on illegal use of __weak
|
||||
on struct fields.
|
||||
* decl.c (start_decl): Check on illegal use of __weak on
|
||||
variable declarations.
|
||||
* stub-objc.c (objc_checkon_weak_attribute): New stub.
|
||||
* c-common.h (objc_checkon_weak_attribute): New decl.
|
||||
|
||||
2006-06-26 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4591909
|
||||
* c-parse.in: New/modified grammar for new attributes in
|
||||
properties.
|
||||
(yylexname): Change to recognize new attribute terminals.
|
||||
* c-common.h (RID_DYNAMIC): New enum declaration.
|
||||
|
||||
2006-07-14 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4621020
|
||||
* c-parse.in: Added 'weak' attribute keyword for @property.
|
||||
* c-common.h: 'weak' related declarations.
|
||||
|
||||
2006-05-18 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4548636 (objc attributes on class)
|
||||
* c-parse.in: Add attribute non-terminal before
|
||||
AT_INTERFACE.
|
||||
* c-common.h (objc_start_class_interface): New argument added.
|
||||
* stub-objc.c (objc_start_class_interface): Ditto.
|
||||
|
||||
2006-05-16 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4547045
|
||||
* c-gimplify.c (obj_reuse_bc_block): Removed.
|
||||
(objc_pop_label, objc_push_label): New.
|
||||
(gimplify_c_loop): Fix up foreach's innerloop break label.
|
||||
|
||||
2006-04-26 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 3803157 (method attributes)
|
||||
* c-parse.in: Add grammar support for declaring
|
||||
attribute for objc methods.
|
||||
* c-common.c (handle_deprecated_attribute): Recognize
|
||||
objc methods as valid declarations.
|
||||
(handle_unavailable_attribute): Ditto.
|
||||
* c-common.h: Bunch of new extern declarations.
|
||||
* stub-objc.c (objc_add_method_declaration, objc_start_method_definition):
|
||||
Added new argument.
|
||||
(objc_method_decl): New stub.
|
||||
|
||||
2006-04-12 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4507230
|
||||
* c-common.h (objc_type_valid_for_messaging): Declare.
|
||||
* stub-objc.c (objc_type_valid_for_messaging): New stub.
|
||||
|
||||
2006-04-06 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4436866
|
||||
(Missing copies attribute)
|
||||
* c-parse.in: Add grammer for 'copies' attribute.
|
||||
* c-common.h (RID_COPIES): New enumerator.
|
||||
|
||||
2006-03-27 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4133425
|
||||
* c-common.h (objc_diagnose_private_ivar): New decl.
|
||||
* stub-objc.c (objc_diagnose_private_ivar): New stub.
|
||||
* c-decl.c (undeclared_variable): Issue disnostic on
|
||||
private 'ivar' access.
|
||||
|
||||
2006-03-27 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4491608
|
||||
* c-typeck.c (convert_arguments): function name must come from 'selector'
|
||||
when diagnosing 'too many arguments'.
|
||||
|
||||
2006-03-23 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4193359
|
||||
* c-typeck.c (convert_for_assignment): Remove Objective-C EH machinery
|
||||
'volatile' qualifier before doing type comparison.
|
||||
|
||||
2006-02-28 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4441049
|
||||
* c-common.h (objc_v2_bitfield_ivar_bitpos): New decl.
|
||||
* expr.h (objc_v2_bitfield_ivar_bitpos): New decl.
|
||||
* stub-objc.c (objc_v2_bitfield_ivar_bitpos): New stub.
|
||||
* expr.c (get_inner_reference): Compute ivar's bitfield bit offset.
|
||||
|
||||
2006-02-15 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4445586
|
||||
* c-common.def (DO_STMT): Takes an extra argument.
|
||||
|
||||
2006-02-02 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4426814
|
||||
* c-parse.in (cast_expr): generate objc_read_weak call on
|
||||
each __weak object in the expession.
|
||||
* c-typeck.c (build_modify_expr): Undo the call to objc_read_weak
|
||||
on LHS expression.
|
||||
* c-objc-common.c (c_objc_common_truthvalue_conversion): Generate
|
||||
objc_read_weak call before generating tree for !exp, etc.
|
||||
* c-common.h (objc_generate_weak_read, objc_remove_weak_read): New decl.
|
||||
* stub-objc.c (objc_generate_weak_read, objc_remove_weak_read): New stubs.
|
||||
|
||||
2005-12-15 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4229905
|
||||
* c-typeck.c (build_conditional_expr): Call objc_have_common_type when
|
||||
looking for objective-c common pointer types.
|
||||
* c-common.h objc_have_common_type): New declaration.
|
||||
* stub-objc.c (objc_have_common_type): New stub.
|
||||
|
||||
2005-12-05 Mike Stump <mrs@apple.com>
|
||||
|
||||
Radar 4357979
|
||||
* doc/invoke.texi (C Dialect Options): Improve -fnested-functions wording.
|
||||
* doc/extend.texi (Nested Functions): Note that on darwin nested
|
||||
functions are off by default.
|
||||
|
||||
2005-11-08 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4330422
|
||||
|
||||
* c-common.h (objc_non_volatilized_type): New declaration
|
||||
* stub-objc.c (objc_non_volatilized_type): New stub.
|
||||
|
||||
2005-10-12 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4291785
|
||||
|
||||
* c-common.h (objc_get_interface_ivars): New declaration
|
||||
(objc_detect_field_duplicates): Ditto.
|
||||
* c-decl.c (finish_struct): Check for duplicate among
|
||||
flattened fields if objective-c.
|
||||
* stub-objc.c (objc_get_interface_ivars): New stub.
|
||||
(objc_detect_field_duplicates): Ditto.
|
||||
|
||||
2005-09-28 Devang Patel <dpatel@apple.com>
|
||||
|
||||
Radar 4258406
|
||||
* c-parse.in (nested_function): Report an error, instead of a warning.
|
||||
(nontype_nested_function): Same.
|
||||
* c.opt (Wnested-funcs): Remove.
|
||||
* doc/invoke.texi: Remove Wnested-funcs documentations.
|
||||
|
||||
2005-08-03 Fariborz Jahanian <fjahanian@apple.com>
|
||||
|
||||
Radar 4188876
|
||||
* c-typeck.c (pop_init_level): Issue diagnostic on non-constant
|
||||
vector initializers.
|
||||
|
||||
2005-06-22 Ziemowit Laski <zlaski@apple.com>
|
||||
|
||||
Radar 4154928
|
||||
* c-common.h (objc_common_type): New prototype.
|
||||
* c-typeck.c (build_conditional_expr): For two ObjC pointer types,
|
||||
use their ObjC common type.
|
||||
* stub-objc.c (objc_common_type): New stub.
|
||||
|
||||
/* APPLE LOCAL merge marger */
|
||||
/* Stuff under is in fsf mainline, but not in the 4.2 branch */
|
||||
|
||||
2007-08-02 Geoffrey Keating <geoffk@apple.com>
|
||||
|
||||
Radar 3274130, 5295549
|
||||
* c-parser.c (c_parser_while_statement): Handle attributes.
|
||||
(c_parser_do_statement): Handle attributes.
|
||||
(c_parser_for_statement): Handle attributes.
|
||||
* c-common.c (handle_unused_attribute): Warn if a statement
|
||||
is marked as unused.
|
||||
* c-tree.h (c_finish_loop): Add extra parameter.
|
||||
* c-typeck.c (c_finish_loop): Handle attributes.
|
||||
* doc/extend.texi (Attribute Syntax): Document statement attributes.
|
||||
(Label Attributes): Explain how they apply to statements.
|
||||
* tree-cfg.c (cleanup_dead_labels): Preserve labels with
|
||||
user-specified alignment or attributes.
|
||||
* stmt.c (expand_label): Update and correct documentation.
|
||||
|
||||
* c-common.c (handle_aligned_attribute): Handle LABEL_DECL.
|
||||
* rtl.def (CODE_LABEL): Add 8th operand.
|
||||
* rtl.h (LABEL_ALIGN_LOG): New.
|
||||
(LABEL_MAX_SKIP): New.
|
||||
(SET_LABEL_ALIGN): New.
|
||||
* emit-rtl.c (gen_label_rtx): Adjust.
|
||||
* print-rtl.c (print_rtx): Print LABEL_ALIGN_LOG.
|
||||
* stmt.c (label_rtx): Set CODE_LABEL's alignment from DECL_ALIGN.
|
||||
(expand_label): Update documentation.
|
||||
* final.c (struct label_alignment): Delete.
|
||||
(label_align): Delete.
|
||||
(min_labelno): Delete.
|
||||
(max_labelno): Delete.
|
||||
(LABEL_TO_ALIGNMENT): Delete.
|
||||
(LABEL_TO_MAX_SKIP): Delete.
|
||||
(label_to_alignment): Adjust for LABEL_ALIGN_LOG.
|
||||
(align_fuzz): Likewise.
|
||||
(compute_alignments): Likewise.
|
||||
(shorten_branches): Remove code to set up label_align.
|
||||
Adjust for LABEL_ALIGN_LOG.
|
||||
(final_scan_insn): Adjust for LABEL_ALIGN_LOG.
|
||||
* doc/extend.texi (C Extensions): Add 'Label Attributes' to menu.
|
||||
(Attribute Syntax): Move label content to Label Attributes.
|
||||
(Function Attributes): Mention label attributes.
|
||||
(Variable Attributes): Mention label attributes.
|
||||
(Type Attributes): Mention label attributes.
|
||||
(Label Attributes): New.
|
@ -1,824 +0,0 @@
|
||||
2007-08-08 Andrew Haley <aph@redhat.com> (r128087)
|
||||
|
||||
* config/arm/libunwind.S (UNWIND_WRAPPER _Unwind_Backtrace): New.
|
||||
* config/arm/unwind-arm.h (__gnu_Unwind_Backtrace): New.
|
||||
* config/arm/unwind-arm.c (__gnu_Unwind_Backtrace): New.
|
||||
|
||||
2007-07-12 Geoffrey Keating <geoffk@apple.com> (r126588)
|
||||
|
||||
* builtins.c (get_pointer_alignment): Honor DECL_ALIGN on a
|
||||
FUNCTION_DECL.
|
||||
* tree.c (build_decl_stat): Move code from here...
|
||||
(make_node_stat): ... to here. Don't uselessly clear DECL_USER_ALIGN.
|
||||
(expr_align): Honor DECL_ALIGN on a FUNCTION_DECL. Add comment
|
||||
about using DECL_ALIGN of LABEL_DECL and CONST_DECL.
|
||||
* tree.h (DECL_USER_ALIGN): Fix misplaced comment.
|
||||
* varasm.c (assemble_start_function): Use DECL_ALIGN instead of
|
||||
FUNCTION_BOUNDARY.
|
||||
|
||||
2007-07-09 Geoffrey Keating <geoffk@apple.com> (r126529)
|
||||
|
||||
PR 32617
|
||||
* c-common.c (c_alignof_expr): Look at DECL_ALIGN of
|
||||
FUNCTION_DECLs.
|
||||
(handle_aligned_attribute): Allow use on FUNCTION_DECLs.
|
||||
* varasm.c (assemble_start_function): Honor DECL_ALIGN
|
||||
for FUNCTION_DECLs. Don't use align_functions_log if
|
||||
DECL_USER_ALIGN.
|
||||
* print-tree.c (print_node): Print DECL_ALIGN and DECL_USER_ALIGN
|
||||
even for FUNCTION_DECLs.
|
||||
* c-decl.c (merge_decls): Propagate DECL_ALIGN even for
|
||||
FUNCTION_DECLs.
|
||||
* tree.h (DECL_ALIGN): Update for new location of 'align'.
|
||||
(DECL_FUNCTION_CODE): Update for new location and name of
|
||||
'function_code'.
|
||||
(DECL_OFFSET_ALIGN): Update for new location of 'off_align'.
|
||||
(struct tree_decl_common): Move 'align' and 'off_align' out
|
||||
of union, ensure they're still on a 32-bit boundary. Remove
|
||||
other fields in union 'u1'.
|
||||
(struct tree_function_decl): Add field 'function_code' replacing
|
||||
'u1.f' in tree_decl_common.
|
||||
* tree.c (build_decl_stat): Set initial value of DECL_ALIGN.
|
||||
* doc/extend.texi (Function Attributes): Add 'aligned' attribute.
|
||||
(Variable Attributes): Cross-reference 'aligned' attribute
|
||||
to Function Attributes.
|
||||
* flags.h (force_align_functions_log): Delete.
|
||||
* toplev.c (force_align_functions_log): Delete.
|
||||
|
||||
2007-07-06 Josh Conner <jconner@apple.com> (r126422)
|
||||
|
||||
PR middle-end/32602
|
||||
PR middle-end/32603
|
||||
* calls.c (store_one_arg): Handle arguments which are partially
|
||||
on the stack when detecting argument overlap.
|
||||
|
||||
2007-07-03 Eric Christopher <echristo@apple.com> (r126278)
|
||||
|
||||
* doc/cppopts.texi: Add conflicting option note to -dM.
|
||||
* doc/invoke.texi: Add note about possible conflicts with
|
||||
-E for -dCHARS and note that -dM will not produce
|
||||
any results if there is no machine dependent reorg.
|
||||
|
||||
2007-06-28 Geoffrey Keating <geoffk@apple.com> (r126088)
|
||||
|
||||
* doc/invoke.texi (C++ Dialect Options): Document
|
||||
fvisibility-ms-compat.
|
||||
* c.opt (fvisibility-ms-compat): New.
|
||||
|
||||
2007-06-23 Richard Earnshaw <rearnsha@arm.com> (r125973)
|
||||
|
||||
PR target/31152
|
||||
* arm.md (negscc): Match the correct operand for optimized LT0 test.
|
||||
Remove optimization for GT.
|
||||
|
||||
2007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de> (r125346)
|
||||
|
||||
PR preprocessor/23479
|
||||
* doc/extend.texi: Document the 0b-prefixed binary integer
|
||||
constant extension.
|
||||
|
||||
2007-05-31 Eric Christopher <echristo@apple.com> (r125246)
|
||||
|
||||
* expr.c (convert_move): Assert that we don't have a BLKmode
|
||||
operand.
|
||||
(store_expr): Handle BLKmode moves by calling emit_block_move.
|
||||
|
||||
2007-05-31 Daniel Berlin <dberlin@dberlin.org> (r125239)
|
||||
|
||||
* c-typeck.c (build_indirect_ref): Include type in error message.
|
||||
(build_binary_op): Pass types to binary_op_error.
|
||||
* c-common.c (binary_op_error): Take two type arguments, print out
|
||||
types with error.
|
||||
* c-common.h (binary_op_error): Update prototype.
|
||||
|
||||
2007-05-27 Eric Christopher <echristo@apple.com> (r125116)
|
||||
|
||||
* config/rs6000/rs6000.c (rs6000_emit_prologue): Update
|
||||
sp_offset depending on stack size. Save r12 depending
|
||||
on registers we're saving later.
|
||||
(rs6000_emit_epilogue): Update sp_offset depending only
|
||||
on stack size.
|
||||
|
||||
2007-05-24 Richard Sandiford <rsandifo@nildram.co.uk> (r125037)
|
||||
|
||||
* postreload-gcse.c (reg_changed_after_insn_p): New function.
|
||||
(oprs_unchanged_p): Use it to check all registers in a REG.
|
||||
(record_opr_changes): Look for clobbers in CALL_INSN_FUNCTION_USAGE.
|
||||
(reg_set_between_after_reload_p): Delete.
|
||||
(reg_used_between_after_reload_p): Likewise.
|
||||
(reg_set_or_used_since_bb_start): Likewise.
|
||||
(eliminate_partially_redundant_load): Use reg_changed_after_insn_p
|
||||
and reg_used_between_p instead of reg_set_or_used_since_bb_start.
|
||||
Use reg_set_between_p instead of reg_set_between_after_reload_p.
|
||||
* rtlanal.c (reg_set_p): Check whether REG overlaps
|
||||
regs_invalidated_by_call, rather than just checking the
|
||||
membership of REGNO (REG).
|
||||
|
||||
2007-05-18 Geoffrey Keating <geoffk@apple.com> (r124839)
|
||||
|
||||
* dwarf2out.c (print_die): Use '%ld' not '%lu' to print a 'long'.
|
||||
(output_die): Use 'unsigned long' with %x.
|
||||
* sched-vis.c (print_value): Use 'unsigned HOST_WIDE_INT' and
|
||||
HOST_WIDE_INT_PRINT_HEX to print HOST_WIDE_INT.
|
||||
* tree-dump.c (dump_pointer): Use 'unsigned long' for %lx.
|
||||
|
||||
2007-05-16 Eric Christopher <echristo@apple.com> (r124763)
|
||||
|
||||
* config/rs6000/rs6000.c (rs6000_emit_prologue): Move altivec register
|
||||
saving after stack push. Set sp_offset whenever we push.
|
||||
(rs6000_emit_epilogue): Move altivec register restore before stack push.
|
||||
|
||||
2007-05-03 Ian Lance Taylor <iant@google.com> (r124381)
|
||||
|
||||
* config/rs6000/rs6000.c (rs6000_override_options): Don't set
|
||||
MASK_PPC_GFXOPT for 8540 or 8548.
|
||||
|
||||
2007-05-01 Dwarakanath Rajagopal <dwarak.rajagopal@amd.com> (r124341)
|
||||
|
||||
* doc/invoke.texi: Fix typo, 'AMD Family 10h core' instead of
|
||||
'AMD Family 10 core'.
|
||||
|
||||
2007-05-01 Dwarakanath Rajagopal <dwarak.rajagopal@amd.com> (r124339)
|
||||
|
||||
* config/i386/i386.c (override_options): Accept k8-sse3, opteron-sse3
|
||||
and athlon64-sse3 as improved versions of k8, opteron and athlon64
|
||||
with SSE3 instruction set support.
|
||||
* doc/invoke.texi: Likewise.
|
||||
|
||||
2007-05-01 Dwarakanath Rajagopal <dwarak.rajagopal@amd.com> (r124330)
|
||||
|
||||
* config/i386/i386.c (override_options): Tuning 32-byte loop
|
||||
alignment for amdfam10 architecture. Increasing the max loop
|
||||
alignment to 24 bytes.
|
||||
|
||||
2007-04-24 Hui-May Chang <hm.chang@apple.com> (r124115)
|
||||
|
||||
* reload1.c (merge_assigned_reloads) : Do not merge a RELOAD_OTHER
|
||||
instruction with a RELOAD_FOR_OPERAND_ADDRESS instruction.
|
||||
|
||||
2007-04-16 Lawrence Crowl <crowl@google.com> (r123909)
|
||||
|
||||
* doc/invoke.texi (Debugging Options): Add documentation for the
|
||||
-femit-struct-debug options -femit-struct-debug-baseonly,
|
||||
-femit-struct-debug-reduced, and
|
||||
-femit-struct-debug-detailed[=...].
|
||||
|
||||
* c-opts.c (c_common_handle_option): Add
|
||||
OPT_femit_struct_debug_baseonly, OPT_femit_struct_debug_reduced,
|
||||
and OPT_femit_struct_debug_detailed_.
|
||||
* c.opt: Add specifications for
|
||||
-femit-struct-debug-baseonly, -femit-struct-debug-reduced,
|
||||
and -femit-struct-debug-detailed[=...].
|
||||
* opts.c (set_struct_debug_option): Parse the
|
||||
-femit-struct-debug-... options.
|
||||
* opts.c (matches_main_base, main_input_basename,
|
||||
main_input_baselength, base_of_path, matches_main_base): Add
|
||||
variables and functions to compare header base name to compilation
|
||||
unit base name.
|
||||
* opts.c (should_emit_struct_debug): Add to determine to emit a
|
||||
structure based on the option.
|
||||
(dump_struct_debug) Also disabled function to debug this
|
||||
function.
|
||||
* opts.c (handle_options): Save the base name of the
|
||||
compilation unit.
|
||||
|
||||
* langhooks-def.h (LANG_HOOKS_GENERIC_TYPE_P): Define.
|
||||
(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add.
|
||||
This hook indicates if a type is generic. Set it by default
|
||||
to "never generic".
|
||||
* langhooks.h (struct lang_hooks_for_types): Add a new hook
|
||||
to determine if a struct type is generic or not.
|
||||
* cp/cp-tree.h (class_tmpl_impl_spec_p): Declare a C++ hook.
|
||||
* cp/tree.c (class_tmpl_impl_spec_p): Implement the C++ hook.
|
||||
* cp/cp-lang.c (LANG_HOOKS_GENERIC_TYPE_P): Override null C hook
|
||||
with live C++ hook.
|
||||
|
||||
* flags.h (enum debug_info_usage): Add an enumeration to describe
|
||||
a program's use of a structure type.
|
||||
* dwarf2out.c (gen_struct_or_union_type_die): Add a new parameter
|
||||
to indicate the program's usage of the type. Filter structs based
|
||||
on the -femit-struct-debug-... specification.
|
||||
(gen_type_die): Split into two routines, gen_type_die and
|
||||
gen_type_die_with_usage. gen_type_die is now a wrapper
|
||||
that assumes direct usage.
|
||||
(gen_type_die_with_usage): Replace calls to gen_type_die
|
||||
with gen_type_die_with_usage adding the program usage of
|
||||
the referenced type.
|
||||
(dwarf2out_imported_module_or_decl): Suppress struct debug
|
||||
information using should_emit_struct_debug when appropriate.
|
||||
|
||||
2007-04-16 Ian Lance Taylor <iant@google.com> (r123906)
|
||||
|
||||
* tree-ssa-propagate.c (cfg_blocks_add): Insert blocks with fewer
|
||||
predecessors at head rather than tail.
|
||||
|
||||
|
||||
2007-04-12 Richard Guenther <rguenther@suse.de> (r123736)
|
||||
|
||||
PR tree-optimization/24689
|
||||
PR tree-optimization/31307
|
||||
* fold-const.c (operand_equal_p): Compare INTEGER_CST array
|
||||
indices by value.
|
||||
* gimplify.c (canonicalize_addr_expr): To be consistent with
|
||||
gimplify_compound_lval only set operands two and three of
|
||||
ARRAY_REFs if they are not gimple_min_invariant. This makes
|
||||
it never at this place.
|
||||
* tree-ssa-ccp.c (maybe_fold_offset_to_array_ref): Likewise.
|
||||
|
||||
2007-04-07 H.J. Lu <hongjiu.lu@intel.com> (r123639)
|
||||
|
||||
* config/i386/i386.c (ix86_handle_option): Handle SSSE3.
|
||||
|
||||
2007-03-28 Dwarakanath Rajagopal <dwarak.rajagopal@amd.com> (r123313)
|
||||
|
||||
* config.gcc: Accept barcelona as a variant of amdfam10.
|
||||
* config/i386/i386.c (override_options): Likewise.
|
||||
* doc/invoke.texi: Likewise.
|
||||
|
||||
2007-03-12 Seongbae Park <seongbae.park@gmail.com> (r122851)
|
||||
|
||||
* c-decl.c (warn_variable_length_array): New function.
|
||||
Refactored from grokdeclarator to handle warn_vla
|
||||
and handle unnamed array case.
|
||||
(grokdeclarator): Refactored VLA warning case.
|
||||
* c.opt (Wvla): New flag.
|
||||
|
||||
2007-03-11 Ian Lance Taylor <iant@google.com> (r122831 - partial)
|
||||
|
||||
* tree-vrp.c (vrp_int_const_binop): Handle PLUS_EXPR and
|
||||
the *_DIV_EXPR codes correctly with overflow infinities.
|
||||
|
||||
2007-02-09 Dwarakanath Rajagopal <dwarak.rajagopal@amd.com> (r121763)
|
||||
|
||||
* config/i386/driver-i386.c: Turn on -mtune=native for AMDFAM10.
|
||||
(bit_SSE4a): New.
|
||||
|
||||
2007-02-08 Harsha Jagasia <harsha.jagasia@amd.com> (r121726)
|
||||
|
||||
* config/i386/xmmintrin.h: Make inclusion of emmintrin.h
|
||||
conditional to __SSE2__.
|
||||
(Entries below should have been added to first ChangeLog
|
||||
entry for amdfam10 dated 2007-02-05)
|
||||
* config/i386/emmintrin.h: Generate #error if __SSE2__ is not
|
||||
defined.
|
||||
* config/i386/pmmintrin.h: Generate #error if __SSE3__ is not
|
||||
defined.
|
||||
* config/i386/tmmintrin.h: Generate #error if __SSSE3__ is not
|
||||
defined.
|
||||
|
||||
2007-02-07 Jakub Jelinek <jakub@redhat.com> (r121687)
|
||||
|
||||
* config/i386/i386.c (override_options): Set PTA_SSSE3 for core2.
|
||||
|
||||
2007-02-05 Harsha Jagasia <harsha.jagasia@amd.com> (r121625)
|
||||
|
||||
* config/i386/athlon.md (athlon_fldxf_k8, athlon_fld_k8,
|
||||
athlon_fstxf_k8, athlon_fst_k8, athlon_fist, athlon_fmov,
|
||||
athlon_fadd_load, athlon_fadd_load_k8, athlon_fadd, athlon_fmul,
|
||||
athlon_fmul_load, athlon_fmul_load_k8, athlon_fsgn,
|
||||
athlon_fdiv_load, athlon_fdiv_load_k8, athlon_fdiv_k8,
|
||||
athlon_fpspc_load, athlon_fpspc, athlon_fcmov_load,
|
||||
athlon_fcmov_load_k8, athlon_fcmov_k8, athlon_fcomi_load_k8,
|
||||
athlon_fcomi, athlon_fcom_load_k8, athlon_fcom): Added amdfam10.
|
||||
|
||||
2007-02-05 Harsha Jagasia <harsha.jagasia@amd.com> (r121625)
|
||||
|
||||
* config/i386/i386.md (x86_sahf_1, cmpfp_i_mixed, cmpfp_i_sse,
|
||||
cmpfp_i_i387, cmpfp_iu_mixed, cmpfp_iu_sse, cmpfp_iu_387,
|
||||
swapsi, swaphi_1, swapqi_1, swapdi_rex64, fix_truncsfdi_sse,
|
||||
fix_truncdfdi_sse, fix_truncsfsi_sse, fix_truncdfsi_sse,
|
||||
x86_fldcw_1, floatsisf2_mixed, floatsisf2_sse, floatdisf2_mixed,
|
||||
floatdisf2_sse, floatsidf2_mixed, floatsidf2_sse,
|
||||
floatdidf2_mixed, floatdidf2_sse, muldi3_1_rex64, mulsi3_1,
|
||||
mulsi3_1_zext, mulhi3_1, mulqi3_1, umulqihi3_1, mulqihi3_insn,
|
||||
umulditi3_insn, umulsidi3_insn, mulditi3_insn, mulsidi3_insn,
|
||||
umuldi3_highpart_rex64, umulsi3_highpart_insn,
|
||||
umulsi3_highpart_zext, smuldi3_highpart_rex64,
|
||||
smulsi3_highpart_insn, smulsi3_highpart_zext, x86_64_shld,
|
||||
x86_shld_1, x86_64_shrd, sqrtsf2_mixed, sqrtsf2_sse,
|
||||
sqrtsf2_i387, sqrtdf2_mixed, sqrtdf2_sse, sqrtdf2_i387,
|
||||
sqrtextendsfdf2_i387, sqrtxf2, sqrtextendsfxf2_i387,
|
||||
sqrtextenddfxf2_i387): Added amdfam10_decode.
|
||||
|
||||
* config/i386/athlon.md (athlon_idirect_amdfam10,
|
||||
athlon_ivector_amdfam10, athlon_idirect_load_amdfam10,
|
||||
athlon_ivector_load_amdfam10, athlon_idirect_both_amdfam10,
|
||||
athlon_ivector_both_amdfam10, athlon_idirect_store_amdfam10,
|
||||
athlon_ivector_store_amdfam10): New define_insn_reservation.
|
||||
(athlon_idirect_loadmov, athlon_idirect_movstore): Added
|
||||
amdfam10.
|
||||
|
||||
2007-02-05 Harsha Jagasia <harsha.jagasia@amd.com> (r121625)
|
||||
|
||||
* config/i386/athlon.md (athlon_call_amdfam10,
|
||||
athlon_pop_amdfam10, athlon_lea_amdfam10): New
|
||||
define_insn_reservation.
|
||||
(athlon_branch, athlon_push, athlon_leave_k8, athlon_imul_k8,
|
||||
athlon_imul_k8_DI, athlon_imul_mem_k8, athlon_imul_mem_k8_DI,
|
||||
athlon_idiv, athlon_idiv_mem, athlon_str): Added amdfam10.
|
||||
|
||||
2007-02-05 Harsha Jagasia <harsha.jagasia@amd.com> (r121625)
|
||||
|
||||
* config/i386/athlon.md (athlon_sseld_amdfam10,
|
||||
athlon_mmxld_amdfam10, athlon_ssest_amdfam10,
|
||||
athlon_mmxssest_short_amdfam10): New define_insn_reservation.
|
||||
|
||||
2007-02-05 Harsha Jagasia <harsha.jagasia@amd.com> (r121625)
|
||||
|
||||
* config/i386/athlon.md (athlon_sseins_amdfam10): New
|
||||
define_insn_reservation.
|
||||
* config/i386/i386.md (sseins): Added sseins to define_attr type
|
||||
and define_attr unit.
|
||||
* config/i386/sse.md: Set type attribute to sseins for insertq
|
||||
and insertqi.
|
||||
|
||||
2007-02-05 Harsha Jagasia <harsha.jagasia@amd.com> (r121625)
|
||||
|
||||
* config/i386/athlon.md (sselog_load_amdfam10, sselog_amdfam10,
|
||||
ssecmpvector_load_amdfam10, ssecmpvector_amdfam10,
|
||||
ssecomi_load_amdfam10, ssecomi_amdfam10,
|
||||
sseaddvector_load_amdfam10, sseaddvector_amdfam10): New
|
||||
define_insn_reservation.
|
||||
(ssecmp_load_k8, ssecmp, sseadd_load_k8, seadd): Added amdfam10.
|
||||
|
||||
2007-02-05 Harsha Jagasia <harsha.jagasia@amd.com> (r121625)
|
||||
|
||||
* config/i386/athlon.md (cvtss2sd_load_amdfam10,
|
||||
cvtss2sd_amdfam10, cvtps2pd_load_amdfam10, cvtps2pd_amdfam10,
|
||||
cvtsi2sd_load_amdfam10, cvtsi2ss_load_amdfam10,
|
||||
cvtsi2sd_amdfam10, cvtsi2ss_amdfam10, cvtsd2ss_load_amdfam10,
|
||||
cvtsd2ss_amdfam10, cvtpd2ps_load_amdfam10, cvtpd2ps_amdfam10,
|
||||
cvtsX2si_load_amdfam10, cvtsX2si_amdfam10): New
|
||||
define_insn_reservation.
|
||||
|
||||
* config/i386/sse.md (cvtsi2ss, cvtsi2ssq, cvtss2si,
|
||||
cvtss2siq, cvttss2si, cvttss2siq, cvtsi2sd, cvtsi2sdq,
|
||||
cvtsd2si, cvtsd2siq, cvttsd2si, cvttsd2siq,
|
||||
cvtpd2dq, cvttpd2dq, cvtsd2ss, cvtss2sd,
|
||||
cvtpd2ps, cvtps2pd): Added amdfam10_decode attribute.
|
||||
|
||||
2007-02-05 Harsha Jagasia <harsha.jagasia@amd.com> (r121625)
|
||||
|
||||
* config/i386/athlon.md (athlon_ssedivvector_amdfam10,
|
||||
athlon_ssedivvector_load_amdfam10, athlon_ssemulvector_amdfam10,
|
||||
athlon_ssemulvector_load_amdfam10): New define_insn_reservation.
|
||||
(athlon_ssediv, athlon_ssediv_load_k8, athlon_ssemul,
|
||||
athlon_ssemul_load_k8): Added amdfam10.
|
||||
|
||||
2007-02-05 Harsha Jagasia <harsha.jagasia@amd.com> (r121625)
|
||||
|
||||
* config/i386/i386.h (TARGET_SSE_UNALIGNED_MOVE_OPTIMAL): New macro.
|
||||
(x86_sse_unaligned_move_optimal): New variable.
|
||||
|
||||
* config/i386/i386.c (x86_sse_unaligned_move_optimal): Enable for
|
||||
m_AMDFAM10.
|
||||
(ix86_expand_vector_move_misalign): Add code to generate movupd/movups
|
||||
for unaligned vector SSE double/single precision loads for AMDFAM10.
|
||||
|
||||
2007-02-05 Harsha Jagasia <harsha.jagasia@amd.com> (r121625)
|
||||
|
||||
* config/i386/i386.h (TARGET_AMDFAM10): New macro.
|
||||
(TARGET_CPU_CPP_BUILTINS): Add code for amdfam10.
|
||||
Define TARGET_CPU_DEFAULT_amdfam10.
|
||||
(TARGET_CPU_DEFAULT_NAMES): Add amdfam10.
|
||||
(processor_type): Add PROCESSOR_AMDFAM10.
|
||||
|
||||
* config/i386/i386.md: Add amdfam10 as a new cpu attribute to match
|
||||
processor_type in config/i386/i386.h.
|
||||
Enable imul peepholes for TARGET_AMDFAM10.
|
||||
|
||||
* config.gcc: Add support for --with-cpu option for amdfam10.
|
||||
|
||||
* config/i386/i386.c (amdfam10_cost): New variable.
|
||||
(m_AMDFAM10): New macro.
|
||||
(m_ATHLON_K8_AMDFAM10): New macro.
|
||||
(x86_use_leave, x86_push_memory, x86_movx, x86_unroll_strlen,
|
||||
x86_cmove, x86_3dnow_a, x86_deep_branch, x86_use_simode_fiop,
|
||||
x86_promote_QImode, x86_integer_DFmode_moves,
|
||||
x86_partial_reg_dependency, x86_memory_mismatch_stall,
|
||||
x86_accumulate_outgoing_args, x86_arch_always_fancy_math_387,
|
||||
x86_sse_partial_reg_dependency, x86_sse_typeless_stores,
|
||||
x86_use_ffreep, x86_use_incdec, x86_four_jump_limit,
|
||||
x86_schedule, x86_use_bt, x86_cmpxchg16b, x86_pad_returns):
|
||||
Enable/disable for amdfam10.
|
||||
(override_options): Add amdfam10_cost to processor_target_table.
|
||||
Set up PROCESSOR_AMDFAM10 for amdfam10 entry in
|
||||
processor_alias_table.
|
||||
(ix86_issue_rate): Add PROCESSOR_AMDFAM10.
|
||||
(ix86_adjust_cost): Add code for amdfam10.
|
||||
|
||||
2007-02-05 Harsha Jagasia <harsha.jagasia@amd.com> (r121625)
|
||||
|
||||
* config/i386/i386.opt: Add new Advanced Bit Manipulation (-mabm)
|
||||
instruction set feature flag. Add new (-mpopcnt) flag for popcnt
|
||||
instruction. Add new SSE4A (-msse4a) instruction set feature flag.
|
||||
* config/i386/i386.h: Add builtin definition for SSE4A.
|
||||
* config/i386/i386.md: Add support for ABM instructions
|
||||
(popcnt and lzcnt).
|
||||
* config/i386/sse.md: Add support for SSE4A instructions
|
||||
(movntss, movntsd, extrq, insertq).
|
||||
* config/i386/i386.c: Add support for ABM and SSE4A builtins.
|
||||
Add -march=amdfam10 flag.
|
||||
* config/i386/ammintrin.h: Add support for SSE4A intrinsics.
|
||||
* doc/invoke.texi: Add documentation on flags for sse4a, abm, popcnt
|
||||
and amdfam10.
|
||||
* doc/extend.texi: Add documentation for SSE4A builtins.
|
||||
|
||||
2007-01-24 Jakub Jelinek <jakub@redhat.com> (r121140)
|
||||
|
||||
* config/i386/i386.h (x86_cmpxchg16b): Remove const.
|
||||
(TARGET_CMPXCHG16B): Define to x86_cmpxchg16b.
|
||||
* config/i386/i386.c (x86_cmpxchg16b): Remove const.
|
||||
(override_options): Add PTA_CX16 flag. Set x86_cmpxchg16b
|
||||
for CPUs that have PTA_CX16 set.
|
||||
|
||||
2007-01-18 Josh Conner <jconner@apple.com> (r120902)
|
||||
|
||||
PR target/30485
|
||||
* config/rs6000/rs6000.c (rs6000_emit_vector_compare): Add
|
||||
support for UNLE, UNLT, UNGE, and UNGT.
|
||||
|
||||
2007-01-17 Eric Christopher <echristo@apple.com> (r120846)
|
||||
|
||||
* config.gcc: Support core2 processor.
|
||||
|
||||
2007-01-11 Joseph Myers <joseph@codesourcery.com> (r120688)
|
||||
|
||||
* c-common.c (vector_types_convertible_p): Treat opaque types as
|
||||
always convertible if they have the same size, but not otherwise.
|
||||
|
||||
2007-01-08 Geoffrey Keating <geoffk@apple.com> (r120611)
|
||||
|
||||
* target.h (struct gcc_target): New field library_rtti_comdat.
|
||||
* target-def.h (TARGET_CXX_LIBRARY_RTTI_COMDAT): New.
|
||||
(TARGET_CXX): Add TARGET_CXX_LIBRARY_RTTI_COMDAT.
|
||||
* doc/tm.texi (C++ ABI): Document TARGET_CXX_LIBRARY_RTTI_COMDAT.
|
||||
* config/darwin.h (TARGET_CXX_LIBRARY_RTTI_COMDAT): Define.
|
||||
|
||||
2007-01-08 Mark Shinwell <shinwell@codesourcery.com> (r120572)
|
||||
|
||||
* c.opt: Add -flax-vector-conversions.
|
||||
* c-typeck.c (convert_for_assignment): Pass flag to
|
||||
vector_types_convertible_p to allow emission of note.
|
||||
(digest_init): Likewise.
|
||||
* c-opts.c: Handle -flax-vector-conversions.
|
||||
* c-common.c (flag_lax_vector_conversions): New.
|
||||
(vector_types_convertible_p): Unless -flax-vector conversions
|
||||
has been passed, disallow conversions between vectors with
|
||||
differing numbers of subparts and/or element types. If such
|
||||
a conversion is disallowed, possibly emit a note on the first
|
||||
occasion only to inform the user of -flax-vector-conversions.
|
||||
The new last argument specifies this.
|
||||
* c-common.h (flag_lax_vector_conversions): New.
|
||||
(vector_types_convertible_p): Add extra argument.
|
||||
* config/i386/i386.c (ix86_init_mmx_sse_builtins): Use
|
||||
char_type_node for V*QI type vectors.
|
||||
* config/rs6000/rs6000-c.c (altivec_overloaded_builtins):
|
||||
Update to satisfy new typechecking rules.
|
||||
* config/rs6000/altivec.h (vec_cmple): Use vec_cmpge, for both
|
||||
C and C++ variants.
|
||||
* doc/invoke.texi (C Dialect Options): Document
|
||||
-flax-vector-conversions.
|
||||
|
||||
2007-01-05 Manuel Lopez-Ibanez <manu@gcc.gnu.org> (r120505)
|
||||
|
||||
PR c/19978
|
||||
* tree.h (TREE_OVERFLOW_P): New.
|
||||
* c-typeck.c (parser_build_unary_op): Warn only if result
|
||||
overflowed and operands did not.
|
||||
(parser_build_binary_op): Likewise.
|
||||
(convert_for_assignment): Remove redundant overflow_warning.
|
||||
* c-common.c (overflow_warning): Don't check or set TREE_OVERFLOW.
|
||||
|
||||
2006-12-13 Ian Lance Taylor <iant@google.com> (r119855)
|
||||
|
||||
PR c++/19564
|
||||
PR c++/19756
|
||||
* c-typeck.c (parser_build_binary_op): Move parentheses warnings
|
||||
to warn_about_parentheses in c-common.c.
|
||||
* c-common.c (warn_about_parentheses): New function.
|
||||
* c-common.h (warn_about_parentheses): Declare.
|
||||
* doc/invoke.texi (Warning Options): Update -Wparentheses
|
||||
description.
|
||||
|
||||
2006-12-12 Geoffrey Keating <geoffk@apple.com> (r119820)
|
||||
|
||||
* mips-tdump.c: Replace CROSS_COMPILE with
|
||||
CROSS_DIRECTORY_STRUCTURE.
|
||||
* mips-tfile.c: Likewise.
|
||||
* gcc.c: Likewise.
|
||||
* configure.ac: Likewise.
|
||||
* cppdefault.c: Likewise.
|
||||
* Makefile.in: Likewise.
|
||||
* config/alpha/osf.h: Likewise.
|
||||
* config/i386/cygwin.h: Likewise.
|
||||
* config/i386/beos-elf.h: Likewise.
|
||||
* config/i386/nto.h: Likewise.
|
||||
* config/svr4.h: Likewise.
|
||||
* config/rs6000/aix.h: Likewise.
|
||||
* config/rs6000/sysv4.h: Likewise.
|
||||
* collect2.c: Likewise.
|
||||
* configure: Regenerate.
|
||||
|
||||
* doc/tm.texi (Alignment Output): Document that ASM_OUTPUT_SKIP
|
||||
actually takes an unsigned HOST_WIDE_INT for its second parameter.
|
||||
|
||||
2006-12-02 H.J. Lu <hongjiu.lu@intel.com> (r119454 - partial)
|
||||
|
||||
PR target/30040
|
||||
* config/i386/driver-i386.c (bit_SSSE3): New.
|
||||
|
||||
2006-11-27 Uros Bizjak <ubizjak@gmail.com> (r119260)
|
||||
|
||||
* config/i386/i386.c (x86_ext_80387_constants): Add m_K8, m_CORE2
|
||||
and m_GENERIC64.
|
||||
|
||||
2006-11-18 Vladimir Makarov <vmakarov@redhat.com> (r118973)
|
||||
|
||||
* doc/invoke.texi (core2): Add item.
|
||||
|
||||
* config/i386/i386.h (TARGET_CORE2, TARGET_CPU_DEFAULT_core2): New
|
||||
macros.
|
||||
(TARGET_CPU_CPP_BUILTINS): Add code for core2.
|
||||
(TARGET_CPU_DEFAULT_generic): Change value.
|
||||
(TARGET_CPU_DEFAULT_NAMES): Add core2.
|
||||
(processor_type): Add new constant PROCESSOR_CORE2.
|
||||
|
||||
* config/i386/i386.md (cpu): Add core2.
|
||||
|
||||
* config/i386/i386.c (core2_cost): New initialized variable.
|
||||
(m_CORE2): New macro.
|
||||
(x86_use_leave, x86_push_memory, x86_movx, x86_unroll_strlen,
|
||||
x86_deep_branch, x86_partial_reg_stall, x86_use_simode_fiop,
|
||||
x86_use_cltd, x86_promote_QImode, x86_sub_esp_4, x86_sub_esp_8,
|
||||
x86_add_esp_4, x86_add_esp_8, x86_integer_DFmode_moves,
|
||||
x86_partial_reg_dependency, x86_memory_mismatch_stall,
|
||||
x86_accumulate_outgoing_args, x86_prologue_using_move,
|
||||
x86_epilogue_using_move, x86_arch_always_fancy_math_387,
|
||||
x86_sse_partial_reg_dependency, x86_rep_movl_optimal,
|
||||
x86_use_incdec, x86_four_jump_limit, x86_schedule,
|
||||
x86_pad_returns): Add m_CORE2.
|
||||
(override_options): Add entries for Core2.
|
||||
(ix86_issue_rate): Add case for Core2.
|
||||
|
||||
2006-11-14 Caroline Tice <ctice@apple.com> (r118826)
|
||||
|
||||
* dwarf2out.c (debug_pubtypes_section): New static global variable.
|
||||
(pubname_entry): Add DEF_VEC_O and DEF_VEC_ALLOC_O statements for
|
||||
this type.
|
||||
(pubname_table): Redefine as a vector.
|
||||
(pubtype_table): New static global variable, defined as a vector.
|
||||
(pubname_table_allocated): Remove static global variable.
|
||||
(pubname_table_in_use): Remove static global variable.
|
||||
(PUBNAME_TABLE_INCREMENT): Remove constant.
|
||||
(size_of_pubnames): Add parameter to deal with either pubnames or
|
||||
pubtypes, and change code to deal with table being a vector.
|
||||
(add_pubname): Change to deal with table being a vector.
|
||||
(add_pubtype): New function.
|
||||
(output_pubnames): Add parameter to deal with either pubnames or
|
||||
pubtypes, and change code to deal with table being a vector.
|
||||
(gen_array_type_die): Add call to add_pubtype.
|
||||
(gen_enumeration_type_die): Add call to add_pubtype.
|
||||
(gen_struct_or_union_type_die): Add call to add_pubtype.
|
||||
(gen_subroutine_type_die): Add call to add_pubtype.
|
||||
(gen_typedef_die): Add call to add_pubtype.
|
||||
(dwarf2out_init): Add code to initialize pubname_table and
|
||||
pubtype_table vectors; also initialize debug_pubtypes_section.
|
||||
(prune_unused_types): Change to deal with pubnames being a vector.
|
||||
(dwarf2out_finish): Change to deal with pubnames being a vector; add
|
||||
pubnames table to call to output_pubnames; Add code to output pubtypes
|
||||
table if DEBUG_PUBTYPES_SECTION is defined.
|
||||
* config/darwin.c (darwin_file_start): Add DEBUG_PUBTYPES_SECTION to
|
||||
debugnames.
|
||||
* config/darwin.h (DEBUG_PUBTYPES_SECTION): Define new global variable.
|
||||
|
||||
2006-11-07 Eric Christopher <echristo@apple.com> (r118576)
|
||||
|
||||
* libgcc2.c (__bswapdi2): Rename from bswapDI2.
|
||||
(__bswapsi2): Ditto.
|
||||
* libgcc2.h: Remove transformation of bswap routines.
|
||||
* config/i386/i386.md (bswapsi2): New.
|
||||
(bswapdi2): Ditto.
|
||||
|
||||
2006-11-03 Paul Brook <paul@codesourcery.com> (r118461)
|
||||
|
||||
gcc/
|
||||
* config/arm/arm.c (arm_file_start): New function.
|
||||
(TARGET_ASM_FILE_START): Define.
|
||||
(arm_default_cpu): New variable.
|
||||
(arm_override_options): Set arm_default_cpu.
|
||||
|
||||
2006-10-31 Geoffrey Keating <geoffk@apple.com> (r118360)
|
||||
|
||||
* coverage.c (coverage_checksum_string): Update comment.
|
||||
* dwarf2out.c (switch_to_eh_frame_section): Update for removal
|
||||
of get_file_function_name.
|
||||
* cgraphunit.c (cgraph_build_static_cdtor): Update for rename
|
||||
of get_file_function_name_long.
|
||||
* tree.c (get_file_function_name): Rename from
|
||||
get_file_function_name_long; improve comment; handle 'I' and 'D'
|
||||
specially when the target has ctor/dtor support; remove special
|
||||
handling for 'F'.
|
||||
(get_file_function_name): Remove.
|
||||
* tree.h (get_file_function_name): Rename from
|
||||
get_file_function_name_long.
|
||||
(get_file_function_name): Remove prototype.
|
||||
|
||||
2006-10-31 Geoffrey Keating <geoffk@apple.com> (r118356)
|
||||
|
||||
* c-decl.c (grokdeclarator): Don't set DECL_EXTERNAL on
|
||||
inline static functions in c99 mode.
|
||||
|
||||
PR 16622
|
||||
* doc/extend.texi (Inline): Update.
|
||||
* c-tree.h (struct language_function): Remove field 'extern_inline'.
|
||||
* c-decl.c (current_extern_inline): Delete.
|
||||
(pop_scope): Adjust test for an undefined nested function.
|
||||
Add warning about undeclared inline function.
|
||||
(diagnose_mismatched_decls): Update comments. Disallow overriding
|
||||
of inline functions in a translation unit in C99. Allow inline
|
||||
declarations in C99 at any time.
|
||||
(merge_decls): Boolize variables. Handle C99 'extern inline'
|
||||
semantics.
|
||||
(grokdeclarator): Set DECL_EXTERNAL here for functions. Handle
|
||||
C99 inline semantics.
|
||||
(start_function): Don't clear current_extern_inline. Don't set
|
||||
DECL_EXTERNAL.
|
||||
(c_push_function_context): Don't push current_extern_inline.
|
||||
(c_pop_function_context): Don't restore current_extern_inline.
|
||||
|
||||
PR 11377
|
||||
* c-typeck.c (build_external_ref): Warn about static variables
|
||||
used in extern inline functions.
|
||||
* c-decl.c (start_decl): Warn about static variables declared
|
||||
in extern inline functions.
|
||||
|
||||
2006-10-27 Vladimir Makarov <vmakarov@redhat.com> (r118090)
|
||||
|
||||
* config/i386/i386.h (TARGET_GEODE):
|
||||
(TARGET_CPU_CPP_BUILTINS): Add code for geode.
|
||||
(TARGET_CPU_DEFAULT_geode): New macro.
|
||||
(TARGET_CPU_DEFAULT_k6, TARGET_CPU_DEFAULT_k6_2,
|
||||
TARGET_CPU_DEFAULT_k6_3, TARGET_CPU_DEFAULT_athlon,
|
||||
TARGET_CPU_DEFAULT_athlon_sse, TARGET_CPU_DEFAULT_k8,
|
||||
TARGET_CPU_DEFAULT_pentium_m, TARGET_CPU_DEFAULT_prescott,
|
||||
TARGET_CPU_DEFAULT_nocona, TARGET_CPU_DEFAULT_generic): Increase
|
||||
the macro values.
|
||||
(TARGET_CPU_DEFAULT_NAMES): Add geode.
|
||||
(processor_type): Add PROCESSOR_GEODE.
|
||||
|
||||
* config/i386/i386.md: Include geode.md.
|
||||
(cpu): Add geode.
|
||||
|
||||
* config/i386/i386.c (geode_cost): New initialized global
|
||||
variable.
|
||||
(m_GEODE, m_K6_GEODE): New macros.
|
||||
(x86_use_leave, x86_push_memory, x86_deep_branch, x86_use_sahf,
|
||||
x86_use_himode_fiop, x86_promote_QImode, x86_add_esp_4,
|
||||
x86_add_esp_8, x86_rep_movl_optimal, x86_ext_80387_constants,
|
||||
x86_schedule): Use m_K6_GEODE instead of m_K6.
|
||||
(x86_movx, x86_cmove): Set up m_GEODE.
|
||||
(x86_integer_DFmode_moves): Clear m_GEODE.
|
||||
(processor_target_table): Add entry for geode.
|
||||
(processor_alias_table): Ditto.
|
||||
|
||||
* config/i386/geode.md: New file.
|
||||
|
||||
* doc/invoke.texi: Add entry about geode processor.
|
||||
|
||||
2006-10-24 Richard Guenther <rguenther@suse.de> (r118001)
|
||||
|
||||
PR middle-end/28796
|
||||
* builtins.c (fold_builtin_classify): Use HONOR_INFINITIES
|
||||
and HONOR_NANS instead of MODE_HAS_INFINITIES and MODE_HAS_NANS
|
||||
for deciding optimizations in consistency with fold-const.c
|
||||
(fold_builtin_unordered_cmp): Likewise.
|
||||
|
||||
2006-10-22 H.J. Lu <hongjiu.lu@intel.com> (r117958)
|
||||
|
||||
* config.gcc (i[34567]86-*-*): Add tmmintrin.h to extra_headers.
|
||||
(x86_64-*-*): Likewise.
|
||||
|
||||
* config/i386/i386.c (pta_flags): Add PTA_SSSE3.
|
||||
(override_options): Check SSSE3.
|
||||
(ix86_builtins): Add IX86_BUILTIN_PHADDW, IX86_BUILTIN_PHADDD,
|
||||
IX86_BUILTIN_PHADDSW, IX86_BUILTIN_PHSUBW, IX86_BUILTIN_PHSUBD,
|
||||
IX86_BUILTIN_PHSUBSW, IX86_BUILTIN_PMADDUBSW,
|
||||
IX86_BUILTIN_PMULHRSW, IX86_BUILTIN_PSHUFB,
|
||||
IX86_BUILTIN_PSIGNB, IX86_BUILTIN_PSIGNW, IX86_BUILTIN_PSIGND,
|
||||
IX86_BUILTIN_PALIGNR, IX86_BUILTIN_PABSB, IX86_BUILTIN_PABSW,
|
||||
IX86_BUILTIN_PABSD, IX86_BUILTIN_PHADDW128,
|
||||
IX86_BUILTIN_PHADDD128, IX86_BUILTIN_PHADDSW128,
|
||||
IX86_BUILTIN_PHSUBW128, IX86_BUILTIN_PHSUBD128,
|
||||
IX86_BUILTIN_PHSUBSW128, IX86_BUILTIN_PMADDUBSW128,
|
||||
IX86_BUILTIN_PMULHRSW128, IX86_BUILTIN_PSHUFB128,
|
||||
IX86_BUILTIN_PSIGNB128, IX86_BUILTIN_PSIGNW128,
|
||||
IX86_BUILTIN_PSIGND128, IX86_BUILTIN_PALIGNR128,
|
||||
IX86_BUILTIN_PABSB128, IX86_BUILTIN_PABSW128 and
|
||||
IX86_BUILTIN_PABSD128.
|
||||
(bdesc_2arg): Add SSSE3.
|
||||
(bdesc_1arg): Likewise.
|
||||
(ix86_init_mmx_sse_builtins): Support SSSE3.
|
||||
(ix86_expand_builtin): Likewise.
|
||||
* config/i386/i386.h (TARGET_CPU_CPP_BUILTINS): Likewise.
|
||||
|
||||
* config/i386/i386.md (UNSPEC_PSHUFB): New.
|
||||
(UNSPEC_PSIGN): Likewise.
|
||||
(UNSPEC_PALIGNR): Likewise.
|
||||
Include mmx.md before sse.md.
|
||||
|
||||
* config/i386/i386.opt: Add -mssse3.
|
||||
|
||||
* config/i386/sse.md (ssse3_phaddwv8hi3): New pattern for SSSE3.
|
||||
(ssse3_phaddwv4hi3): Likewise.
|
||||
(ssse3_phadddv4si3): Likewise.
|
||||
(ssse3_phadddv2si3): Likewise.
|
||||
(ssse3_phaddswv8hi3): Likewise.
|
||||
(ssse3_phaddswv4hi3): Likewise.
|
||||
(ssse3_phsubwv8hi3): Likewise.
|
||||
(ssse3_phsubwv4hi3): Likewise.
|
||||
(ssse3_phsubdv4si3): Likewise.
|
||||
(ssse3_phsubdv2si3): Likewise.
|
||||
(ssse3_phsubswv8hi3): Likewise.
|
||||
(ssse3_phsubswv4hi3): Likewise.
|
||||
(ssse3_pmaddubswv8hi3): Likewise.
|
||||
(ssse3_pmaddubswv4hi3): Likewise.
|
||||
(ssse3_pmulhrswv8hi3): Likewise.
|
||||
(ssse3_pmulhrswv4hi3): Likewise.
|
||||
(ssse3_pshufbv16qi3): Likewise.
|
||||
(ssse3_pshufbv8qi3): Likewise.
|
||||
(ssse3_psign<mode>3): Likewise.
|
||||
(ssse3_psign<mode>3): Likewise.
|
||||
(ssse3_palignrti): Likewise.
|
||||
(ssse3_palignrdi): Likewise.
|
||||
(abs<mode>2): Likewise.
|
||||
(abs<mode>2): Likewise.
|
||||
|
||||
* config/i386/tmmintrin.h: New file.
|
||||
|
||||
* doc/extend.texi: Document SSSE3 built-in functions.
|
||||
|
||||
* doc/invoke.texi: Document -mssse3/-mno-ssse3 switches.
|
||||
|
||||
2006-10-22 H.J. Lu <hongjiu.lu@intel.com> (r117959)
|
||||
|
||||
* config/i386/tmmintrin.h: Remove the duplicated content.
|
||||
|
||||
2006-10-21 Richard Guenther <rguenther@suse.de> (r117932)
|
||||
|
||||
PR tree-optimization/3511
|
||||
* tree-ssa-pre.c (phi_translate): Fold CALL_EXPRs that
|
||||
got new invariant arguments during PHI translation.
|
||||
|
||||
2006-10-21 Richard Guenther <rguenther@suse.de> (r117929)
|
||||
|
||||
* builtins.c (fold_builtin_classify): Fix typo.
|
||||
|
||||
2006-09-07 Eric Christopher <echristo@apple.com> (r118361)
|
||||
Falk Hueffner <falk@debian.org>
|
||||
|
||||
* doc/extend.texi (__builtin_bswap32): Document.
|
||||
(__builtin_bswap64): Ditto.
|
||||
* doc/libgcc.texi (bswapsi2): Document.
|
||||
(bswapdi2): Ditto.
|
||||
* doc/rtl.texi (bswap): Document.
|
||||
* optabs.c (expand_unop): Don't widen a bswap.
|
||||
(init_optabs): Init bswap. Set libfuncs explicitly
|
||||
for bswapsi2 and bswapdi2.
|
||||
* optabs.h (OTI_bswap): New.
|
||||
(bswap_optab): Ditto.
|
||||
* genopinit.c (optabs): Handle bswap_optab.
|
||||
* tree.h (tree_index): Add TI_UINT32_TYPE and
|
||||
TI_UINT64_TYPE.
|
||||
(uint32_type_node): New.
|
||||
(uint64_type_node): Ditto.
|
||||
* tree.c (build_common_tree_nodes_2): Initialize
|
||||
uint32_type_node and uint64_type_node.
|
||||
* builtins.c (expand_builtin_bswap): New.
|
||||
(expand_builtin): Call.
|
||||
(fold_builtin_bswap): New.
|
||||
(fold_builtin_1): Call.
|
||||
* fold-const.c (tree_expr_nonnegative_p): Return true
|
||||
for bswap.
|
||||
* builtin-types.def (BT_UINT32): New.
|
||||
(BT_UINT64): Ditto.
|
||||
(BT_FN_UINT32_UINT32): Ditto.
|
||||
(BT_FN_UINT64_UINT64): Ditto.
|
||||
* builtins.def (BUILT_IN_BSWAP32): New.
|
||||
(BUILT_IN_BSWAP64): Ditto.
|
||||
* rtl.def (BSWAP): New.
|
||||
* genattrtab.c (check_attr_value): New.
|
||||
* libgcc2.c (__bswapSI2): New.
|
||||
(__bswapDI2): Ditto.
|
||||
* libgcc2.h (__bswapSI2): Declare.
|
||||
(__bswapDI2): Ditto.
|
||||
* mklibgcc.in (lib2funcs): Add _bswapsi2 and _bswapdi2.
|
||||
* simplify-rtx.c (simplify_const_unary_operation): Return
|
||||
0 for BSWAP.
|
||||
* libgcc-std.ver (__bwapsi2): Add.
|
||||
(__bswapdi2): Ditto.
|
||||
* reload1.c (eliminate_regs_1): Add bswap.
|
||||
(elimination_effects): Ditto.
|
||||
* config/i386/i386.h (x86_bswap): New.
|
||||
(TARGET_BSWAP): Use.
|
||||
* config/i386/i386.c (x86_bswap): Set.
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1 +0,0 @@
|
||||
20070831
|
@ -1 +0,0 @@
|
||||
patched
|
@ -1,93 +0,0 @@
|
||||
# $FreeBSD$
|
||||
*.brik
|
||||
*FAQ
|
||||
*contrib
|
||||
*etc
|
||||
*faq.*
|
||||
*/include
|
||||
*/install*
|
||||
*getopt*
|
||||
*libchill
|
||||
*libf2c
|
||||
*libiberty
|
||||
*libio
|
||||
*libobjc
|
||||
*libstdc++
|
||||
*lt*
|
||||
*missing
|
||||
*mkinstalldirs
|
||||
*move-if-change
|
||||
*symlink-tree
|
||||
*texinfo
|
||||
*ylwrap
|
||||
*gcc/.cvsignore
|
||||
*gcc/ABOUT*NLS
|
||||
*gcc/*ChangeLog.*
|
||||
*gcc/README.ACORN
|
||||
*gcc/README.ALTOS
|
||||
*gcc/README.APOLLO
|
||||
*gcc/README.C4X
|
||||
*gcc/README.FRESCO
|
||||
*gcc/README.NS32K
|
||||
*gcc/README.RS6000
|
||||
*gcc/README.X11
|
||||
*gcc/README.gnat
|
||||
*gcc/*.bat
|
||||
*gcc/*.com
|
||||
*gcc/*.info*
|
||||
*gcc/bi-parser.[ch]
|
||||
*gcc/c-gperf.h
|
||||
*gcc/c-parse.[chy]
|
||||
*gcc/cexp.c
|
||||
*gcc/cpp.aux
|
||||
*gcc/cpp.cps
|
||||
*gcc/cpp.fns
|
||||
*gcc/gcc.aux
|
||||
*gcc/gcc.cps
|
||||
*gcc/gcc.hlp
|
||||
*gcc/texinfo.tex
|
||||
*gcc/.gdbinit
|
||||
*gcc/install1.texi
|
||||
*gcc/intl
|
||||
*gcc/ch
|
||||
*gcc/cp/hash.h
|
||||
*gcc/cp/parse.[ch]
|
||||
*gcc/config/1750a
|
||||
*gcc/config/a29k
|
||||
*gcc/config/arc
|
||||
*gcc/config/arm
|
||||
*gcc/config/c4x
|
||||
*gcc/config/clipper
|
||||
*gcc/config/convex
|
||||
*gcc/config/dsp16xx
|
||||
*gcc/config/elxsi
|
||||
*gcc/config/fx80
|
||||
*gcc/config/gmicro
|
||||
*gcc/config/h8300
|
||||
*gcc/config/i370
|
||||
*gcc/config/i860
|
||||
*gcc/config/i960
|
||||
*gcc/config/m32r
|
||||
*gcc/config/m68k
|
||||
*gcc/config/m88k
|
||||
*gcc/config/mn10200
|
||||
*gcc/config/mn10300
|
||||
*gcc/config/msdos
|
||||
*gcc/config/ns32k
|
||||
*gcc/config/pa
|
||||
*gcc/config/pdp11
|
||||
*gcc/config/pyr
|
||||
*gcc/config/romp
|
||||
*gcc/config/rs6000
|
||||
*gcc/config/sh
|
||||
*gcc/config/spur
|
||||
*gcc/config/tahoe
|
||||
*gcc/config/v850
|
||||
*gcc/config/vax
|
||||
*gcc/config/we32k
|
||||
*gcc/config/winnt
|
||||
*gcc/fixinc
|
||||
*gcc/java
|
||||
*gcc/objc/objc-parse.[cy]
|
||||
*gcc/po
|
||||
*gcc/testsuite
|
@ -1,87 +0,0 @@
|
||||
$FreeBSD$
|
||||
CVS
|
||||
.cvsignore
|
||||
ABOUT*NLS
|
||||
ChangeLog.lib
|
||||
FSFChangeLog.*
|
||||
README.ACORN
|
||||
README.ALTOS
|
||||
README.APOLLO
|
||||
README.AVR
|
||||
README.C4X
|
||||
README.FRESCO
|
||||
README.NS32K
|
||||
README.RS6000
|
||||
README.X11
|
||||
README.gnat
|
||||
*.bat
|
||||
*.com
|
||||
*.info*
|
||||
bi-parser.[ch]
|
||||
c-gperf.h
|
||||
c-parse.[chy]
|
||||
cexp.c
|
||||
cpp.aux
|
||||
cpp.cps
|
||||
cpp.fns
|
||||
gcc.aux
|
||||
gcc.cps
|
||||
gcc.hlp
|
||||
getopt.[ch]
|
||||
texinfo.tex
|
||||
.gdbinit
|
||||
install1.texi
|
||||
intl
|
||||
ch
|
||||
cp/cfns.[chy]
|
||||
cp/hash.h
|
||||
cp/parse.[ch]
|
||||
config/1750a
|
||||
config/a29k
|
||||
config/arc
|
||||
config/arm
|
||||
config/avr
|
||||
config/c4x
|
||||
config/clipper
|
||||
config/convex
|
||||
config/d30v
|
||||
config/dsp16xx
|
||||
config/elxsi
|
||||
config/fr30
|
||||
config/fx80
|
||||
config/gmicro
|
||||
config/h8300
|
||||
config/i370
|
||||
config/i860
|
||||
config/i960
|
||||
config/m32r
|
||||
config/m68k
|
||||
config/m88k
|
||||
config/mcore
|
||||
config/mips
|
||||
config/mn10200
|
||||
config/mn10300
|
||||
config/msdos
|
||||
config/ns32k
|
||||
config/pa
|
||||
config/pdp11
|
||||
config/pj
|
||||
config/pyr
|
||||
config/romp
|
||||
config/rs6000
|
||||
config/sh
|
||||
config/spur
|
||||
config/tahoe
|
||||
config/v850
|
||||
config/vax
|
||||
config/we32k
|
||||
config/winnt
|
||||
fixinc
|
||||
gccbug*
|
||||
java
|
||||
mkinstalldirs
|
||||
objc/objc-parse.[cy]
|
||||
gthr-win32*
|
||||
po
|
||||
testsuite
|
||||
tradcif.c
|
@ -1,37 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
# $FreeBSD$
|
||||
|
||||
for F in \
|
||||
choose-temp.c \
|
||||
cp-demangle.c \
|
||||
cplus-dem.c \
|
||||
dyn-string.c \
|
||||
getopt.c \
|
||||
getopt1.c \
|
||||
getpwd.c \
|
||||
hashtab.c \
|
||||
lbasename.c \
|
||||
md5.c \
|
||||
obstack.c \
|
||||
partition.c \
|
||||
pexecute.c \
|
||||
splay-tree.c
|
||||
do
|
||||
cp -ip ../libiberty/$F .
|
||||
done
|
||||
|
||||
for F in \
|
||||
ansidecl.h \
|
||||
demangle.h \
|
||||
dyn-string.h \
|
||||
getopt.h \
|
||||
hashtab.h \
|
||||
libiberty.h \
|
||||
obstack.h \
|
||||
partition.h \
|
||||
splay-tree.h \
|
||||
symcat.h
|
||||
do
|
||||
cp -ip ../include/$F .
|
||||
done
|
@ -1,13 +0,0 @@
|
||||
$FreeBSD$
|
||||
|
||||
tar -xvjf gcc-3.0.2.tar.bz2 -X FREEBSD-Xlist
|
||||
|
||||
cd gcc-3.0.2/gcc
|
||||
sh FREEBSD-libiberty
|
||||
|
||||
cvs import src/contrib/gcc FSF gcc_3_0_2
|
||||
|
||||
If you decide to bring in more of the files, import them -- don't
|
||||
use ``cvs add''. And please remember to adjust the contents of
|
||||
"FREEBSD-Xlist" so that it reflects what is really imported from
|
||||
the vendor.
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,57 +0,0 @@
|
||||
Right now there is no documentation for the GCC tree -> rtl interfaces
|
||||
(or more generally the interfaces for adding new languages).
|
||||
|
||||
Such documentation would be of great benefit to the project. Until such
|
||||
time as we can formally start documenting the interface this file will
|
||||
serve as a repository for information on these interface and any incompatable
|
||||
changes we've made.
|
||||
|
||||
2004-09-09:
|
||||
In an effort to decrease execution time, single char tree code
|
||||
classes were changed to enumerated values.
|
||||
|
||||
Old way:
|
||||
|
||||
DEFTREECODE (CLASS_METHOD_DECL, "class_method_decl", 'd', 0)
|
||||
|
||||
New way:
|
||||
|
||||
DEFTREECODE (CLASS_METHOD_DECL, "class_method_decl", tcc_declaration, 0)
|
||||
|
||||
2001-02-26:
|
||||
A DECL_INITIAL of NULL_TREE or error_mark_node in a VAR_DECL is no longer
|
||||
taken to signify a tentative definition which should not be emitted until
|
||||
end-of-file. Frontends which want that behavior should set
|
||||
DECL_DEFER_OUTPUT before calling rest_of_decl_compilation.
|
||||
|
||||
Feb 1, 1998:
|
||||
|
||||
GCC used to store structure sizes & offsets to elements as bitsize
|
||||
quantities. This causes problems because a structure can only be
|
||||
(target memsize / 8) bytes long (this may effect arrays too). This
|
||||
is particularly problematical on machines with small address spaces.
|
||||
|
||||
So:
|
||||
|
||||
All trees that represent sizes in bits should have a TREE_TYPE of
|
||||
bitsizetype (rather than sizetype).
|
||||
|
||||
Accordingly, when such values are computed / initialized, care has to
|
||||
be takes to use / compute the proper type.
|
||||
|
||||
When a size in bits is converted into a size in bytes, which is expressed
|
||||
in trees, care should be taken to change the tree's type again to sizetype.
|
||||
|
||||
?? 1997:
|
||||
|
||||
In an effort to decrease cache thrashing and useless loads we've changed the
|
||||
third argument to the DEFTREECODE macro to be a single char. This will
|
||||
affect languages that defined their own tree codes (usually in a .def file).
|
||||
|
||||
Old way:
|
||||
|
||||
DEFTREECODE (CLASS_METHOD_DECL, "class_method_decl", "d", 0)
|
||||
|
||||
New way:
|
||||
|
||||
DEFTREECODE (CLASS_METHOD_DECL, "class_method_decl", 'd', 0)
|
File diff suppressed because it is too large
Load Diff
@ -1,986 +0,0 @@
|
||||
This file contains information about GCC releases up to GCC 2.8.1, and
|
||||
a tiny bit of information on EGCS.
|
||||
|
||||
For details of changes in EGCS releases and GCC 2.95 and later releases,
|
||||
see the release notes on the GCC web site or the file NEWS which contains
|
||||
the most relevant parts of those release notes in text form.
|
||||
|
||||
Changes in GCC for EGCS (that are not listed in the web release notes)
|
||||
---------------------------------------------------------------------
|
||||
|
||||
The compiler now supports the "ADDRESSOF" optimization which can significantly
|
||||
reduce the overhead for certain inline calls (and inline calls in general).
|
||||
|
||||
Compile time for certain programs using large constant initializers has been
|
||||
improved (affects glibc significantly).
|
||||
|
||||
Various improvements have been made to better support cross compilations. They
|
||||
are still not easy, but they are improving.
|
||||
|
||||
Target-specific changes:
|
||||
|
||||
M32r: Major improvements to this port.
|
||||
|
||||
Arm: Includes Thumb and super interworking support.
|
||||
|
||||
Noteworthy changes in GCC version 2.8.1
|
||||
---------------------------------------
|
||||
|
||||
Numerous bugs have been fixed and some minor performance
|
||||
improvements (compilation speed) have been made.
|
||||
|
||||
Noteworthy changes in GCC version 2.8.0
|
||||
---------------------------------------
|
||||
|
||||
A major change in this release is the addition of a framework for
|
||||
exception handling, currently used by C++. Many internal changes and
|
||||
optimization improvements have been made. These increase the
|
||||
maintainability and portability of GCC. GCC now uses autoconf to
|
||||
compute many host parameters.
|
||||
|
||||
The following lists changes that add new features or targets.
|
||||
|
||||
See cp/NEWS for new features of C++ in this release.
|
||||
|
||||
New tools and features:
|
||||
|
||||
The Dwarf 2 debugging information format is supported on ELF systems, and
|
||||
is the default for -ggdb where available. It can also be used for C++.
|
||||
The Dwarf version 1 debugging format is also permitted for C++, but
|
||||
does not work well.
|
||||
|
||||
gcov.c is provided for test coverage analysis and branch profiling
|
||||
analysis is also supported; see -fprofile-arcs, -ftest-coverage,
|
||||
and -fbranch-probabilities.
|
||||
|
||||
Support for the Checker memory checking tool.
|
||||
|
||||
New switch, -fstack-check, to check for stack overflow on systems that
|
||||
don't have such built into their ABI.
|
||||
|
||||
New switches, -Wundef and -Wno-undef to warn if an undefined identifier
|
||||
is evaluated in an #if directive.
|
||||
|
||||
Options -Wall and -Wimplicit now cause GCC to warn about implicit int
|
||||
in declarations (e.g. `register i;'), since the C Standard committee
|
||||
has decided to disallow this in the next revision of the standard;
|
||||
-Wimplicit-function-declarations and -Wimplicit-int are subsets of
|
||||
this.
|
||||
|
||||
Option -Wsign-compare causes GCC to warn about comparison of signed and
|
||||
unsigned values.
|
||||
|
||||
Add -dI option of cccp for cxref.
|
||||
|
||||
New features in configuration, installation and specs file handling:
|
||||
|
||||
New option --enable-c-cpplib to configure script.
|
||||
|
||||
You can use --with-cpu on the configure command to specify the default
|
||||
CPU that GCC should generate code for.
|
||||
|
||||
The -specs=file switch allows you to override default specs used in
|
||||
invoking programs like cc1, as, etc.
|
||||
|
||||
Allow including one specs file from another and renaming a specs
|
||||
variable.
|
||||
|
||||
You can now relocate all GCC files with a single environment variable
|
||||
or a registry entry under Windows 95 and Windows NT.
|
||||
|
||||
Changes in Objective-C:
|
||||
|
||||
The Objective-C Runtime Library has been made thread-safe.
|
||||
|
||||
The Objective-C Runtime Library contains an interface for creating
|
||||
mutexes, condition mutexes, and threads; it requires a back-end
|
||||
implementation for the specific platform and/or thread package.
|
||||
Currently supported are DEC/OSF1, IRIX, Mach, OS/2, POSIX, PCThreads,
|
||||
Solaris, and Windows32. The --enable-threads parameter can be used
|
||||
when configuring GCC to enable and select a thread back-end.
|
||||
|
||||
Objective-C is now configured as separate front-end language to GCC,
|
||||
making it more convenient to conditionally build it.
|
||||
|
||||
The internal structures of the Objective-C Runtime Library have
|
||||
changed sufficiently to warrant a new version number; now version 8.
|
||||
Programs compiled with an older version must be recompiled.
|
||||
|
||||
The Objective-C Runtime Library can be built as a DLL on Windows 95
|
||||
and Windows NT systems.
|
||||
|
||||
The Objective-C Runtime Library implements +load.
|
||||
|
||||
The following new targets are supported (see also list under each
|
||||
individual CPU below):
|
||||
|
||||
Embedded target m32r-elf.
|
||||
Embedded Hitachi Super-H using ELF.
|
||||
RTEMS real-time system on various CPU targets.
|
||||
ARC processor.
|
||||
NEC V850 processor.
|
||||
Matsushita MN10200 processor.
|
||||
Matsushita MN10300 processor.
|
||||
Sparc and PowerPC running on VxWorks.
|
||||
Support both glibc versions 1 and 2 on Linux-based GNU systems.
|
||||
|
||||
New features for DEC Alpha systems:
|
||||
|
||||
Allow detailed specification of IEEE fp support:
|
||||
-mieee, -mieee-with-inexact, and -mieee-conformant
|
||||
-mfp-trap-mode=xxx, -mfp-round-mode=xxx, -mtrap-precision=xxx
|
||||
-mcpu=xxx for CPU selection
|
||||
Support scheduling parameters for EV5.
|
||||
Add support for BWX, CIX, and MAX instruction set extensions.
|
||||
Support Linux-based GNU systems.
|
||||
Support VMS.
|
||||
|
||||
Additional supported processors and systems for MIPS targets:
|
||||
|
||||
MIPS4 instruction set.
|
||||
R4100, R4300 and R5000 processors.
|
||||
N32 and N64 ABI.
|
||||
IRIX 6.2.
|
||||
SNI SINIX.
|
||||
|
||||
New features for Intel x86 family:
|
||||
|
||||
Add scheduling parameters for Pentium and Pentium Pro.
|
||||
Support stabs on Solaris-x86.
|
||||
Intel x86 processors running the SCO OpenServer 5 family.
|
||||
Intel x86 processors running DG/UX.
|
||||
Intel x86 using Cygwin32 or Mingw32 on Windows 95 and Windows NT.
|
||||
|
||||
New features for Motorola 68k family:
|
||||
|
||||
Support for 68060 processor.
|
||||
More consistent switches to specify processor.
|
||||
Motorola 68k family running AUX.
|
||||
68040 running pSOS, ELF object files, DBX debugging.
|
||||
Coldfire variant of Motorola m68k family.
|
||||
|
||||
New features for the HP PA RISC:
|
||||
|
||||
-mspace and -mno-space
|
||||
-mlong-load-store and -mno-long-load-store
|
||||
-mbig-switch -mno-big-switch
|
||||
|
||||
GCC on the PA requires either gas-2.7 or the HP assembler; for best
|
||||
results using GAS is highly recommended. GAS is required for -g and
|
||||
exception handling support.
|
||||
|
||||
New features for SPARC-based systems:
|
||||
|
||||
The ultrasparc cpu.
|
||||
The sparclet cpu, supporting only a.out file format.
|
||||
Sparc running SunOS 4 with the GNU assembler.
|
||||
Sparc running the Linux-based GNU system.
|
||||
Embedded Sparc processors running the ELF object file format.
|
||||
-mcpu=xxx
|
||||
-mtune=xxx
|
||||
-malign-loops=xxx
|
||||
-malign-jumps=xxx
|
||||
-malign-functions=xxx
|
||||
-mimpure-text and -mno-impure-text
|
||||
|
||||
Options -mno-v8 and -mno-sparclite are no longer supported on SPARC
|
||||
targets. Options -mcypress, -mv8, -msupersparc, -msparclite, -mf930,
|
||||
and -mf934 are deprecated and will be deleted in GCC 2.9. Use
|
||||
-mcpu=xxx instead.
|
||||
|
||||
New features for rs6000 and PowerPC systems:
|
||||
|
||||
Solaris 2.51 running on PowerPC's.
|
||||
The Linux-based GNU system running on PowerPC's.
|
||||
-mcpu=604e,602,603e,620,801,823,mpc505,821,860,power2
|
||||
-mtune=xxx
|
||||
-mrelocatable-lib, -mno-relocatable-lib
|
||||
-msim, -mmve, -memb
|
||||
-mupdate, -mno-update
|
||||
-mfused-madd, -mno-fused-madd
|
||||
|
||||
-mregnames
|
||||
-meabi
|
||||
-mcall-linux, -mcall-solaris, -mcall-sysv-eabi, -mcall-sysv-noeabi
|
||||
-msdata, -msdata=none, -msdata=default, -msdata=sysv, -msdata=eabi
|
||||
-memb, -msim, -mmvme
|
||||
-myellowknife, -mads
|
||||
wchar_t is now of type long as per the ABI, not unsigned short.
|
||||
-p/-pg support
|
||||
-mcpu=403 now implies -mstrict-align.
|
||||
Implement System V profiling.
|
||||
|
||||
Aix 4.1 GCC targets now default to -mcpu=common so that programs
|
||||
compiled can be moved between rs6000 and powerpc based systems. A
|
||||
consequence of this is that -static won't work, and that some programs
|
||||
may be slightly slower.
|
||||
|
||||
You can select the default value to use for -mcpu=xxx on rs6000 and
|
||||
powerpc targets by using the --with-cpu=xxx option when configuring the
|
||||
compiler. In addition, a new options, -mtune=xxx was added that
|
||||
selects the machine to schedule for but does not select the
|
||||
architecture level.
|
||||
|
||||
Directory names used for storing the multilib libraries on System V
|
||||
and embedded PowerPC systems have been shortened to work with commands
|
||||
like tar that have fixed limits on pathname size.
|
||||
|
||||
New features for the Hitachi H8/300(H):
|
||||
|
||||
-malign-300
|
||||
-ms (for the Hitachi H8/S processor)
|
||||
-mint32
|
||||
|
||||
New features for the ARM:
|
||||
|
||||
-march=xxx, -mtune=xxx, -mcpu=xxx
|
||||
Support interworking with Thumb code.
|
||||
ARM processor with a.out object format, COFF, or AOF assembler.
|
||||
ARM on "semi-hosted" platform.
|
||||
ARM running NetBSD.
|
||||
ARM running the Linux-based GNU system.
|
||||
|
||||
New feature for Solaris systems:
|
||||
|
||||
GCC installation no longer makes a copy of system include files,
|
||||
thus insulating GCC better from updates to the operating system.
|
||||
|
||||
|
||||
Noteworthy changes in GCC version 2.7.2
|
||||
---------------------------------------
|
||||
|
||||
A few bugs have been fixed (most notably the generation of an
|
||||
invalid assembler opcode on some RS/6000 systems).
|
||||
|
||||
Noteworthy changes in GCC version 2.7.1
|
||||
---------------------------------------
|
||||
|
||||
This release fixes numerous bugs (mostly minor) in GCC 2.7.0, but
|
||||
also contains a few new features, mostly related to specific targets.
|
||||
|
||||
Major changes have been made in code to support Windows NT.
|
||||
|
||||
The following new targets are supported:
|
||||
|
||||
2.9 BSD on PDP-11
|
||||
Linux on m68k
|
||||
HP/UX version 10 on HP PA RISC (treated like version 9)
|
||||
DEC Alpha running Windows NT
|
||||
|
||||
When parsing C, GCC now recognizes C++ style `//' comments unless you
|
||||
specify `-ansi' or `-traditional'.
|
||||
|
||||
The PowerPC System V targets (powerpc-*-sysv, powerpc-*-eabi) now use the
|
||||
calling sequence specified in the System V Application Binary Interface
|
||||
Processor Supplement (PowerPC Processor ABI Supplement) rather than the calling
|
||||
sequence used in GCC version 2.7.0. That calling sequence was based on the AIX
|
||||
calling sequence without function descriptors. To compile code for that older
|
||||
calling sequence, either configure the compiler for powerpc-*-eabiaix or use
|
||||
the -mcall-aix switch when compiling and linking.
|
||||
|
||||
Noteworthy changes in GCC version 2.7.0
|
||||
---------------------------------------
|
||||
|
||||
GCC now works better on systems that use ".obj" and ".exe" instead of
|
||||
".o" and no extension. This involved changes to the driver program,
|
||||
gcc.c, to convert ".o" names to ".obj" and to GCC's Makefile to use
|
||||
".obj" and ".exe" in filenames that are not targets. In order to
|
||||
build GCC on such systems, you may need versions of GNU make and/or
|
||||
compatible shells. At this point, this support is preliminary.
|
||||
|
||||
Object file extensions of ".obj" and executable file extensions of
|
||||
".exe" are allowed when using appropriate version of GNU Make.
|
||||
|
||||
Numerous enhancements were made to the __attribute__ facility including
|
||||
more attributes and more places that support it. We now support the
|
||||
"packed", "nocommon", "noreturn", "volatile", "const", "unused",
|
||||
"transparent_union", "constructor", "destructor", "mode", "section",
|
||||
"align", "format", "weak", and "alias" attributes. Each of these
|
||||
names may also be specified with added underscores, e.g., "__packed__".
|
||||
__attribute__ may now be applied to parameter definitions, function
|
||||
definitions, and structure, enum, and union definitions.
|
||||
|
||||
GCC now supports returning more structures in registers, as specified by
|
||||
many calling sequences (ABIs), such as on the HP PA RISC.
|
||||
|
||||
A new option '-fpack-struct' was added to automatically pack all structure
|
||||
members together without holes.
|
||||
|
||||
There is a new library (cpplib) and program (cppmain) that at some
|
||||
point will replace cpp (aka cccp). To use cppmain as cpp now, pass
|
||||
the option CCCP=cppmain to make. The library is already used by the
|
||||
fix-header program, which should speed up the fixproto script.
|
||||
|
||||
New options for supported targets:
|
||||
|
||||
GNU on many targets.
|
||||
NetBSD on MIPS, m68k, VAX, and x86.
|
||||
LynxOS on x86, m68k, Sparc, and RS/6000.
|
||||
VxWorks on many targets.
|
||||
|
||||
Windows/NT on x86 architecture. Initial support for Windows/NT on Alpha
|
||||
(not fully working).
|
||||
|
||||
Many embedded targets, specifically UDI on a29k, aout, coff, elf,
|
||||
and vsta "operating systems" on m68k, m88k, mips, sparc, and x86.
|
||||
|
||||
Additional support for x86 (i386, i486, and Pentium):
|
||||
|
||||
Work with old and new linkers for Linux-based GNU systems,
|
||||
supporting both a.out and ELF.
|
||||
FreeBSD on x86.
|
||||
Stdcall convention.
|
||||
-malign-double, -mregparm=, -malign-loops= and -malign-jumps= switches.
|
||||
On ISC systems, support -Xp like -posix.
|
||||
|
||||
Additions for RS/6000:
|
||||
|
||||
Instruction scheduling information for PowerPC 403.
|
||||
AIX 4.1 on PowerPC.
|
||||
-mstring and -mno-string.
|
||||
-msoft-float and floating-point emulation included.
|
||||
Preliminary support for PowerPC System V.4 with or without the GNU as.
|
||||
Preliminary support for EABI.
|
||||
Preliminary support for 64-bit systems.
|
||||
Both big and little endian systems.
|
||||
|
||||
New features for MIPS-based systems:
|
||||
|
||||
r4650.
|
||||
mips4 and R8000.
|
||||
Irix 6.0.
|
||||
64-bit ABI.
|
||||
Allow dollar signs in labels on SGI/Irix 5.x.
|
||||
|
||||
New support for HP PA RISC:
|
||||
|
||||
Generation of PIC (requires binutils-2.5.2.u6 or later).
|
||||
HP-UX version 9 on HP PA RISC (dynamically links even with -g).
|
||||
Processor variants for HP PA RISC: 700, 7100, and 7100LC.
|
||||
Automatic generation of long calls when needed.
|
||||
-mfast-indirect-calls for kernels and static binaries.
|
||||
|
||||
The called routine now copies arguments passed by invisible reference,
|
||||
as required by the calling standard.
|
||||
|
||||
Other new miscellaneous target-specific support:
|
||||
|
||||
-mno-multm on a29k.
|
||||
-mold-align for i960.
|
||||
Configuration for "semi-hosted" ARM.
|
||||
-momit-leaf-frame-pointer for M88k.
|
||||
SH3 variant of Hitachi Super-H and support both big and little endian.
|
||||
|
||||
Changes to Objective-C:
|
||||
|
||||
Bare-bones implementation of NXConstantString has been added,
|
||||
which is invoked by the @"string" directive.
|
||||
|
||||
Class * has been changed to Class to conform to the NextSTEP and
|
||||
OpenStep runtime.
|
||||
|
||||
Enhancements to make dynamic loading easier.
|
||||
|
||||
The module version number has been updated to Version 7, thus existing
|
||||
code will need to be recompiled to use the current run-time library.
|
||||
|
||||
GCC now supports the ISO Normative Addendum 1 to the C Standard.
|
||||
As a result:
|
||||
|
||||
The header <iso646.h> defines macros for C programs written
|
||||
in national variants of ISO 646.
|
||||
|
||||
The following digraph tokens are supported:
|
||||
<: :> <% %> %: %:%:
|
||||
These behave like the following, respectively:
|
||||
[ ] { } # ##
|
||||
|
||||
Digraph tokens are supported unless you specify the `-traditional'
|
||||
option; you do not need to specify `-ansi' or `-trigraphs'. Except
|
||||
for contrived and unlikely examples involving preprocessor
|
||||
stringizing, digraph interpretation doesn't change the meaning of
|
||||
programs; this is unlike trigraph interpretation, which changes the
|
||||
meanings of relatively common strings.
|
||||
|
||||
The macro __STDC_VERSION__ has the value 199409L.
|
||||
|
||||
As usual, for full conformance to the standard, you also need a
|
||||
C library that conforms.
|
||||
|
||||
The following lists changes that have been made to g++. If some
|
||||
features mentioned below sound unfamiliar, you will probably want to
|
||||
look at the recently-released public review copy of the C++ Working
|
||||
Paper. For PostScript and PDF (Adobe Acrobat) versions, see the
|
||||
archive at ftp://research.att.com/dist/stdc++/WP. For HTML and ASCII
|
||||
versions, see ftp://ftp.cygnus.com/pub/g++. On the web, see
|
||||
http://www.cygnus.com/~mrs/wp-draft.
|
||||
|
||||
The scope of variables declared in the for-init-statement has been changed
|
||||
to conform to http://www.cygnus.com/~mrs/wp-draft/stmt.html#stmt.for; as a
|
||||
result, packages such as groff 1.09 will not compile unless you specify the
|
||||
-fno-for-scope flag. PLEASE DO NOT REPORT THIS AS A BUG; this is a change
|
||||
mandated by the C++ standardization committee.
|
||||
|
||||
Binary incompatibilities:
|
||||
|
||||
The builtin 'bool' type is now the size of a machine word on RISC targets,
|
||||
for code efficiency; it remains one byte long on CISC targets.
|
||||
|
||||
Code that does not use #pragma interface/implementation will most
|
||||
likely shrink dramatically, as g++ now only emits the vtable for a
|
||||
class in the translation unit where its first non-inline, non-abstract
|
||||
virtual function is defined.
|
||||
|
||||
Classes that do not define the copy constructor will sometimes be
|
||||
passed and returned in registers. This may illuminate latent bugs in
|
||||
your code.
|
||||
|
||||
Support for automatic template instantiation has *NOT* been added, due
|
||||
to a disagreement over design philosophies.
|
||||
|
||||
Support for exception handling has been improved; more targets are now
|
||||
supported, and throws will use the RTTI mechanism to match against the
|
||||
catch parameter type. Optimization is NOT SUPPORTED with
|
||||
-fhandle-exceptions; no need to report this as a bug.
|
||||
|
||||
Support for Run-Time Type Identification has been added with -frtti.
|
||||
This support is still in alpha; one major restriction is that any file
|
||||
compiled with -frtti must include <typeinfo.h>.
|
||||
|
||||
Preliminary support for namespaces has been added. This support is far
|
||||
from complete, and probably not useful.
|
||||
|
||||
Synthesis of compiler-generated constructors, destructors and
|
||||
assignment operators is now deferred until the functions are used.
|
||||
|
||||
The parsing of expressions such as `a ? b : c = 1' has changed from
|
||||
`(a ? b : c) = 1' to `a : b ? (c = 1)'.
|
||||
|
||||
The code generated for testing conditions, especially those using ||
|
||||
and &&, is now more efficient.
|
||||
|
||||
The operator keywords and, and_eq, bitand, bitor, compl, not, not_eq,
|
||||
or, or_eq, xor and xor_eq are now supported. Use -ansi or
|
||||
-foperator-names to enable them.
|
||||
|
||||
The 'explicit' keyword is now supported. 'explicit' is used to mark
|
||||
constructors and type conversion operators that should not be used
|
||||
implicitly.
|
||||
|
||||
g++ now accepts the typename keyword, though it currently has no
|
||||
semantics; it can be a no-op in the current template implementation.
|
||||
You may want to start using it in your code, however, since the
|
||||
pending rewrite of the template implementation to compile STL properly
|
||||
(perhaps for 2.8.0, perhaps not) will require you to use it as
|
||||
indicated by the current draft.
|
||||
|
||||
Handling of user-defined type conversion has been overhauled so that
|
||||
type conversion operators are now found and used properly in
|
||||
expressions and function calls.
|
||||
|
||||
-fno-strict-prototype now only applies to function declarations with
|
||||
"C" linkage.
|
||||
|
||||
g++ now warns about 'if (x=0)' with -Wparentheses or -Wall.
|
||||
|
||||
#pragma weak and #pragma pack are supported on System V R4 targets, as
|
||||
are various other target-specific #pragmas supported by gcc.
|
||||
|
||||
new and delete of const types is now allowed (with no additional
|
||||
semantics).
|
||||
|
||||
Explicit instantiation of template methods is now supported. Also,
|
||||
'inline template class foo<int>;' can be used to emit only the vtable
|
||||
for a template class.
|
||||
|
||||
With -fcheck-new, g++ will check the return value of all calls to
|
||||
operator new, and not attempt to modify a returned null pointer.
|
||||
|
||||
The template instantiation code now handles more conversions when
|
||||
passing to a parameter that does not depend on template arguments.
|
||||
This means that code like 'string s; cout << s;' now works.
|
||||
|
||||
Invalid jumps in a switch statement past declarations that require
|
||||
initializations are now caught.
|
||||
|
||||
Functions declared 'extern inline' now have the same linkage semantics
|
||||
as inline member functions. On supported targets, where previously
|
||||
these functions (and vtables, and template instantiations) would have
|
||||
been defined statically, they will now be defined as weak symbols so
|
||||
that only one out-of-line definition is used.
|
||||
|
||||
collect2 now demangles linker output, and c++filt has become part of
|
||||
the gcc distribution.
|
||||
|
||||
Noteworthy changes in GCC version 2.6.3:
|
||||
|
||||
A few more bugs have been fixed.
|
||||
|
||||
Noteworthy changes in GCC version 2.6.2:
|
||||
|
||||
A few bugs have been fixed.
|
||||
|
||||
Names of attributes can now be preceded and followed by double underscores.
|
||||
|
||||
Noteworthy changes in GCC version 2.6.1:
|
||||
|
||||
Numerous (mostly minor) bugs have been fixed.
|
||||
|
||||
The following new configurations are supported:
|
||||
|
||||
GNU on x86 (instead of treating it like MACH)
|
||||
NetBSD on Sparc and Motorola 68k
|
||||
AIX 4.1 on RS/6000 and PowerPC systems
|
||||
Sequent DYNIX/ptx 1.x and 2.x.
|
||||
Both COFF and ELF configurations on AViiON without using /bin/gcc
|
||||
Windows/NT on x86 architecture; preliminary
|
||||
AT&T DSP1610 digital signal processor chips
|
||||
i960 systems on bare boards using COFF
|
||||
PDP11; target only and not extensively tested
|
||||
|
||||
The -pg option is now supported for Alpha under OSF/1 V3.0 or later.
|
||||
|
||||
Files with an extension of ".c++" are treated as C++ code.
|
||||
|
||||
The -Xlinker and -Wl arguments are now passed to the linker in the
|
||||
position they were specified on the command line. This makes it
|
||||
possible, for example, to pass flags to the linker about specific
|
||||
object files.
|
||||
|
||||
The use of positional arguments to the configure script is no longer
|
||||
recommended. Use --target= to specify the target; see the GCC manual.
|
||||
|
||||
The 386 now supports two new switches: -mreg-alloc=<string> changes
|
||||
the default register allocation order used by the compiler, and
|
||||
-mno-wide-multiply disables the use of the mul/imul instructions that
|
||||
produce 64 bit results in EAX:EDX from 32 bit operands to do long long
|
||||
multiplies and 32-bit division by constants.
|
||||
|
||||
Noteworthy changes in GCC version 2.6.0:
|
||||
|
||||
Numerous bugs have been fixed, in the C and C++ front-ends, as
|
||||
well as in the common compiler code.
|
||||
|
||||
This release includes the C, Objective-C, and C++ compilers. However,
|
||||
we have moved the files for the C++ compiler (G++) files to a
|
||||
subdirectory, cp. Subsequent releases of GCC will split these files
|
||||
to a separate TAR file.
|
||||
|
||||
The G++ team has been tracking the development of the ANSI standard for C++.
|
||||
Here are some new features added from the latest working paper:
|
||||
|
||||
* built-in boolean type 'bool', with constants 'true' and 'false'.
|
||||
* array new and delete (operator new [] and delete []).
|
||||
* WP-conforming lifetime of temporaries.
|
||||
* explicit instantiation of templates (template class A<int>;),
|
||||
along with an option (-fno-implicit-templates) to disable emission
|
||||
of implicitly instantiated templates, obsoletes -fexternal-templates.
|
||||
* static member constants (static const int foo = 4; within the
|
||||
class declaration).
|
||||
|
||||
Many error messages have been improved to tell the user more about the
|
||||
problem. Conformance checking with -pedantic-errors has been
|
||||
improved. G++ now compiles Fresco.
|
||||
|
||||
There is now an experimental implementation of virtual functions using
|
||||
thunks instead of Cfront-style vtables, enabled with -fvtable-thunks.
|
||||
This option also enables a heuristic which causes the compiler to only
|
||||
emit the vtable in the translation unit where its first non-inline
|
||||
virtual function is defined; using this option and
|
||||
-fno-implicit-templates, users should be able to avoid #pragma
|
||||
interface/implementation altogether.
|
||||
|
||||
Signatures have been added as a GNU C++ extension. Using the option
|
||||
-fhandle-signatures, users are able to turn on recognition of
|
||||
signatures. A short introduction on signatures is in the section
|
||||
`Extension to the C++ Language' in the manual.
|
||||
|
||||
The `g++' program is now a C program, rather than a shell script.
|
||||
|
||||
Lots and lots and lots of bugs fixes, in nested types, access control,
|
||||
pointers to member functions, the parser, templates, overload
|
||||
resolution, etc, etc.
|
||||
|
||||
There have been two major enhancements to the Objective-C compiler:
|
||||
|
||||
1) Added portability. It now runs on Alpha, and some problems with
|
||||
message forwarding have been addressed on other platforms.
|
||||
|
||||
2) Selectors have been redefined to be pointers to structs like:
|
||||
{ void *sel_id, char *sel_types }, where the sel_id is the unique
|
||||
identifier, the selector itself is no longer unique.
|
||||
|
||||
Programmers should use the new function sel_eq to test selector
|
||||
equivalence.
|
||||
|
||||
The following major changes have been made to the base compiler and
|
||||
machine-specific files.
|
||||
|
||||
- The MIL-STD-1750A is a new port, but still preliminary.
|
||||
|
||||
- The h8/300h is now supported; both the h8/300 and h8/300h ports come
|
||||
with 32 bit IEEE 754 software floating point support.
|
||||
|
||||
- The 64-bit Sparc (v9) and 64-bit MIPS chips are supported.
|
||||
|
||||
- NetBSD is supported on m68k, Intel x86, and pc523 systems and FreeBSD
|
||||
on x86.
|
||||
|
||||
- COFF is supported on x86, m68k, and Sparc systems running LynxOS.
|
||||
|
||||
- 68K systems from Bull and Concurrent are supported and System V
|
||||
Release 4 is supported on the Atari.
|
||||
|
||||
- GCC supports GAS on the Motorola 3300 (sysV68) and debugging
|
||||
(assuming GAS) on the Plexus 68K system. (However, GAS does not yet
|
||||
work on those systems).
|
||||
|
||||
- System V Release 4 is supported on MIPS (Tandem).
|
||||
|
||||
- For DG/UX, an ELF configuration is now supported, and both the ELF
|
||||
and BCS configurations support ELF and COFF object file formats.
|
||||
|
||||
- OSF/1 V2.0 is supported on Alpha.
|
||||
|
||||
- Function profiling is also supported on Alpha.
|
||||
|
||||
- GAS and GDB is supported for Irix 5 (MIPS).
|
||||
|
||||
- "common mode" (code that will run on both POWER and PowerPC
|
||||
architectures) is now supported for the RS/6000 family; the
|
||||
compiler knows about more PPC chips.
|
||||
|
||||
- Both NeXTStep 2.1 and 3 are supported on 68k-based architectures.
|
||||
|
||||
- On the AMD 29k, the -msoft-float is now supported, as well as
|
||||
-mno-sum-in-toc for RS/6000, -mapp-regs and -mflat for Sparc, and
|
||||
-membedded-pic for MIPS.
|
||||
|
||||
- GCC can now convert division by integer constants into the equivalent
|
||||
multiplication and shift operations when that is faster than the
|
||||
division.
|
||||
|
||||
- Two new warning options, -Wbad-function-cast and
|
||||
-Wmissing-declarations have been added.
|
||||
|
||||
- Configurations may now add machine-specific __attribute__ options on
|
||||
type; many machines support the `section' attribute.
|
||||
|
||||
- The -ffast-math flag permits some optimization that violate strict
|
||||
IEEE rules, such as converting X * 0.0 to 0.0.
|
||||
|
||||
Noteworthy changes in GCC version 2.5.8:
|
||||
|
||||
This release only fixes a few serious bugs. These include fixes for a
|
||||
bug that prevented most programs from working on the RS/6000, a bug
|
||||
that caused invalid assembler code for programs with a `switch'
|
||||
statement on the NS32K, a G++ problem that caused undefined names in
|
||||
some configurations, and several less serious problems, some of which
|
||||
can affect most configuration.
|
||||
|
||||
Noteworthy change in GCC version 2.5.7:
|
||||
|
||||
This release only fixes a few bugs, one of which was causing bootstrap
|
||||
compare errors on some systems.
|
||||
|
||||
Noteworthy change in GCC version 2.5.6:
|
||||
|
||||
A few backend bugs have been fixed, some of which only occur on one
|
||||
machine.
|
||||
|
||||
The C++ compiler in 2.5.6 includes:
|
||||
|
||||
* fixes for some common crashes
|
||||
* correct handling of nested types that are referenced as `foo::bar'
|
||||
* spurious warnings about friends being declared static and never
|
||||
defined should no longer appear
|
||||
* enums that are local to a method in a class, or a class that's
|
||||
local to a function, are now handled correctly. For example:
|
||||
class foo { void bar () { enum { x, y } E; x; } };
|
||||
void bar () { class foo { enum { x, y } E; E baz; }; }
|
||||
|
||||
Noteworthy change in GCC version 2.5.5:
|
||||
|
||||
A large number of C++ bugs have been fixed.
|
||||
|
||||
The fixproto script adds prototypes conditionally on __cplusplus.
|
||||
|
||||
Noteworthy change in GCC version 2.5.4:
|
||||
|
||||
A bug fix in passing of structure arguments for the HP-PA architecture
|
||||
makes code compiled with GCC 2.5.4 incompatible with code compiled
|
||||
with earlier versions (if it passes struct arguments of 33 to 64 bits,
|
||||
interspersed with other types of arguments).
|
||||
|
||||
Noteworthy change in gcc version 2.5.3:
|
||||
|
||||
The method of "mangling" C++ function names has been changed. So you
|
||||
must recompile all C++ programs completely when you start using GCC
|
||||
2.5. Also, GCC 2.5 requires libg++ version 2.5. Earlier libg++
|
||||
versions won't work with GCC 2.5. (This is generally true--GCC
|
||||
version M.N requires libg++ version M.N.)
|
||||
|
||||
Noteworthy GCC changes in version 2.5:
|
||||
|
||||
* There is now support for the IBM 370 architecture as a target.
|
||||
Currently the only operating system supported is MVS; GCC does not run
|
||||
on MVS, so you must produce .s files using GCC as a cross compiler,
|
||||
then transfer them to MVS to assemble them. This port is not reliable
|
||||
yet.
|
||||
|
||||
* The Power PC is now supported.
|
||||
|
||||
* The i860-based Paragon machine is now supported.
|
||||
|
||||
* The Hitachi 3050 (an HP-PA machine) is now supported.
|
||||
|
||||
* The variable __GNUC_MINOR__ holds the minor version number of GCC, as
|
||||
an integer. For version 2.5.X, the value is 5.
|
||||
|
||||
* In C, initializers for static and global variables are now processed
|
||||
an element at a time, so that they don't need a lot of storage.
|
||||
|
||||
* The C syntax for specifying which structure field comes next in an
|
||||
initializer is now `.FIELDNAME='. The corresponding syntax for
|
||||
array initializers is now `[INDEX]='. For example,
|
||||
|
||||
char whitespace[256]
|
||||
= { [' '] = 1, ['\t'] = 1, ['\n'] = 1 };
|
||||
|
||||
This was changed to accord with the syntax proposed by the Numerical
|
||||
C Extensions Group (NCEG).
|
||||
|
||||
* Complex numbers are now supported in C. Use the keyword __complex__
|
||||
to declare complex data types. See the manual for details.
|
||||
|
||||
* GCC now supports `long double' meaningfully on the Sparc (128-bit
|
||||
floating point) and on the 386 (96-bit floating point). The Sparc
|
||||
support is enabled on Solaris 2.x because earlier system versions
|
||||
(SunOS 4) have bugs in the emulation.
|
||||
|
||||
* All targets now have assertions for cpu, machine and system. So you
|
||||
can now use assertions to distinguish among all supported targets.
|
||||
|
||||
* Nested functions in C may now be inline. Just declare them inline
|
||||
in the usual way.
|
||||
|
||||
* Packed structure members are now supported fully; it should be possible
|
||||
to access them on any supported target, no matter how little alignment
|
||||
they have.
|
||||
|
||||
* To declare that a function does not return, you must now write
|
||||
something like this (works only in 2.5):
|
||||
|
||||
void fatal () __attribute__ ((noreturn));
|
||||
|
||||
or like this (works in older versions too):
|
||||
|
||||
typedef void voidfn ();
|
||||
|
||||
volatile voidfn fatal;
|
||||
|
||||
It used to be possible to do so by writing this:
|
||||
|
||||
volatile void fatal ();
|
||||
|
||||
but it turns out that ANSI C requires that to mean something
|
||||
else (which is useless).
|
||||
|
||||
Likewise, to declare that a function is side-effect-free
|
||||
so that calls may be deleted or combined, write
|
||||
something like this (works only in 2.5):
|
||||
|
||||
int computation () __attribute__ ((const));
|
||||
|
||||
or like this (works in older versions too):
|
||||
|
||||
typedef int intfn ();
|
||||
|
||||
const intfn computation;
|
||||
|
||||
* The new option -iwithprefixbefore specifies a directory to add to
|
||||
the search path for include files in the same position where -I would
|
||||
put it, but uses the specified prefix just like -iwithprefix.
|
||||
|
||||
* Basic block profiling has been enhanced to record the function the
|
||||
basic block comes from, and if the module was compiled for debugging,
|
||||
the line number and filename. A default version of the basic block
|
||||
support module has been added to libgcc2 that appends the basic block
|
||||
information to a text file 'bb.out'. Machine descriptions can now
|
||||
override the basic block support module in the target macro file.
|
||||
|
||||
New features in g++:
|
||||
|
||||
* The new flag `-fansi-overloading' for C++. Use a newly implemented
|
||||
scheme of argument matching for C++. It makes g++ more accurately
|
||||
obey the rules set down in Chapter 13 of the Annotated C++ Reference
|
||||
Manual (the ARM). This option will be turned on by default in a
|
||||
future release.
|
||||
|
||||
* The -finline-debug flag is now gone (it was never really used by the
|
||||
compiler).
|
||||
|
||||
* Recognizing the syntax for pointers to members, e.g., "foo::*bar", has been
|
||||
dramatically improved. You should not get any syntax errors or incorrect
|
||||
runtime results while using pointers to members correctly; if you do, it's
|
||||
a definite bug.
|
||||
|
||||
* Forward declaration of an enum is now flagged as an error.
|
||||
|
||||
* Class-local typedefs are now working properly.
|
||||
|
||||
* Nested class support has been significantly improved. The compiler
|
||||
will now (in theory) support up to 240 nested classes before hitting
|
||||
other system limits (like memory size).
|
||||
|
||||
* There is a new C version of the `g++' driver, to replace the old
|
||||
shell script. This should significantly improve the performance of
|
||||
executing g++ on a system where a user's PATH environment variable
|
||||
references many NFS-mounted filesystems. This driver also works
|
||||
under MS-DOS and OS/2.
|
||||
|
||||
* The ANSI committee working on the C++ standard has adopted a new
|
||||
keyword `mutable'. This will allow you to make a specific member be
|
||||
modifiable in an otherwise const class.
|
||||
|
||||
Noteworthy GCC changes in version 2.4.4:
|
||||
|
||||
A crash building g++ on various hosts (including m68k) has been
|
||||
fixed. Also the g++ compiler no longer reports incorrect
|
||||
ambiguities in some situations where they do not exist, and
|
||||
const template member functions are now being found properly.
|
||||
|
||||
Noteworthy GCC changes in version 2.4:
|
||||
|
||||
* On each target, the default is now to return short structures
|
||||
compatibly with the "usual" compiler on that target.
|
||||
|
||||
For most targets, this means the default is to return all structures
|
||||
in memory, like long structures, in whatever way is used on that
|
||||
target. Use -freg-struct-return to enable returning short structures
|
||||
(and unions) in registers.
|
||||
|
||||
This change means that newly compiled binaries are incompatible with
|
||||
binaries compiled with previous versions of GCC.
|
||||
|
||||
On some targets, GCC is itself the usual compiler. On these targets,
|
||||
the default way to return short structures is still in registers.
|
||||
Use -fpcc-struct-return to tell GCC to return them in memory.
|
||||
|
||||
* There is now a floating point emulator which can imitate the way all
|
||||
supported target machines do floating point arithmetic.
|
||||
|
||||
This makes it possible to have cross compilation to and from the VAX,
|
||||
and between machines of different endianness. However, this works
|
||||
only when the target machine description is updated to use the new
|
||||
facilities, and not all have been updated.
|
||||
|
||||
This also makes possible support for longer floating point types.
|
||||
GCC 2.4 supports extended format on the 68K if you use `long double',
|
||||
for targets that have a 68881. (When we have run time library
|
||||
routines for extended floating point, then `long double' will use
|
||||
extended format on all 68K targets.)
|
||||
|
||||
We expect to support extended floating point on the i386 and Sparc in
|
||||
future versions.
|
||||
|
||||
* Building GCC now automatically fixes the system's header files.
|
||||
This should require no attention.
|
||||
|
||||
* GCC now installs an unsigned data type as size_t when it fixes the
|
||||
header files (on all but a handful of old target machines).
|
||||
Therefore, the bug that size_t failed to be unsigned is fixed.
|
||||
|
||||
* Building and installation are now completely separate.
|
||||
All new files are constructed during the build process;
|
||||
installation just copies them.
|
||||
|
||||
* New targets supported: Clipper, Hitachi SH, Hitachi 8300, and Sparc
|
||||
Lite.
|
||||
|
||||
* A totally new and much better Objective C run time system is included.
|
||||
|
||||
* Objective C supports many new features. Alas, I can't describe them
|
||||
since I don't use that language; however, they are the same ones
|
||||
supported in recent versions of the NeXT operating system.
|
||||
|
||||
* The builtin functions __builtin_apply_args, __builtin_apply and
|
||||
__builtin_return let you record the arguments and returned
|
||||
value of a function without knowing their number or type.
|
||||
|
||||
* The builtin string variables __FUNCTION__ and __PRETTY_FUNCTION__
|
||||
give the name of the function in the source, and a pretty-printed
|
||||
version of the name. The two are the same in C, but differ in C++.
|
||||
|
||||
* Casts to union types do not yield lvalues.
|
||||
|
||||
* ## before an empty rest argument discards the preceding sequence
|
||||
of non-whitespace characters from the macro definition.
|
||||
(This feature is subject to change.)
|
||||
|
||||
|
||||
New features specific to C++:
|
||||
|
||||
* The manual contains a new section ``Common Misunderstandings with
|
||||
GNU C++'' that C++ users should read.
|
||||
|
||||
* #pragma interface and #pragma implementation let you use the same
|
||||
C++ source file for both interface and implementation.
|
||||
However, this mechanism is still in transition.
|
||||
|
||||
* Named returned values let you avoid an extra constructor call
|
||||
when a function result has a class type.
|
||||
|
||||
* The C++ operators <? and >? yield min and max, respectively.
|
||||
|
||||
* C++ gotos can exit a block safely even if the block has
|
||||
aggregates that require destructors.
|
||||
|
||||
* gcc defines the macro __GNUG__ when compiling C++ programs.
|
||||
|
||||
* GNU C++ now correctly distinguishes between the prefix and postfix
|
||||
forms of overloaded operator ++ and --. To avoid breaking old
|
||||
code, if a class defines only the prefix form, the compiler
|
||||
accepts either ++obj or obj++, unless -pedantic is used.
|
||||
|
||||
* If you are using version 2.3 of libg++, you need to rebuild it with
|
||||
`make CC=gcc' to avoid mismatches in the definition of `size_t'.
|
||||
|
||||
Newly documented compiler options:
|
||||
|
||||
-fnostartfiles
|
||||
Omit the standard system startup files when linking.
|
||||
|
||||
-fvolatile-global
|
||||
Consider memory references to extern and global data items to
|
||||
be volatile.
|
||||
|
||||
-idirafter DIR
|
||||
Add DIR to the second include path.
|
||||
|
||||
-iprefix PREFIX
|
||||
Specify PREFIX for later -iwithprefix options.
|
||||
|
||||
-iwithprefix DIR
|
||||
Add PREFIX/DIR to the second include path.
|
||||
|
||||
-mv8
|
||||
Emit Sparc v8 code (with integer multiply and divide).
|
||||
-msparclite
|
||||
Emit Sparclite code (roughly v7.5).
|
||||
|
||||
-print-libgcc-file-name
|
||||
Search for the libgcc.a file, print its absolute file name, and exit.
|
||||
|
||||
-Woverloaded-virtual
|
||||
Warn when a derived class function declaration may be an error
|
||||
in defining a C++ virtual function.
|
||||
|
||||
-Wtemplate-debugging
|
||||
When using templates in a C++ program, warn if debugging is
|
||||
not yet fully available.
|
||||
|
||||
+eN
|
||||
Control how C++ virtual function definitions are used
|
||||
(like cfront 1.x).
|
||||
|
@ -1,197 +0,0 @@
|
||||
Copyright (C) 2000, 2003 Free Software Foundation, Inc.
|
||||
|
||||
This file is intended to contain a few notes about writing C code
|
||||
within GCC so that it compiles without error on the full range of
|
||||
compilers GCC needs to be able to compile on.
|
||||
|
||||
The problem is that many ISO-standard constructs are not accepted by
|
||||
either old or buggy compilers, and we keep getting bitten by them.
|
||||
This knowledge until know has been sparsely spread around, so I
|
||||
thought I'd collect it in one useful place. Please add and correct
|
||||
any problems as you come across them.
|
||||
|
||||
I'm going to start from a base of the ISO C90 standard, since that is
|
||||
probably what most people code to naturally. Obviously using
|
||||
constructs introduced after that is not a good idea.
|
||||
|
||||
For the complete coding style conventions used in GCC, please read
|
||||
http://gcc.gnu.org/codingconventions.html
|
||||
|
||||
|
||||
String literals
|
||||
---------------
|
||||
|
||||
Irix6 "cc -n32" and OSF4 "cc" have problems with constant string
|
||||
initializers with parens around it, e.g.
|
||||
|
||||
const char string[] = ("A string");
|
||||
|
||||
This is unfortunate since this is what the GNU gettext macro N_
|
||||
produces. You need to find a different way to code it.
|
||||
|
||||
Some compilers like MSVC++ have fairly low limits on the maximum
|
||||
length of a string literal; 509 is the lowest we've come across. You
|
||||
may need to break up a long printf statement into many smaller ones.
|
||||
|
||||
|
||||
Empty macro arguments
|
||||
---------------------
|
||||
|
||||
ISO C (6.8.3 in the 1990 standard) specifies the following:
|
||||
|
||||
If (before argument substitution) any argument consists of no
|
||||
preprocessing tokens, the behavior is undefined.
|
||||
|
||||
This was relaxed by ISO C99, but some older compilers emit an error,
|
||||
so code like
|
||||
|
||||
#define foo(x, y) x y
|
||||
foo (bar, )
|
||||
|
||||
needs to be coded in some other way.
|
||||
|
||||
|
||||
free and realloc
|
||||
----------------
|
||||
|
||||
Some implementations crash upon attempts to free or realloc the null
|
||||
pointer. Thus if mem might be null, you need to write
|
||||
|
||||
if (mem)
|
||||
free (mem);
|
||||
|
||||
|
||||
Trigraphs
|
||||
---------
|
||||
|
||||
You weren't going to use them anyway, but some otherwise ISO C
|
||||
compliant compilers do not accept trigraphs.
|
||||
|
||||
|
||||
Suffixes on Integer Constants
|
||||
-----------------------------
|
||||
|
||||
You should never use a 'l' suffix on integer constants ('L' is fine),
|
||||
since it can easily be confused with the number '1'.
|
||||
|
||||
|
||||
Common Coding Pitfalls
|
||||
======================
|
||||
|
||||
errno
|
||||
-----
|
||||
|
||||
errno might be declared as a macro.
|
||||
|
||||
|
||||
Implicit int
|
||||
------------
|
||||
|
||||
In C, the 'int' keyword can often be omitted from type declarations.
|
||||
For instance, you can write
|
||||
|
||||
unsigned variable;
|
||||
|
||||
as shorthand for
|
||||
|
||||
unsigned int variable;
|
||||
|
||||
There are several places where this can cause trouble. First, suppose
|
||||
'variable' is a long; then you might think
|
||||
|
||||
(unsigned) variable
|
||||
|
||||
would convert it to unsigned long. It does not. It converts to
|
||||
unsigned int. This mostly causes problems on 64-bit platforms, where
|
||||
long and int are not the same size.
|
||||
|
||||
Second, if you write a function definition with no return type at
|
||||
all:
|
||||
|
||||
operate (int a, int b)
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
that function is expected to return int, *not* void. GCC will warn
|
||||
about this.
|
||||
|
||||
Implicit function declarations always have return type int. So if you
|
||||
correct the above definition to
|
||||
|
||||
void
|
||||
operate (int a, int b)
|
||||
...
|
||||
|
||||
but operate() is called above its definition, you will get an error
|
||||
about a "type mismatch with previous implicit declaration". The cure
|
||||
is to prototype all functions at the top of the file, or in an
|
||||
appropriate header.
|
||||
|
||||
Char vs unsigned char vs int
|
||||
----------------------------
|
||||
|
||||
In C, unqualified 'char' may be either signed or unsigned; it is the
|
||||
implementation's choice. When you are processing 7-bit ASCII, it does
|
||||
not matter. But when your program must handle arbitrary binary data,
|
||||
or fully 8-bit character sets, you have a problem. The most obvious
|
||||
issue is if you have a look-up table indexed by characters.
|
||||
|
||||
For instance, the character '\341' in ISO Latin 1 is SMALL LETTER A
|
||||
WITH ACUTE ACCENT. In the proper locale, isalpha('\341') will be
|
||||
true. But if you read '\341' from a file and store it in a plain
|
||||
char, isalpha(c) may look up character 225, or it may look up
|
||||
character -31. And the ctype table has no entry at offset -31, so
|
||||
your program will crash. (If you're lucky.)
|
||||
|
||||
It is wise to use unsigned char everywhere you possibly can. This
|
||||
avoids all these problems. Unfortunately, the routines in <string.h>
|
||||
take plain char arguments, so you have to remember to cast them back
|
||||
and forth - or avoid the use of strxxx() functions, which is probably
|
||||
a good idea anyway.
|
||||
|
||||
Another common mistake is to use either char or unsigned char to
|
||||
receive the result of getc() or related stdio functions. They may
|
||||
return EOF, which is outside the range of values representable by
|
||||
char. If you use char, some legal character value may be confused
|
||||
with EOF, such as '\377' (SMALL LETTER Y WITH UMLAUT, in Latin-1).
|
||||
The correct choice is int.
|
||||
|
||||
A more subtle version of the same mistake might look like this:
|
||||
|
||||
unsigned char pushback[NPUSHBACK];
|
||||
int pbidx;
|
||||
#define unget(c) (assert(pbidx < NPUSHBACK), pushback[pbidx++] = (c))
|
||||
#define get(c) (pbidx ? pushback[--pbidx] : getchar())
|
||||
...
|
||||
unget(EOF);
|
||||
|
||||
which will mysteriously turn a pushed-back EOF into a SMALL LETTER Y
|
||||
WITH UMLAUT.
|
||||
|
||||
|
||||
Other common pitfalls
|
||||
---------------------
|
||||
|
||||
o Expecting 'plain' char to be either sign or unsigned extending.
|
||||
|
||||
o Shifting an item by a negative amount or by greater than or equal to
|
||||
the number of bits in a type (expecting shifts by 32 to be sensible
|
||||
has caused quite a number of bugs at least in the early days).
|
||||
|
||||
o Expecting ints shifted right to be sign extended.
|
||||
|
||||
o Modifying the same value twice within one sequence point.
|
||||
|
||||
o Host vs. target floating point representation, including emitting NaNs
|
||||
and Infinities in a form that the assembler handles.
|
||||
|
||||
o qsort being an unstable sort function (unstable in the sense that
|
||||
multiple items that sort the same may be sorted in different orders
|
||||
by different qsort functions).
|
||||
|
||||
o Passing incorrect types to fprintf and friends.
|
||||
|
||||
o Adding a function declaration for a module declared in another file to
|
||||
a .c file instead of to a .h file.
|
||||
|
@ -1,6 +0,0 @@
|
||||
There is a list of people who have asked to be listed as offering
|
||||
support services for GNU software for a fee or in some cases at no
|
||||
charge. This list used to be contained in this file, but it is now
|
||||
available on the web at
|
||||
|
||||
http://www.fsf.org/prep/service.html
|
@ -1,512 +0,0 @@
|
||||
dnl See whether we need a declaration for a function.
|
||||
dnl The result is highly dependent on the INCLUDES passed in, so make sure
|
||||
dnl to use a different cache variable name in this macro if it is invoked
|
||||
dnl in a different context somewhere else.
|
||||
dnl gcc_AC_CHECK_DECL(SYMBOL,
|
||||
dnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, INCLUDES]]])
|
||||
AC_DEFUN([gcc_AC_CHECK_DECL],
|
||||
[AC_MSG_CHECKING([whether $1 is declared])
|
||||
AC_CACHE_VAL(gcc_cv_have_decl_$1,
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$4],
|
||||
[#ifndef $1
|
||||
char *(*pfn) = (char *(*)) $1 ;
|
||||
#endif])], eval "gcc_cv_have_decl_$1=yes", eval "gcc_cv_have_decl_$1=no")])
|
||||
if eval "test \"`echo '$gcc_cv_have_decl_'$1`\" = yes"; then
|
||||
AC_MSG_RESULT(yes) ; ifelse([$2], , :, [$2])
|
||||
else
|
||||
AC_MSG_RESULT(no) ; ifelse([$3], , :, [$3])
|
||||
fi
|
||||
])dnl
|
||||
|
||||
dnl Check multiple functions to see whether each needs a declaration.
|
||||
dnl Arrange to define HAVE_DECL_<FUNCTION> to 0 or 1 as appropriate.
|
||||
dnl gcc_AC_CHECK_DECLS(SYMBOLS,
|
||||
dnl [ACTION-IF-NEEDED [, ACTION-IF-NOT-NEEDED [, INCLUDES]]])
|
||||
AC_DEFUN([gcc_AC_CHECK_DECLS],
|
||||
[AC_FOREACH([gcc_AC_Func], [$1],
|
||||
[AH_TEMPLATE(AS_TR_CPP(HAVE_DECL_[]gcc_AC_Func),
|
||||
[Define to 1 if we found a declaration for ']gcc_AC_Func[', otherwise
|
||||
define to 0.])])dnl
|
||||
for ac_func in $1
|
||||
do
|
||||
ac_tr_decl=AS_TR_CPP([HAVE_DECL_$ac_func])
|
||||
gcc_AC_CHECK_DECL($ac_func,
|
||||
[AC_DEFINE_UNQUOTED($ac_tr_decl, 1) $2],
|
||||
[AC_DEFINE_UNQUOTED($ac_tr_decl, 0) $3],
|
||||
dnl It is possible that the include files passed in here are local headers
|
||||
dnl which supply a backup declaration for the relevant prototype based on
|
||||
dnl the definition of (or lack of) the HAVE_DECL_ macro. If so, this test
|
||||
dnl will always return success. E.g. see libiberty.h's handling of
|
||||
dnl `basename'. To avoid this, we define the relevant HAVE_DECL_ macro to
|
||||
dnl 1 so that any local headers used do not provide their own prototype
|
||||
dnl during this test.
|
||||
#undef $ac_tr_decl
|
||||
#define $ac_tr_decl 1
|
||||
$4
|
||||
)
|
||||
done
|
||||
])
|
||||
|
||||
dnl 'make compare' can be significantly faster, if cmp itself can
|
||||
dnl skip bytes instead of using tail. The test being performed is
|
||||
dnl "if cmp --ignore-initial=2 t1 t2 && ! cmp --ignore-initial=1 t1 t2"
|
||||
dnl but we need to sink errors and handle broken shells. We also test
|
||||
dnl for the parameter format "cmp file1 file2 skip1 skip2" which is
|
||||
dnl accepted by cmp on some systems.
|
||||
AC_DEFUN([gcc_AC_PROG_CMP_IGNORE_INITIAL],
|
||||
[AC_CACHE_CHECK([for cmp's capabilities], gcc_cv_prog_cmp_skip,
|
||||
[ echo abfoo >t1
|
||||
echo cdfoo >t2
|
||||
gcc_cv_prog_cmp_skip=slowcompare
|
||||
if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then
|
||||
if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then
|
||||
:
|
||||
else
|
||||
gcc_cv_prog_cmp_skip=gnucompare
|
||||
fi
|
||||
fi
|
||||
if test $gcc_cv_prog_cmp_skip = slowcompare ; then
|
||||
if cmp t1 t2 2 2 > /dev/null 2>&1; then
|
||||
if cmp t1 t2 1 1 > /dev/null 2>&1; then
|
||||
:
|
||||
else
|
||||
gcc_cv_prog_cmp_skip=fastcompare
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
rm t1 t2
|
||||
])
|
||||
make_compare_target=$gcc_cv_prog_cmp_skip
|
||||
AC_SUBST(make_compare_target)
|
||||
])
|
||||
|
||||
dnl See if symbolic links work and if not, try to substitute either hard links or simple copy.
|
||||
AC_DEFUN([gcc_AC_PROG_LN_S],
|
||||
[AC_MSG_CHECKING(whether ln -s works)
|
||||
AC_CACHE_VAL(gcc_cv_prog_LN_S,
|
||||
[rm -f conftestdata_t
|
||||
echo >conftestdata_f
|
||||
if ln -s conftestdata_f conftestdata_t 2>/dev/null
|
||||
then
|
||||
gcc_cv_prog_LN_S="ln -s"
|
||||
else
|
||||
if ln conftestdata_f conftestdata_t 2>/dev/null
|
||||
then
|
||||
gcc_cv_prog_LN_S=ln
|
||||
else
|
||||
if cp -p conftestdata_f conftestdata_t 2>/dev/null
|
||||
then
|
||||
gcc_cv_prog_LN_S="cp -p"
|
||||
else
|
||||
gcc_cv_prog_LN_S=cp
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
rm -f conftestdata_f conftestdata_t
|
||||
])dnl
|
||||
LN_S="$gcc_cv_prog_LN_S"
|
||||
if test "$gcc_cv_prog_LN_S" = "ln -s"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
if test "$gcc_cv_prog_LN_S" = "ln"; then
|
||||
AC_MSG_RESULT([no, using ln])
|
||||
else
|
||||
AC_MSG_RESULT([no, and neither does ln, so using $gcc_cv_prog_LN_S])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(LN_S)dnl
|
||||
])
|
||||
|
||||
dnl Define MKDIR_TAKES_ONE_ARG if mkdir accepts only one argument instead
|
||||
dnl of the usual 2.
|
||||
AC_DEFUN([gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG],
|
||||
[AC_CACHE_CHECK([if mkdir takes one argument], gcc_cv_mkdir_takes_one_arg,
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
|
||||
#include <sys/types.h>
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
# include <sys/stat.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_DIRECT_H
|
||||
# include <direct.h>
|
||||
#endif], [mkdir ("foo", 0);])],
|
||||
gcc_cv_mkdir_takes_one_arg=no, gcc_cv_mkdir_takes_one_arg=yes)])
|
||||
if test $gcc_cv_mkdir_takes_one_arg = yes ; then
|
||||
AC_DEFINE(MKDIR_TAKES_ONE_ARG, 1, [Define if host mkdir takes a single argument.])
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN([gcc_AC_PROG_INSTALL],
|
||||
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
|
||||
# Find a good install program. We prefer a C program (faster),
|
||||
# so one script is as good as another. But avoid the broken or
|
||||
# incompatible versions:
|
||||
# SysV /etc/install, /usr/sbin/install
|
||||
# SunOS /usr/etc/install
|
||||
# IRIX /sbin/install
|
||||
# AIX /bin/install
|
||||
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
|
||||
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
|
||||
# ./install, which can be erroneously created by make from ./install.sh.
|
||||
AC_MSG_CHECKING(for a BSD compatible install)
|
||||
if test -z "$INSTALL"; then
|
||||
AC_CACHE_VAL(ac_cv_path_install,
|
||||
[ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in $PATH; do
|
||||
# Account for people who put trailing slashes in PATH elements.
|
||||
case "$ac_dir/" in
|
||||
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
|
||||
*)
|
||||
# OSF1 and SCO ODT 3.0 have their own names for install.
|
||||
for ac_prog in ginstall scoinst install; do
|
||||
if test -f $ac_dir/$ac_prog; then
|
||||
if test $ac_prog = install &&
|
||||
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
|
||||
# AIX install. It has an incompatible calling convention.
|
||||
# OSF/1 installbsd also uses dspmsg, but is usable.
|
||||
:
|
||||
else
|
||||
ac_cv_path_install="$ac_dir/$ac_prog -c"
|
||||
break 2
|
||||
fi
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
done
|
||||
IFS="$ac_save_IFS"
|
||||
])dnl
|
||||
if test "${ac_cv_path_install+set}" = set; then
|
||||
INSTALL="$ac_cv_path_install"
|
||||
else
|
||||
# As a last resort, use the slow shell script. We don't cache a
|
||||
# path for INSTALL within a source directory, because that will
|
||||
# break other packages using the cache if that directory is
|
||||
# removed, or if the path is relative.
|
||||
INSTALL="$ac_install_sh"
|
||||
fi
|
||||
fi
|
||||
dnl We do special magic for INSTALL instead of AC_SUBST, to get
|
||||
dnl relative paths right.
|
||||
AC_MSG_RESULT($INSTALL)
|
||||
AC_SUBST(INSTALL)dnl
|
||||
|
||||
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
|
||||
# It thinks the first close brace ends the variable substitution.
|
||||
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
|
||||
AC_SUBST(INSTALL_PROGRAM)dnl
|
||||
|
||||
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
|
||||
AC_SUBST(INSTALL_DATA)dnl
|
||||
])
|
||||
|
||||
# mmap(2) blacklisting. Some platforms provide the mmap library routine
|
||||
# but don't support all of the features we need from it.
|
||||
AC_DEFUN([gcc_AC_FUNC_MMAP_BLACKLIST],
|
||||
[
|
||||
AC_CHECK_HEADER([sys/mman.h],
|
||||
[gcc_header_sys_mman_h=yes], [gcc_header_sys_mman_h=no])
|
||||
AC_CHECK_FUNC([mmap], [gcc_func_mmap=yes], [gcc_func_mmap=no])
|
||||
if test "$gcc_header_sys_mman_h" != yes \
|
||||
|| test "$gcc_func_mmap" != yes; then
|
||||
gcc_cv_func_mmap_file=no
|
||||
gcc_cv_func_mmap_dev_zero=no
|
||||
gcc_cv_func_mmap_anon=no
|
||||
else
|
||||
AC_CACHE_CHECK([whether read-only mmap of a plain file works],
|
||||
gcc_cv_func_mmap_file,
|
||||
[# Add a system to this blacklist if
|
||||
# mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a
|
||||
# memory area containing the same data that you'd get if you applied
|
||||
# read() to the same fd. The only system known to have a problem here
|
||||
# is VMS, where text files have record structure.
|
||||
case "$host_os" in
|
||||
vms* | ultrix*)
|
||||
gcc_cv_func_mmap_file=no ;;
|
||||
*)
|
||||
gcc_cv_func_mmap_file=yes;;
|
||||
esac])
|
||||
AC_CACHE_CHECK([whether mmap from /dev/zero works],
|
||||
gcc_cv_func_mmap_dev_zero,
|
||||
[# Add a system to this blacklist if it has mmap() but /dev/zero
|
||||
# does not exist, or if mmapping /dev/zero does not give anonymous
|
||||
# zeroed pages with both the following properties:
|
||||
# 1. If you map N consecutive pages in with one call, and then
|
||||
# unmap any subset of those pages, the pages that were not
|
||||
# explicitly unmapped remain accessible.
|
||||
# 2. If you map two adjacent blocks of memory and then unmap them
|
||||
# both at once, they must both go away.
|
||||
# Systems known to be in this category are Windows (all variants),
|
||||
# VMS, and Darwin.
|
||||
case "$host_os" in
|
||||
vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00)
|
||||
gcc_cv_func_mmap_dev_zero=no ;;
|
||||
*)
|
||||
gcc_cv_func_mmap_dev_zero=yes;;
|
||||
esac])
|
||||
|
||||
# Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for.
|
||||
AC_CACHE_CHECK([for MAP_ANON(YMOUS)], gcc_cv_decl_map_anon,
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
||||
[#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifndef MAP_ANONYMOUS
|
||||
#define MAP_ANONYMOUS MAP_ANON
|
||||
#endif
|
||||
],
|
||||
[int n = MAP_ANONYMOUS;])],
|
||||
gcc_cv_decl_map_anon=yes,
|
||||
gcc_cv_decl_map_anon=no)])
|
||||
|
||||
if test $gcc_cv_decl_map_anon = no; then
|
||||
gcc_cv_func_mmap_anon=no
|
||||
else
|
||||
AC_CACHE_CHECK([whether mmap with MAP_ANON(YMOUS) works],
|
||||
gcc_cv_func_mmap_anon,
|
||||
[# Add a system to this blacklist if it has mmap() and MAP_ANON or
|
||||
# MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
|
||||
# doesn't give anonymous zeroed pages with the same properties listed
|
||||
# above for use of /dev/zero.
|
||||
# Systems known to be in this category are Windows, VMS, and SCO Unix.
|
||||
case "$host_os" in
|
||||
vms* | cygwin* | pe | mingw* | sco* | udk* )
|
||||
gcc_cv_func_mmap_anon=no ;;
|
||||
*)
|
||||
gcc_cv_func_mmap_anon=yes;;
|
||||
esac])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $gcc_cv_func_mmap_file = yes; then
|
||||
AC_DEFINE(HAVE_MMAP_FILE, 1,
|
||||
[Define if read-only mmap of a plain file works.])
|
||||
fi
|
||||
if test $gcc_cv_func_mmap_dev_zero = yes; then
|
||||
AC_DEFINE(HAVE_MMAP_DEV_ZERO, 1,
|
||||
[Define if mmap of /dev/zero works.])
|
||||
fi
|
||||
if test $gcc_cv_func_mmap_anon = yes; then
|
||||
AC_DEFINE(HAVE_MMAP_ANON, 1,
|
||||
[Define if mmap with MAP_ANON(YMOUS) works.])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Locate a program and check that its version is acceptable.
|
||||
dnl AC_PROG_CHECK_VER(var, name, version-switch,
|
||||
dnl version-extract-regexp, version-glob)
|
||||
AC_DEFUN([gcc_AC_CHECK_PROG_VER],
|
||||
[AC_REQUIRE([gcc_AC_BUILD_EXEEXT])
|
||||
AC_CHECK_PROG([$1], [$2], [$2])
|
||||
if test -n "[$]$1"; then
|
||||
# Found it, now check the version.
|
||||
AC_CACHE_CHECK(for modern $2, gcc_cv_prog_$2_modern,
|
||||
[changequote(<<,>>)dnl
|
||||
ac_prog_version=`<<$>>$1 $3 2>&1 |
|
||||
sed -n 's/^.*patsubst(<<$4>>,/,\/).*$/\1/p'`
|
||||
changequote([,])dnl
|
||||
echo "configure:__oline__: version of $2 is $ac_prog_version" >&AS_MESSAGE_LOG_FD
|
||||
changequote(<<,>>)dnl
|
||||
case $ac_prog_version in
|
||||
'') gcc_cv_prog_$2_modern=no;;
|
||||
<<$5>>)
|
||||
gcc_cv_prog_$2_modern=yes;;
|
||||
*) gcc_cv_prog_$2_modern=no;;
|
||||
esac
|
||||
changequote([,])dnl
|
||||
])
|
||||
else
|
||||
gcc_cv_prog_$2_modern=no
|
||||
fi
|
||||
])
|
||||
|
||||
dnl Determine if enumerated bitfields are unsigned. ISO C says they can
|
||||
dnl be either signed or unsigned.
|
||||
dnl
|
||||
AC_DEFUN([gcc_AC_C_ENUM_BF_UNSIGNED],
|
||||
[AC_CACHE_CHECK(for unsigned enumerated bitfields, gcc_cv_enum_bf_unsigned,
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([#include <stdlib.h>
|
||||
enum t { BLAH = 128 } ;
|
||||
struct s_t { enum t member : 8; } s ;
|
||||
int main(void)
|
||||
{
|
||||
s.member = BLAH;
|
||||
if (s.member < 0) exit(1);
|
||||
exit(0);
|
||||
|
||||
}])], gcc_cv_enum_bf_unsigned=yes, gcc_cv_enum_bf_unsigned=no, gcc_cv_enum_bf_unsigned=yes)])
|
||||
if test $gcc_cv_enum_bf_unsigned = yes; then
|
||||
AC_DEFINE(ENUM_BITFIELDS_ARE_UNSIGNED, 1,
|
||||
[Define if enumerated bitfields are treated as unsigned values.])
|
||||
fi])
|
||||
|
||||
dnl Probe number of bits in a byte.
|
||||
dnl Note C89 requires CHAR_BIT >= 8.
|
||||
dnl
|
||||
AC_DEFUN([gcc_AC_C_CHAR_BIT],
|
||||
[AC_CACHE_CHECK(for CHAR_BIT, gcc_cv_decl_char_bit,
|
||||
[AC_EGREP_CPP(found,
|
||||
[#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif
|
||||
#ifdef CHAR_BIT
|
||||
found
|
||||
#endif], gcc_cv_decl_char_bit=yes, gcc_cv_decl_char_bit=no)
|
||||
])
|
||||
if test $gcc_cv_decl_char_bit = no; then
|
||||
AC_CACHE_CHECK(number of bits in a byte, gcc_cv_c_nbby,
|
||||
[i=8
|
||||
gcc_cv_c_nbby=
|
||||
while test $i -lt 65; do
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,
|
||||
[switch(0) {
|
||||
case (unsigned char)((unsigned long)1 << $i) == ((unsigned long)1 << $i):
|
||||
case (unsigned char)((unsigned long)1<<($i-1)) == ((unsigned long)1<<($i-1)):
|
||||
; }])],
|
||||
[gcc_cv_c_nbby=$i; break])
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
test -z "$gcc_cv_c_nbby" && gcc_cv_c_nbby=failed
|
||||
])
|
||||
if test $gcc_cv_c_nbby = failed; then
|
||||
AC_MSG_ERROR(cannot determine number of bits in a byte)
|
||||
else
|
||||
AC_DEFINE_UNQUOTED(CHAR_BIT, $gcc_cv_c_nbby,
|
||||
[Define as the number of bits in a byte, if \`limits.h' doesn't.])
|
||||
fi
|
||||
fi])
|
||||
|
||||
AC_DEFUN([gcc_AC_INITFINI_ARRAY],
|
||||
[AC_ARG_ENABLE(initfini-array,
|
||||
[ --enable-initfini-array use .init_array/.fini_array sections],
|
||||
[], [
|
||||
AC_CACHE_CHECK(for .preinit_array/.init_array/.fini_array support,
|
||||
gcc_cv_initfini_array, [dnl
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([
|
||||
static int x = -1;
|
||||
int main (void) { return x; }
|
||||
int foo (void) { x = 0; }
|
||||
int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;])],
|
||||
[gcc_cv_initfini_array=yes], [gcc_cv_initfini_array=no],
|
||||
[gcc_cv_initfini_array=no])])
|
||||
enable_initfini_array=$gcc_cv_initfini_array
|
||||
])
|
||||
if test $enable_initfini_array = yes; then
|
||||
AC_DEFINE(HAVE_INITFINI_ARRAY, 1,
|
||||
[Define .init_array/.fini_array sections are available and working.])
|
||||
fi])
|
||||
|
||||
dnl # _gcc_COMPUTE_GAS_VERSION
|
||||
dnl # Used by gcc_GAS_VERSION_GTE_IFELSE
|
||||
dnl #
|
||||
dnl # WARNING:
|
||||
dnl # gcc_cv_as_gas_srcdir must be defined before this.
|
||||
dnl # This gross requirement will go away eventually.
|
||||
AC_DEFUN([_gcc_COMPUTE_GAS_VERSION],
|
||||
[gcc_cv_as_bfd_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/bfd
|
||||
for f in $gcc_cv_as_bfd_srcdir/configure \
|
||||
$gcc_cv_as_gas_srcdir/configure \
|
||||
$gcc_cv_as_gas_srcdir/configure.in \
|
||||
$gcc_cv_as_gas_srcdir/Makefile.in ; do
|
||||
gcc_cv_gas_version=`sed -n -e 's/^[[ ]]*\(VERSION=[[0-9]]*\.[[0-9]]*.*\)/\1/p' < $f`
|
||||
if test x$gcc_cv_gas_version != x; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
gcc_cv_gas_major_version=`expr "$gcc_cv_gas_version" : "VERSION=\([[0-9]]*\)"`
|
||||
gcc_cv_gas_minor_version=`expr "$gcc_cv_gas_version" : "VERSION=[[0-9]]*\.\([[0-9]]*\)"`
|
||||
gcc_cv_gas_patch_version=`expr "$gcc_cv_gas_version" : "VERSION=[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)"`
|
||||
case $gcc_cv_gas_patch_version in
|
||||
"") gcc_cv_gas_patch_version="0" ;;
|
||||
esac
|
||||
gcc_cv_gas_vers=`expr \( \( $gcc_cv_gas_major_version \* 1000 \) \
|
||||
+ $gcc_cv_gas_minor_version \) \* 1000 \
|
||||
+ $gcc_cv_gas_patch_version`
|
||||
]) []dnl # _gcc_COMPUTE_GAS_VERSION
|
||||
|
||||
dnl # gcc_GAS_VERSION_GTE_IFELSE([elf,] major, minor, patchlevel,
|
||||
dnl # [command_if_true = :], [command_if_false = :])
|
||||
dnl # Check to see if the version of GAS is greater than or
|
||||
dnl # equal to the specified version.
|
||||
dnl #
|
||||
dnl # The first ifelse() shortens the shell code if the patchlevel
|
||||
dnl # is unimportant (the usual case). The others handle missing
|
||||
dnl # commands. Note that the tests are structured so that the most
|
||||
dnl # common version number cases are tested first.
|
||||
AC_DEFUN([_gcc_GAS_VERSION_GTE_IFELSE],
|
||||
[ifelse([$1], elf,
|
||||
[if test $in_tree_gas_is_elf = yes \
|
||||
&&],
|
||||
[if]) test $gcc_cv_gas_vers -ge `expr \( \( $2 \* 1000 \) + $3 \) \* 1000 + $4`
|
||||
then dnl
|
||||
ifelse([$5],,:,[$5])[]dnl
|
||||
ifelse([$6],,,[
|
||||
else $6])
|
||||
fi])
|
||||
|
||||
AC_DEFUN([gcc_GAS_VERSION_GTE_IFELSE],
|
||||
[AC_REQUIRE([_gcc_COMPUTE_GAS_VERSION])dnl
|
||||
ifelse([$1], elf, [_gcc_GAS_VERSION_GTE_IFELSE($@)],
|
||||
[_gcc_GAS_VERSION_GTE_IFELSE(,$@)])])
|
||||
|
||||
dnl gcc_GAS_CHECK_FEATURE(description, cv, [[elf,]major,minor,patchlevel],
|
||||
dnl [extra switches to as], [assembler input],
|
||||
dnl [extra testing logic], [command if feature available])
|
||||
dnl
|
||||
dnl Checks for an assembler feature. If we are building an in-tree
|
||||
dnl gas, the feature is available if the associated assembler version
|
||||
dnl is greater than or equal to major.minor.patchlevel. If not, then
|
||||
dnl ASSEMBLER INPUT is fed to the assembler and the feature is available
|
||||
dnl if assembly succeeds. If EXTRA TESTING LOGIC is not the empty string,
|
||||
dnl then it is run instead of simply setting CV to "yes" - it is responsible
|
||||
dnl for doing so, if appropriate.
|
||||
AC_DEFUN([gcc_GAS_CHECK_FEATURE],
|
||||
[AC_CACHE_CHECK([assembler for $1], [$2],
|
||||
[[$2]=no
|
||||
ifelse([$3],,,[dnl
|
||||
if test $in_tree_gas = yes; then
|
||||
gcc_GAS_VERSION_GTE_IFELSE($3, [[$2]=yes])
|
||||
el])if test x$gcc_cv_as != x; then
|
||||
echo ifelse(m4_substr([$5],0,1),[$], "[$5]", '[$5]') > conftest.s
|
||||
if AC_TRY_COMMAND([$gcc_cv_as $4 -o conftest.o conftest.s >&AS_MESSAGE_LOG_FD])
|
||||
then
|
||||
ifelse([$6],, [$2]=yes, [$6])
|
||||
else
|
||||
echo "configure: failed program was" >&AS_MESSAGE_LOG_FD
|
||||
cat conftest.s >&AS_MESSAGE_LOG_FD
|
||||
fi
|
||||
rm -f conftest.o conftest.s
|
||||
fi])
|
||||
ifelse([$7],,,[dnl
|
||||
if test $[$2] = yes; then
|
||||
$7
|
||||
fi])])
|
||||
|
||||
dnl GCC_TARGET_TEMPLATE(KEY)
|
||||
dnl ------------------------
|
||||
dnl Define KEY as a valid configure key on the target machine.
|
||||
|
||||
m4_define([GCC_TARGET_TEMPLATE],
|
||||
[m4_define([GCC_TARGET_TEMPLATE($1)],[])])
|
||||
|
||||
dnl AH_TEMPLATE(KEY, DESCRIPTION)
|
||||
dnl -----------------------------
|
||||
dnl Issue an autoheader template for KEY, i.e., a comment composed of
|
||||
dnl DESCRIPTION (properly wrapped), and then #undef KEY. Redefinition
|
||||
dnl of the macro in autoheader.m4, to support definition of only a few
|
||||
dnl keys while compiling target libraries.
|
||||
|
||||
m4_define([AH_TEMPLATE],
|
||||
[AH_VERBATIM([$1],m4_text_wrap([$2 */], [ ], [/* ])
|
||||
m4_ifdef([GCC_TARGET_TEMPLATE($1)],[],[#ifndef USED_FOR_TARGET
|
||||
])[#undef $1]m4_ifdef([GCC_TARGET_TEMPLATE($1)],[],[
|
||||
#endif
|
||||
]))])
|
||||
|
||||
dnl Make sure that build_exeext is looked for
|
||||
AC_DEFUN([gcc_AC_BUILD_EXEEXT], [
|
||||
ac_executable_extensions="$build_exeext"])
|
||||
|
104
contrib/gcc/aclocal.m4
vendored
104
contrib/gcc/aclocal.m4
vendored
@ -1,104 +0,0 @@
|
||||
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
|
||||
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
|
||||
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
|
||||
#
|
||||
# Of course, Automake must honor this variable whenever it calls a
|
||||
# tool from the auxiliary directory. The problem is that $srcdir (and
|
||||
# therefore $ac_aux_dir as well) can be either absolute or relative,
|
||||
# depending on how configure is run. This is pretty annoying, since
|
||||
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
|
||||
# source directory, any form will work fine, but in subdirectories a
|
||||
# relative path needs to be adjusted first.
|
||||
#
|
||||
# $ac_aux_dir/missing
|
||||
# fails when called from a subdirectory if $ac_aux_dir is relative
|
||||
# $top_srcdir/$ac_aux_dir/missing
|
||||
# fails if $ac_aux_dir is absolute,
|
||||
# fails when called from a subdirectory in a VPATH build with
|
||||
# a relative $ac_aux_dir
|
||||
#
|
||||
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
|
||||
# are both prefixed by $srcdir. In an in-source build this is usually
|
||||
# harmless because $srcdir is `.', but things will broke when you
|
||||
# start a VPATH build or use an absolute $srcdir.
|
||||
#
|
||||
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
|
||||
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
|
||||
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
|
||||
# and then we would define $MISSING as
|
||||
# MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# This will work as long as MISSING is not called from configure, because
|
||||
# unfortunately $(top_srcdir) has no meaning in configure.
|
||||
# However there are other variables, like CC, which are often used in
|
||||
# configure, and could therefore not use this "fixed" $ac_aux_dir.
|
||||
#
|
||||
# Another solution, used here, is to always expand $ac_aux_dir to an
|
||||
# absolute PATH. The drawback is that using absolute paths prevent a
|
||||
# configured tree to be moved without reconfiguration.
|
||||
|
||||
AC_DEFUN([AM_AUX_DIR_EXPAND],
|
||||
[dnl Rely on autoconf to set up CDPATH properly.
|
||||
AC_PREREQ([2.50])dnl
|
||||
# expand $ac_aux_dir to an absolute path
|
||||
am_aux_dir=`cd $ac_aux_dir && pwd`
|
||||
])
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# AM_PROG_CC_C_O
|
||||
# --------------
|
||||
# Like AC_PROG_CC_C_O, but changed for automake.
|
||||
AC_DEFUN([AM_PROG_CC_C_O],
|
||||
[AC_REQUIRE([AC_PROG_CC_C_O])dnl
|
||||
AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
# FIXME: we rely on the cache variable name because
|
||||
# there is no other way.
|
||||
set dummy $CC
|
||||
ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
|
||||
if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then
|
||||
# Losing compiler, so override with the script.
|
||||
# FIXME: It is wrong to rewrite CC.
|
||||
# But if we don't then we get into trouble of one sort or another.
|
||||
# A longer-term fix would be to have automake use am__CC in this case,
|
||||
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
|
||||
CC="$am_aux_dir/compile $CC"
|
||||
fi
|
||||
])
|
||||
|
||||
m4_include([../config/acx.m4])
|
||||
m4_include([../config/codeset.m4])
|
||||
m4_include([../config/gettext-sister.m4])
|
||||
m4_include([../config/iconv.m4])
|
||||
m4_include([../config/lcmessage.m4])
|
||||
m4_include([../config/lib-ld.m4])
|
||||
m4_include([../config/lib-link.m4])
|
||||
m4_include([../config/lib-prefix.m4])
|
||||
m4_include([../config/progtest.m4])
|
||||
m4_include([acinclude.m4])
|
@ -1,81 +0,0 @@
|
||||
/* Inline functions to test validity of reg classes for addressing modes.
|
||||
Copyright (C) 2006 Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
/* Wrapper function to unify target macros MODE_CODE_BASE_REG_CLASS,
|
||||
MODE_BASE_REG_REG_CLASS, MODE_BASE_REG_CLASS and BASE_REG_CLASS.
|
||||
Arguments as for the MODE_CODE_BASE_REG_CLASS macro. */
|
||||
|
||||
static inline enum reg_class
|
||||
base_reg_class (enum machine_mode mode ATTRIBUTE_UNUSED,
|
||||
enum rtx_code outer_code ATTRIBUTE_UNUSED,
|
||||
enum rtx_code index_code ATTRIBUTE_UNUSED)
|
||||
{
|
||||
#ifdef MODE_CODE_BASE_REG_CLASS
|
||||
return MODE_CODE_BASE_REG_CLASS (mode, outer_code, index_code);
|
||||
#else
|
||||
#ifdef MODE_BASE_REG_REG_CLASS
|
||||
if (index_code == REG)
|
||||
return MODE_BASE_REG_REG_CLASS (mode);
|
||||
#endif
|
||||
#ifdef MODE_BASE_REG_CLASS
|
||||
return MODE_BASE_REG_CLASS (mode);
|
||||
#else
|
||||
return BASE_REG_CLASS;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Wrapper function to unify target macros REGNO_MODE_CODE_OK_FOR_BASE_P,
|
||||
REGNO_MODE_OK_FOR_REG_BASE_P, REGNO_MODE_OK_FOR_BASE_P and
|
||||
REGNO_OK_FOR_BASE_P.
|
||||
Arguments as for the REGNO_MODE_CODE_OK_FOR_BASE_P macro. */
|
||||
|
||||
static inline bool
|
||||
ok_for_base_p_1 (unsigned regno, enum machine_mode mode ATTRIBUTE_UNUSED,
|
||||
enum rtx_code outer_code ATTRIBUTE_UNUSED,
|
||||
enum rtx_code index_code ATTRIBUTE_UNUSED)
|
||||
{
|
||||
#ifdef REGNO_MODE_CODE_OK_FOR_BASE_P
|
||||
return REGNO_MODE_CODE_OK_FOR_BASE_P (regno, mode, outer_code, index_code);
|
||||
#else
|
||||
#ifdef REGNO_MODE_OK_FOR_REG_BASE_P
|
||||
if (index_code == REG)
|
||||
return REGNO_MODE_OK_FOR_REG_BASE_P (regno, mode);
|
||||
#endif
|
||||
#ifdef REGNO_MODE_OK_FOR_BASE_P
|
||||
return REGNO_MODE_OK_FOR_BASE_P (regno, mode);
|
||||
#else
|
||||
return REGNO_OK_FOR_BASE_P (regno);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Wrapper around ok_for_base_p_1, for use after register allocation is
|
||||
complete. Arguments as for the called function. */
|
||||
|
||||
static inline bool
|
||||
regno_ok_for_base_p (unsigned regno, enum machine_mode mode,
|
||||
enum rtx_code outer_code, enum rtx_code index_code)
|
||||
{
|
||||
if (regno >= FIRST_PSEUDO_REGISTER && reg_renumber[regno] >= 0)
|
||||
regno = reg_renumber[regno];
|
||||
|
||||
return ok_for_base_p_1 (regno, mode, outer_code, index_code);
|
||||
}
|
2638
contrib/gcc/alias.c
2638
contrib/gcc/alias.c
File diff suppressed because it is too large
Load Diff
@ -1,35 +0,0 @@
|
||||
/* Exported functions from alias.c
|
||||
Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifndef GCC_ALIAS_H
|
||||
#define GCC_ALIAS_H
|
||||
|
||||
extern HOST_WIDE_INT new_alias_set (void);
|
||||
extern HOST_WIDE_INT get_varargs_alias_set (void);
|
||||
extern HOST_WIDE_INT get_frame_alias_set (void);
|
||||
extern bool component_uses_parent_alias_set (tree);
|
||||
|
||||
/* This alias set can be used to force a memory to conflict with all
|
||||
other memories, creating a barrier across which no memory reference
|
||||
can move. Note that there are other legacy ways to create such
|
||||
memory barriers, including an address of SCRATCH. */
|
||||
#define ALIAS_SET_MEMORY_BARRIER ((HOST_WIDE_INT) -1)
|
||||
|
||||
#endif /* GCC_ALIAS_H */
|
@ -1,361 +0,0 @@
|
||||
/* Functions to support a pool of allocatable objects.
|
||||
Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006
|
||||
Free Software Foundation, Inc.
|
||||
Contributed by Daniel Berlin <dan@cgsoftware.com>
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "alloc-pool.h"
|
||||
#include "hashtab.h"
|
||||
|
||||
#define align_eight(x) (((x+7) >> 3) << 3)
|
||||
|
||||
/* The internal allocation object. */
|
||||
typedef struct allocation_object_def
|
||||
{
|
||||
#ifdef ENABLE_CHECKING
|
||||
/* The ID of alloc pool which the object was allocated from. */
|
||||
ALLOC_POOL_ID_TYPE id;
|
||||
#endif
|
||||
|
||||
union
|
||||
{
|
||||
/* The data of the object. */
|
||||
char data[1];
|
||||
|
||||
/* Because we want any type of data to be well aligned after the ID,
|
||||
the following elements are here. They are never accessed so
|
||||
the allocated object may be even smaller than this structure. */
|
||||
char *align_p;
|
||||
HOST_WIDEST_INT align_i;
|
||||
long double align_ld;
|
||||
} u;
|
||||
} allocation_object;
|
||||
|
||||
/* Convert a pointer to allocation_object from a pointer to user data. */
|
||||
#define ALLOCATION_OBJECT_PTR_FROM_USER_PTR(X) \
|
||||
((allocation_object *) (((char *) (X)) \
|
||||
- offsetof (allocation_object, u.data)))
|
||||
|
||||
/* Convert a pointer to user data from a pointer to allocation_object. */
|
||||
#define USER_PTR_FROM_ALLOCATION_OBJECT_PTR(X) \
|
||||
((void *) (((allocation_object *) (X))->u.data))
|
||||
|
||||
#ifdef ENABLE_CHECKING
|
||||
/* Last used ID. */
|
||||
static ALLOC_POOL_ID_TYPE last_id;
|
||||
#endif
|
||||
|
||||
#ifdef GATHER_STATISTICS
|
||||
|
||||
/* Store information about each particular alloc_pool. */
|
||||
struct alloc_pool_descriptor
|
||||
{
|
||||
const char *name;
|
||||
int allocated;
|
||||
int created;
|
||||
int peak;
|
||||
int current;
|
||||
};
|
||||
|
||||
/* Hashtable mapping alloc_pool names to descriptors. */
|
||||
static htab_t alloc_pool_hash;
|
||||
|
||||
/* Hashtable helpers. */
|
||||
static hashval_t
|
||||
hash_descriptor (const void *p)
|
||||
{
|
||||
const struct alloc_pool_descriptor *d = p;
|
||||
return htab_hash_pointer (d->name);
|
||||
}
|
||||
static int
|
||||
eq_descriptor (const void *p1, const void *p2)
|
||||
{
|
||||
const struct alloc_pool_descriptor *d = p1;
|
||||
return d->name == p2;
|
||||
}
|
||||
|
||||
/* For given name, return descriptor, create new if needed. */
|
||||
static struct alloc_pool_descriptor *
|
||||
alloc_pool_descriptor (const char *name)
|
||||
{
|
||||
struct alloc_pool_descriptor **slot;
|
||||
|
||||
if (!alloc_pool_hash)
|
||||
alloc_pool_hash = htab_create (10, hash_descriptor, eq_descriptor, NULL);
|
||||
|
||||
slot = (struct alloc_pool_descriptor **)
|
||||
htab_find_slot_with_hash (alloc_pool_hash, name,
|
||||
htab_hash_pointer (name),
|
||||
1);
|
||||
if (*slot)
|
||||
return *slot;
|
||||
*slot = xcalloc (sizeof (**slot), 1);
|
||||
(*slot)->name = name;
|
||||
return *slot;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Create a pool of things of size SIZE, with NUM in each block we
|
||||
allocate. */
|
||||
|
||||
alloc_pool
|
||||
create_alloc_pool (const char *name, size_t size, size_t num)
|
||||
{
|
||||
alloc_pool pool;
|
||||
size_t pool_size, header_size;
|
||||
#ifdef GATHER_STATISTICS
|
||||
struct alloc_pool_descriptor *desc;
|
||||
#endif
|
||||
|
||||
gcc_assert (name);
|
||||
|
||||
/* Make size large enough to store the list header. */
|
||||
if (size < sizeof (alloc_pool_list))
|
||||
size = sizeof (alloc_pool_list);
|
||||
|
||||
/* Now align the size to a multiple of 4. */
|
||||
size = align_eight (size);
|
||||
|
||||
#ifdef ENABLE_CHECKING
|
||||
/* Add the aligned size of ID. */
|
||||
size += offsetof (allocation_object, u.data);
|
||||
#endif
|
||||
|
||||
/* Um, we can't really allocate 0 elements per block. */
|
||||
gcc_assert (num);
|
||||
|
||||
/* Find the size of the pool structure, and the name. */
|
||||
pool_size = sizeof (struct alloc_pool_def);
|
||||
|
||||
/* and allocate that much memory. */
|
||||
pool = xmalloc (pool_size);
|
||||
|
||||
/* Now init the various pieces of our pool structure. */
|
||||
pool->name = /*xstrdup (name)*/name;
|
||||
#ifdef GATHER_STATISTICS
|
||||
desc = alloc_pool_descriptor (name);
|
||||
desc->created++;
|
||||
#endif
|
||||
pool->elt_size = size;
|
||||
pool->elts_per_block = num;
|
||||
|
||||
/* List header size should be a multiple of 8. */
|
||||
header_size = align_eight (sizeof (struct alloc_pool_list_def));
|
||||
|
||||
pool->block_size = (size * num) + header_size;
|
||||
pool->free_list = NULL;
|
||||
pool->elts_allocated = 0;
|
||||
pool->elts_free = 0;
|
||||
pool->blocks_allocated = 0;
|
||||
pool->block_list = NULL;
|
||||
|
||||
#ifdef ENABLE_CHECKING
|
||||
/* Increase the last used ID and use it for this pool.
|
||||
ID == 0 is used for free elements of pool so skip it. */
|
||||
last_id++;
|
||||
if (last_id == 0)
|
||||
last_id++;
|
||||
|
||||
pool->id = last_id;
|
||||
#endif
|
||||
|
||||
return (pool);
|
||||
}
|
||||
|
||||
/* Free all memory allocated for the given memory pool. */
|
||||
void
|
||||
free_alloc_pool (alloc_pool pool)
|
||||
{
|
||||
alloc_pool_list block, next_block;
|
||||
#ifdef GATHER_STATISTICS
|
||||
struct alloc_pool_descriptor *desc = alloc_pool_descriptor (pool->name);
|
||||
#endif
|
||||
|
||||
gcc_assert (pool);
|
||||
|
||||
/* Free each block allocated to the pool. */
|
||||
for (block = pool->block_list; block != NULL; block = next_block)
|
||||
{
|
||||
next_block = block->next;
|
||||
free (block);
|
||||
#ifdef GATHER_STATISTICS
|
||||
desc->current -= pool->block_size;
|
||||
#endif
|
||||
}
|
||||
#ifdef ENABLE_CHECKING
|
||||
memset (pool, 0xaf, sizeof (*pool));
|
||||
#endif
|
||||
/* Lastly, free the pool. */
|
||||
free (pool);
|
||||
}
|
||||
|
||||
/* Frees the alloc_pool, if it is empty and zero *POOL in this case. */
|
||||
void
|
||||
free_alloc_pool_if_empty (alloc_pool *pool)
|
||||
{
|
||||
if ((*pool)->elts_free == (*pool)->elts_allocated)
|
||||
{
|
||||
free_alloc_pool (*pool);
|
||||
*pool = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocates one element from the pool specified. */
|
||||
void *
|
||||
pool_alloc (alloc_pool pool)
|
||||
{
|
||||
alloc_pool_list header;
|
||||
char *block;
|
||||
#ifdef GATHER_STATISTICS
|
||||
struct alloc_pool_descriptor *desc = alloc_pool_descriptor (pool->name);
|
||||
|
||||
desc->allocated+=pool->elt_size;
|
||||
#endif
|
||||
|
||||
gcc_assert (pool);
|
||||
|
||||
/* If there are no more free elements, make some more!. */
|
||||
if (!pool->free_list)
|
||||
{
|
||||
size_t i;
|
||||
alloc_pool_list block_header;
|
||||
|
||||
/* Make the block. */
|
||||
block = XNEWVEC (char, pool->block_size);
|
||||
block_header = (alloc_pool_list) block;
|
||||
block += align_eight (sizeof (struct alloc_pool_list_def));
|
||||
#ifdef GATHER_STATISTICS
|
||||
desc->current += pool->block_size;
|
||||
if (desc->peak < desc->current)
|
||||
desc->peak = desc->current;
|
||||
#endif
|
||||
|
||||
/* Throw it on the block list. */
|
||||
block_header->next = pool->block_list;
|
||||
pool->block_list = block_header;
|
||||
|
||||
/* Now put the actual block pieces onto the free list. */
|
||||
for (i = 0; i < pool->elts_per_block; i++, block += pool->elt_size)
|
||||
{
|
||||
#ifdef ENABLE_CHECKING
|
||||
/* Mark the element to be free. */
|
||||
((allocation_object *) block)->id = 0;
|
||||
#endif
|
||||
header = (alloc_pool_list) USER_PTR_FROM_ALLOCATION_OBJECT_PTR (block);
|
||||
header->next = pool->free_list;
|
||||
pool->free_list = header;
|
||||
}
|
||||
/* Also update the number of elements we have free/allocated, and
|
||||
increment the allocated block count. */
|
||||
pool->elts_allocated += pool->elts_per_block;
|
||||
pool->elts_free += pool->elts_per_block;
|
||||
pool->blocks_allocated += 1;
|
||||
}
|
||||
|
||||
/* Pull the first free element from the free list, and return it. */
|
||||
header = pool->free_list;
|
||||
pool->free_list = header->next;
|
||||
pool->elts_free--;
|
||||
|
||||
#ifdef ENABLE_CHECKING
|
||||
/* Set the ID for element. */
|
||||
ALLOCATION_OBJECT_PTR_FROM_USER_PTR (header)->id = pool->id;
|
||||
#endif
|
||||
|
||||
return ((void *) header);
|
||||
}
|
||||
|
||||
/* Puts PTR back on POOL's free list. */
|
||||
void
|
||||
pool_free (alloc_pool pool, void *ptr)
|
||||
{
|
||||
alloc_pool_list header;
|
||||
|
||||
gcc_assert (ptr);
|
||||
|
||||
#ifdef ENABLE_CHECKING
|
||||
memset (ptr, 0xaf, pool->elt_size - offsetof (allocation_object, u.data));
|
||||
|
||||
/* Check whether the PTR was allocated from POOL. */
|
||||
gcc_assert (pool->id == ALLOCATION_OBJECT_PTR_FROM_USER_PTR (ptr)->id);
|
||||
|
||||
/* Mark the element to be free. */
|
||||
ALLOCATION_OBJECT_PTR_FROM_USER_PTR (ptr)->id = 0;
|
||||
#else
|
||||
/* Check if we free more than we allocated, which is Bad (TM). */
|
||||
gcc_assert (pool->elts_free < pool->elts_allocated);
|
||||
#endif
|
||||
|
||||
header = (alloc_pool_list) ptr;
|
||||
header->next = pool->free_list;
|
||||
pool->free_list = header;
|
||||
pool->elts_free++;
|
||||
}
|
||||
/* Output per-alloc_pool statistics. */
|
||||
#ifdef GATHER_STATISTICS
|
||||
|
||||
/* Used to accumulate statistics about alloc_pool sizes. */
|
||||
struct output_info
|
||||
{
|
||||
int count;
|
||||
int size;
|
||||
};
|
||||
|
||||
/* Called via htab_traverse. Output alloc_pool descriptor pointed out by SLOT
|
||||
and update statistics. */
|
||||
static int
|
||||
print_statistics (void **slot, void *b)
|
||||
{
|
||||
struct alloc_pool_descriptor *d = (struct alloc_pool_descriptor *) *slot;
|
||||
struct output_info *i = (struct output_info *) b;
|
||||
|
||||
if (d->allocated)
|
||||
{
|
||||
fprintf (stderr, "%-21s %6d %10d %10d %10d\n", d->name,
|
||||
d->created, d->allocated, d->peak, d->current);
|
||||
i->size += d->allocated;
|
||||
i->count += d->created;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Output per-alloc_pool memory usage statistics. */
|
||||
void
|
||||
dump_alloc_pool_statistics (void)
|
||||
{
|
||||
#ifdef GATHER_STATISTICS
|
||||
struct output_info info;
|
||||
|
||||
if (!alloc_pool_hash)
|
||||
return;
|
||||
|
||||
fprintf (stderr, "\nAlloc-pool Kind Pools Allocated Peak Leak\n");
|
||||
fprintf (stderr, "-------------------------------------------------------------\n");
|
||||
info.count = 0;
|
||||
info.size = 0;
|
||||
htab_traverse (alloc_pool_hash, print_statistics, &info);
|
||||
fprintf (stderr, "-------------------------------------------------------------\n");
|
||||
fprintf (stderr, "%-20s %7d %10d\n",
|
||||
"Total", info.count, info.size);
|
||||
fprintf (stderr, "-------------------------------------------------------------\n");
|
||||
#endif
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
/* Functions to support a pool of allocatable objects
|
||||
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004
|
||||
Free Software Foundation, Inc.
|
||||
Contributed by Daniel Berlin <dan@cgsoftware.com>
|
||||
|
||||
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 2, 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 COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
#ifndef ALLOC_POOL_H
|
||||
#define ALLOC_POOL_H
|
||||
|
||||
typedef unsigned long ALLOC_POOL_ID_TYPE;
|
||||
|
||||
typedef struct alloc_pool_list_def
|
||||
{
|
||||
struct alloc_pool_list_def *next;
|
||||
}
|
||||
*alloc_pool_list;
|
||||
|
||||
typedef struct alloc_pool_def
|
||||
{
|
||||
const char *name;
|
||||
#ifdef ENABLE_CHECKING
|
||||
ALLOC_POOL_ID_TYPE id;
|
||||
#endif
|
||||
size_t elts_per_block;
|
||||
alloc_pool_list free_list;
|
||||
size_t elts_allocated;
|
||||
size_t elts_free;
|
||||
size_t blocks_allocated;
|
||||
alloc_pool_list block_list;
|
||||
size_t block_size;
|
||||
size_t elt_size;
|
||||
}
|
||||
*alloc_pool;
|
||||
|
||||
extern alloc_pool create_alloc_pool (const char *, size_t, size_t);
|
||||
extern void free_alloc_pool (alloc_pool);
|
||||
extern void free_alloc_pool_if_empty (alloc_pool *);
|
||||
extern void *pool_alloc (alloc_pool);
|
||||
extern void pool_free (alloc_pool, void *);
|
||||
extern void dump_alloc_pool_statistics (void);
|
||||
#endif
|
@ -1,349 +0,0 @@
|
||||
/* Functions dealing with attribute handling, used by most front ends.
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
|
||||
2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "tree.h"
|
||||
#include "flags.h"
|
||||
#include "toplev.h"
|
||||
#include "output.h"
|
||||
#include "rtl.h"
|
||||
#include "ggc.h"
|
||||
#include "tm_p.h"
|
||||
#include "cpplib.h"
|
||||
#include "target.h"
|
||||
#include "langhooks.h"
|
||||
|
||||
static void init_attributes (void);
|
||||
|
||||
/* Table of the tables of attributes (common, language, format, machine)
|
||||
searched. */
|
||||
static const struct attribute_spec *attribute_tables[4];
|
||||
|
||||
static bool attributes_initialized = false;
|
||||
|
||||
/* Default empty table of attributes. */
|
||||
static const struct attribute_spec empty_attribute_table[] =
|
||||
{
|
||||
{ NULL, 0, 0, false, false, false, NULL }
|
||||
};
|
||||
|
||||
/* Initialize attribute tables, and make some sanity checks
|
||||
if --enable-checking. */
|
||||
|
||||
static void
|
||||
init_attributes (void)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
attribute_tables[0] = lang_hooks.common_attribute_table;
|
||||
attribute_tables[1] = lang_hooks.attribute_table;
|
||||
attribute_tables[2] = lang_hooks.format_attribute_table;
|
||||
attribute_tables[3] = targetm.attribute_table;
|
||||
|
||||
/* Translate NULL pointers to pointers to the empty table. */
|
||||
for (i = 0; i < ARRAY_SIZE (attribute_tables); i++)
|
||||
if (attribute_tables[i] == NULL)
|
||||
attribute_tables[i] = empty_attribute_table;
|
||||
|
||||
#ifdef ENABLE_CHECKING
|
||||
/* Make some sanity checks on the attribute tables. */
|
||||
for (i = 0; i < ARRAY_SIZE (attribute_tables); i++)
|
||||
{
|
||||
int j;
|
||||
|
||||
for (j = 0; attribute_tables[i][j].name != NULL; j++)
|
||||
{
|
||||
/* The name must not begin and end with __. */
|
||||
const char *name = attribute_tables[i][j].name;
|
||||
int len = strlen (name);
|
||||
|
||||
gcc_assert (!(name[0] == '_' && name[1] == '_'
|
||||
&& name[len - 1] == '_' && name[len - 2] == '_'));
|
||||
|
||||
/* The minimum and maximum lengths must be consistent. */
|
||||
gcc_assert (attribute_tables[i][j].min_length >= 0);
|
||||
|
||||
gcc_assert (attribute_tables[i][j].max_length == -1
|
||||
|| (attribute_tables[i][j].max_length
|
||||
>= attribute_tables[i][j].min_length));
|
||||
|
||||
/* An attribute cannot require both a DECL and a TYPE. */
|
||||
gcc_assert (!attribute_tables[i][j].decl_required
|
||||
|| !attribute_tables[i][j].type_required);
|
||||
|
||||
/* If an attribute requires a function type, in particular
|
||||
it requires a type. */
|
||||
gcc_assert (!attribute_tables[i][j].function_type_required
|
||||
|| attribute_tables[i][j].type_required);
|
||||
}
|
||||
}
|
||||
|
||||
/* Check that each name occurs just once in each table. */
|
||||
for (i = 0; i < ARRAY_SIZE (attribute_tables); i++)
|
||||
{
|
||||
int j, k;
|
||||
for (j = 0; attribute_tables[i][j].name != NULL; j++)
|
||||
for (k = j + 1; attribute_tables[i][k].name != NULL; k++)
|
||||
gcc_assert (strcmp (attribute_tables[i][j].name,
|
||||
attribute_tables[i][k].name));
|
||||
}
|
||||
/* Check that no name occurs in more than one table. */
|
||||
for (i = 0; i < ARRAY_SIZE (attribute_tables); i++)
|
||||
{
|
||||
size_t j, k, l;
|
||||
|
||||
for (j = i + 1; j < ARRAY_SIZE (attribute_tables); j++)
|
||||
for (k = 0; attribute_tables[i][k].name != NULL; k++)
|
||||
for (l = 0; attribute_tables[j][l].name != NULL; l++)
|
||||
gcc_assert (strcmp (attribute_tables[i][k].name,
|
||||
attribute_tables[j][l].name));
|
||||
}
|
||||
#endif
|
||||
|
||||
attributes_initialized = true;
|
||||
}
|
||||
|
||||
/* Process the attributes listed in ATTRIBUTES and install them in *NODE,
|
||||
which is either a DECL (including a TYPE_DECL) or a TYPE. If a DECL,
|
||||
it should be modified in place; if a TYPE, a copy should be created
|
||||
unless ATTR_FLAG_TYPE_IN_PLACE is set in FLAGS. FLAGS gives further
|
||||
information, in the form of a bitwise OR of flags in enum attribute_flags
|
||||
from tree.h. Depending on these flags, some attributes may be
|
||||
returned to be applied at a later stage (for example, to apply
|
||||
a decl attribute to the declaration rather than to its type). */
|
||||
|
||||
tree
|
||||
decl_attributes (tree *node, tree attributes, int flags)
|
||||
{
|
||||
tree a;
|
||||
tree returned_attrs = NULL_TREE;
|
||||
|
||||
if (!attributes_initialized)
|
||||
init_attributes ();
|
||||
|
||||
targetm.insert_attributes (*node, &attributes);
|
||||
|
||||
for (a = attributes; a; a = TREE_CHAIN (a))
|
||||
{
|
||||
tree name = TREE_PURPOSE (a);
|
||||
tree args = TREE_VALUE (a);
|
||||
tree *anode = node;
|
||||
const struct attribute_spec *spec = NULL;
|
||||
bool no_add_attrs = 0;
|
||||
tree fn_ptr_tmp = NULL_TREE;
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE (attribute_tables); i++)
|
||||
{
|
||||
int j;
|
||||
|
||||
for (j = 0; attribute_tables[i][j].name != NULL; j++)
|
||||
{
|
||||
if (is_attribute_p (attribute_tables[i][j].name, name))
|
||||
{
|
||||
spec = &attribute_tables[i][j];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (spec != NULL)
|
||||
break;
|
||||
}
|
||||
|
||||
if (spec == NULL)
|
||||
{
|
||||
warning (OPT_Wattributes, "%qs attribute directive ignored",
|
||||
IDENTIFIER_POINTER (name));
|
||||
continue;
|
||||
}
|
||||
else if (list_length (args) < spec->min_length
|
||||
|| (spec->max_length >= 0
|
||||
&& list_length (args) > spec->max_length))
|
||||
{
|
||||
error ("wrong number of arguments specified for %qs attribute",
|
||||
IDENTIFIER_POINTER (name));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (spec->decl_required && !DECL_P (*anode))
|
||||
{
|
||||
if (flags & ((int) ATTR_FLAG_DECL_NEXT
|
||||
| (int) ATTR_FLAG_FUNCTION_NEXT
|
||||
| (int) ATTR_FLAG_ARRAY_NEXT))
|
||||
{
|
||||
/* Pass on this attribute to be tried again. */
|
||||
returned_attrs = tree_cons (name, args, returned_attrs);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
warning (OPT_Wattributes, "%qs attribute does not apply to types",
|
||||
IDENTIFIER_POINTER (name));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we require a type, but were passed a decl, set up to make a
|
||||
new type and update the one in the decl. ATTR_FLAG_TYPE_IN_PLACE
|
||||
would have applied if we'd been passed a type, but we cannot modify
|
||||
the decl's type in place here. */
|
||||
if (spec->type_required && DECL_P (*anode))
|
||||
{
|
||||
anode = &TREE_TYPE (*anode);
|
||||
flags &= ~(int) ATTR_FLAG_TYPE_IN_PLACE;
|
||||
}
|
||||
|
||||
if (spec->function_type_required && TREE_CODE (*anode) != FUNCTION_TYPE
|
||||
&& TREE_CODE (*anode) != METHOD_TYPE)
|
||||
{
|
||||
/* APPLE LOCAL radar 6246527 */
|
||||
if ((TREE_CODE (*anode) == POINTER_TYPE || TREE_CODE (*anode) == BLOCK_POINTER_TYPE)
|
||||
&& (TREE_CODE (TREE_TYPE (*anode)) == FUNCTION_TYPE
|
||||
|| TREE_CODE (TREE_TYPE (*anode)) == METHOD_TYPE))
|
||||
{
|
||||
/* OK, this is a bit convoluted. We can't just make a copy
|
||||
of the pointer type and modify its TREE_TYPE, because if
|
||||
we change the attributes of the target type the pointer
|
||||
type needs to have a different TYPE_MAIN_VARIANT. So we
|
||||
pull out the target type now, frob it as appropriate, and
|
||||
rebuild the pointer type later.
|
||||
|
||||
This would all be simpler if attributes were part of the
|
||||
declarator, grumble grumble. */
|
||||
fn_ptr_tmp = TREE_TYPE (*anode);
|
||||
anode = &fn_ptr_tmp;
|
||||
flags &= ~(int) ATTR_FLAG_TYPE_IN_PLACE;
|
||||
}
|
||||
else if (flags & (int) ATTR_FLAG_FUNCTION_NEXT)
|
||||
{
|
||||
/* Pass on this attribute to be tried again. */
|
||||
returned_attrs = tree_cons (name, args, returned_attrs);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (TREE_CODE (*anode) != FUNCTION_TYPE
|
||||
&& TREE_CODE (*anode) != METHOD_TYPE)
|
||||
{
|
||||
warning (OPT_Wattributes,
|
||||
"%qs attribute only applies to function types",
|
||||
IDENTIFIER_POINTER (name));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (TYPE_P (*anode)
|
||||
&& (flags & (int) ATTR_FLAG_TYPE_IN_PLACE)
|
||||
&& TYPE_SIZE (*anode) != NULL_TREE)
|
||||
{
|
||||
warning (OPT_Wattributes, "type attributes ignored after type is already defined");
|
||||
continue;
|
||||
}
|
||||
|
||||
if (spec->handler != NULL)
|
||||
returned_attrs = chainon ((*spec->handler) (anode, name, args,
|
||||
flags, &no_add_attrs),
|
||||
returned_attrs);
|
||||
|
||||
/* Layout the decl in case anything changed. */
|
||||
if (spec->type_required && DECL_P (*node)
|
||||
&& (TREE_CODE (*node) == VAR_DECL
|
||||
|| TREE_CODE (*node) == PARM_DECL
|
||||
|| TREE_CODE (*node) == RESULT_DECL))
|
||||
relayout_decl (*node);
|
||||
|
||||
if (!no_add_attrs)
|
||||
{
|
||||
tree old_attrs;
|
||||
tree a;
|
||||
|
||||
if (DECL_P (*anode))
|
||||
old_attrs = DECL_ATTRIBUTES (*anode);
|
||||
else
|
||||
old_attrs = TYPE_ATTRIBUTES (*anode);
|
||||
|
||||
for (a = lookup_attribute (spec->name, old_attrs);
|
||||
a != NULL_TREE;
|
||||
a = lookup_attribute (spec->name, TREE_CHAIN (a)))
|
||||
{
|
||||
if (simple_cst_equal (TREE_VALUE (a), args) == 1)
|
||||
break;
|
||||
}
|
||||
|
||||
if (a == NULL_TREE)
|
||||
{
|
||||
/* This attribute isn't already in the list. */
|
||||
if (DECL_P (*anode))
|
||||
DECL_ATTRIBUTES (*anode) = tree_cons (name, args, old_attrs);
|
||||
else if (flags & (int) ATTR_FLAG_TYPE_IN_PLACE)
|
||||
{
|
||||
TYPE_ATTRIBUTES (*anode) = tree_cons (name, args, old_attrs);
|
||||
/* If this is the main variant, also push the attributes
|
||||
out to the other variants. */
|
||||
if (*anode == TYPE_MAIN_VARIANT (*anode))
|
||||
{
|
||||
tree variant;
|
||||
for (variant = *anode; variant;
|
||||
variant = TYPE_NEXT_VARIANT (variant))
|
||||
{
|
||||
if (TYPE_ATTRIBUTES (variant) == old_attrs)
|
||||
TYPE_ATTRIBUTES (variant)
|
||||
= TYPE_ATTRIBUTES (*anode);
|
||||
else if (!lookup_attribute
|
||||
(spec->name, TYPE_ATTRIBUTES (variant)))
|
||||
TYPE_ATTRIBUTES (variant) = tree_cons
|
||||
(name, args, TYPE_ATTRIBUTES (variant));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
*anode = build_type_attribute_variant (*anode,
|
||||
tree_cons (name, args,
|
||||
old_attrs));
|
||||
}
|
||||
}
|
||||
|
||||
if (fn_ptr_tmp)
|
||||
{
|
||||
/* APPLE LOCAL begin radar 6246527 */
|
||||
if (DECL_P (*node) && TREE_TYPE (*node) &&
|
||||
TREE_CODE (TREE_TYPE (*node)) == BLOCK_POINTER_TYPE)
|
||||
/* Rebuild the block pointer type and put it in the
|
||||
appropriate place. */
|
||||
fn_ptr_tmp = build_block_pointer_type (fn_ptr_tmp);
|
||||
else
|
||||
/* APPLE LOCAL end radar 6246527 */
|
||||
/* Rebuild the function pointer type and put it in the
|
||||
appropriate place. */
|
||||
fn_ptr_tmp = build_pointer_type (fn_ptr_tmp);
|
||||
if (DECL_P (*node))
|
||||
TREE_TYPE (*node) = fn_ptr_tmp;
|
||||
else
|
||||
{
|
||||
gcc_assert (TREE_CODE (*node) == POINTER_TYPE);
|
||||
*node = fn_ptr_tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returned_attrs;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1540
contrib/gcc/bitmap.c
1540
contrib/gcc/bitmap.c
File diff suppressed because it is too large
Load Diff
@ -1,568 +0,0 @@
|
||||
/* Functions to support general ended bitmaps.
|
||||
Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifndef GCC_BITMAP_H
|
||||
#define GCC_BITMAP_H
|
||||
#include "hashtab.h"
|
||||
|
||||
/* Fundamental storage type for bitmap. */
|
||||
|
||||
typedef unsigned long BITMAP_WORD;
|
||||
/* BITMAP_WORD_BITS needs to be unsigned, but cannot contain casts as
|
||||
it is used in preprocessor directives -- hence the 1u. */
|
||||
#define BITMAP_WORD_BITS (CHAR_BIT * SIZEOF_LONG * 1u)
|
||||
|
||||
/* Number of words to use for each element in the linked list. */
|
||||
|
||||
#ifndef BITMAP_ELEMENT_WORDS
|
||||
#define BITMAP_ELEMENT_WORDS ((128 + BITMAP_WORD_BITS - 1) / BITMAP_WORD_BITS)
|
||||
#endif
|
||||
|
||||
/* Number of bits in each actual element of a bitmap. */
|
||||
|
||||
#define BITMAP_ELEMENT_ALL_BITS (BITMAP_ELEMENT_WORDS * BITMAP_WORD_BITS)
|
||||
|
||||
/* Obstack for allocating bitmaps and elements from. */
|
||||
typedef struct bitmap_obstack GTY (())
|
||||
{
|
||||
struct bitmap_element_def *elements;
|
||||
struct bitmap_head_def *heads;
|
||||
struct obstack GTY ((skip)) obstack;
|
||||
} bitmap_obstack;
|
||||
|
||||
/* Bitmap set element. We use a linked list to hold only the bits that
|
||||
are set. This allows for use to grow the bitset dynamically without
|
||||
having to realloc and copy a giant bit array.
|
||||
|
||||
The free list is implemented as a list of lists. There is one
|
||||
outer list connected together by prev fields. Each element of that
|
||||
outer is an inner list (that may consist only of the outer list
|
||||
element) that are connected by the next fields. The prev pointer
|
||||
is undefined for interior elements. This allows
|
||||
bitmap_elt_clear_from to be implemented in unit time rather than
|
||||
linear in the number of elements to be freed. */
|
||||
|
||||
typedef struct bitmap_element_def GTY(())
|
||||
{
|
||||
struct bitmap_element_def *next; /* Next element. */
|
||||
struct bitmap_element_def *prev; /* Previous element. */
|
||||
unsigned int indx; /* regno/BITMAP_ELEMENT_ALL_BITS. */
|
||||
BITMAP_WORD bits[BITMAP_ELEMENT_WORDS]; /* Bits that are set. */
|
||||
} bitmap_element;
|
||||
|
||||
/* Head of bitmap linked list. */
|
||||
typedef struct bitmap_head_def GTY(()) {
|
||||
bitmap_element *first; /* First element in linked list. */
|
||||
bitmap_element *current; /* Last element looked at. */
|
||||
unsigned int indx; /* Index of last element looked at. */
|
||||
bitmap_obstack *obstack; /* Obstack to allocate elements from.
|
||||
If NULL, then use ggc_alloc. */
|
||||
} bitmap_head;
|
||||
|
||||
|
||||
/* Global data */
|
||||
extern bitmap_element bitmap_zero_bits; /* Zero bitmap element */
|
||||
extern bitmap_obstack bitmap_default_obstack; /* Default bitmap obstack */
|
||||
|
||||
/* Clear a bitmap by freeing up the linked list. */
|
||||
extern void bitmap_clear (bitmap);
|
||||
|
||||
/* Copy a bitmap to another bitmap. */
|
||||
extern void bitmap_copy (bitmap, bitmap);
|
||||
|
||||
/* True if two bitmaps are identical. */
|
||||
extern bool bitmap_equal_p (bitmap, bitmap);
|
||||
|
||||
/* True if the bitmaps intersect (their AND is non-empty). */
|
||||
extern bool bitmap_intersect_p (bitmap, bitmap);
|
||||
|
||||
/* True if the complement of the second intersects the first (their
|
||||
AND_COMPL is non-empty). */
|
||||
extern bool bitmap_intersect_compl_p (bitmap, bitmap);
|
||||
|
||||
/* True if MAP is an empty bitmap. */
|
||||
#define bitmap_empty_p(MAP) (!(MAP)->first)
|
||||
|
||||
/* Count the number of bits set in the bitmap. */
|
||||
extern unsigned long bitmap_count_bits (bitmap);
|
||||
|
||||
/* Boolean operations on bitmaps. The _into variants are two operand
|
||||
versions that modify the first source operand. The other variants
|
||||
are three operand versions that to not destroy the source bitmaps.
|
||||
The operations supported are &, & ~, |, ^. */
|
||||
extern void bitmap_and (bitmap, bitmap, bitmap);
|
||||
extern void bitmap_and_into (bitmap, bitmap);
|
||||
extern void bitmap_and_compl (bitmap, bitmap, bitmap);
|
||||
extern bool bitmap_and_compl_into (bitmap, bitmap);
|
||||
#define bitmap_compl_and(DST, A, B) bitmap_and_compl (DST, B, A)
|
||||
extern void bitmap_compl_and_into (bitmap, bitmap);
|
||||
extern void bitmap_clear_range (bitmap, unsigned int, unsigned int);
|
||||
extern bool bitmap_ior (bitmap, bitmap, bitmap);
|
||||
extern bool bitmap_ior_into (bitmap, bitmap);
|
||||
extern void bitmap_xor (bitmap, bitmap, bitmap);
|
||||
extern void bitmap_xor_into (bitmap, bitmap);
|
||||
|
||||
/* DST = A | (B & ~C). Return true if DST changes. */
|
||||
extern bool bitmap_ior_and_compl (bitmap DST, bitmap A, bitmap B, bitmap C);
|
||||
/* A |= (B & ~C). Return true if A changes. */
|
||||
extern bool bitmap_ior_and_compl_into (bitmap DST, bitmap B, bitmap C);
|
||||
|
||||
/* Clear a single register in a register set. */
|
||||
extern void bitmap_clear_bit (bitmap, int);
|
||||
|
||||
/* Set a single register in a register set. */
|
||||
extern void bitmap_set_bit (bitmap, int);
|
||||
|
||||
/* Return true if a register is set in a register set. */
|
||||
extern int bitmap_bit_p (bitmap, int);
|
||||
|
||||
/* Debug functions to print a bitmap linked list. */
|
||||
extern void debug_bitmap (bitmap);
|
||||
extern void debug_bitmap_file (FILE *, bitmap);
|
||||
|
||||
/* Print a bitmap. */
|
||||
extern void bitmap_print (FILE *, bitmap, const char *, const char *);
|
||||
|
||||
/* Initialize and release a bitmap obstack. */
|
||||
extern void bitmap_obstack_initialize (bitmap_obstack *);
|
||||
extern void bitmap_obstack_release (bitmap_obstack *);
|
||||
|
||||
/* Initialize a bitmap header. OBSTACK indicates the bitmap obstack
|
||||
to allocate from, NULL for GC'd bitmap. */
|
||||
|
||||
static inline void
|
||||
bitmap_initialize (bitmap head, bitmap_obstack *obstack)
|
||||
{
|
||||
head->first = head->current = NULL;
|
||||
head->obstack = obstack;
|
||||
}
|
||||
|
||||
/* Allocate and free bitmaps from obstack, malloc and gc'd memory. */
|
||||
extern bitmap bitmap_obstack_alloc (bitmap_obstack *obstack);
|
||||
extern bitmap bitmap_gc_alloc (void);
|
||||
extern void bitmap_obstack_free (bitmap);
|
||||
|
||||
/* A few compatibility/functions macros for compatibility with sbitmaps */
|
||||
#define dump_bitmap(file, bitmap) bitmap_print (file, bitmap, "", "\n")
|
||||
#define bitmap_zero(a) bitmap_clear (a)
|
||||
extern unsigned bitmap_first_set_bit (bitmap);
|
||||
|
||||
/* Compute bitmap hash (for purposes of hashing etc.) */
|
||||
extern hashval_t bitmap_hash(bitmap);
|
||||
|
||||
/* Allocate a bitmap from a bit obstack. */
|
||||
#define BITMAP_ALLOC(OBSTACK) bitmap_obstack_alloc (OBSTACK)
|
||||
|
||||
/* Allocate a gc'd bitmap. */
|
||||
#define BITMAP_GGC_ALLOC() bitmap_gc_alloc ()
|
||||
|
||||
/* Do any cleanup needed on a bitmap when it is no longer used. */
|
||||
#define BITMAP_FREE(BITMAP) \
|
||||
((void)(bitmap_obstack_free (BITMAP), (BITMAP) = NULL))
|
||||
|
||||
/* Iterator for bitmaps. */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* Pointer to the current bitmap element. */
|
||||
bitmap_element *elt1;
|
||||
|
||||
/* Pointer to 2nd bitmap element when two are involved. */
|
||||
bitmap_element *elt2;
|
||||
|
||||
/* Word within the current element. */
|
||||
unsigned word_no;
|
||||
|
||||
/* Contents of the actually processed word. When finding next bit
|
||||
it is shifted right, so that the actual bit is always the least
|
||||
significant bit of ACTUAL. */
|
||||
BITMAP_WORD bits;
|
||||
} bitmap_iterator;
|
||||
|
||||
/* Initialize a single bitmap iterator. START_BIT is the first bit to
|
||||
iterate from. */
|
||||
|
||||
static inline void
|
||||
bmp_iter_set_init (bitmap_iterator *bi, bitmap map,
|
||||
unsigned start_bit, unsigned *bit_no)
|
||||
{
|
||||
bi->elt1 = map->first;
|
||||
bi->elt2 = NULL;
|
||||
|
||||
/* Advance elt1 until it is not before the block containing start_bit. */
|
||||
while (1)
|
||||
{
|
||||
if (!bi->elt1)
|
||||
{
|
||||
bi->elt1 = &bitmap_zero_bits;
|
||||
break;
|
||||
}
|
||||
|
||||
if (bi->elt1->indx >= start_bit / BITMAP_ELEMENT_ALL_BITS)
|
||||
break;
|
||||
bi->elt1 = bi->elt1->next;
|
||||
}
|
||||
|
||||
/* We might have gone past the start bit, so reinitialize it. */
|
||||
if (bi->elt1->indx != start_bit / BITMAP_ELEMENT_ALL_BITS)
|
||||
start_bit = bi->elt1->indx * BITMAP_ELEMENT_ALL_BITS;
|
||||
|
||||
/* Initialize for what is now start_bit. */
|
||||
bi->word_no = start_bit / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS;
|
||||
bi->bits = bi->elt1->bits[bi->word_no];
|
||||
bi->bits >>= start_bit % BITMAP_WORD_BITS;
|
||||
|
||||
/* If this word is zero, we must make sure we're not pointing at the
|
||||
first bit, otherwise our incrementing to the next word boundary
|
||||
will fail. It won't matter if this increment moves us into the
|
||||
next word. */
|
||||
start_bit += !bi->bits;
|
||||
|
||||
*bit_no = start_bit;
|
||||
}
|
||||
|
||||
/* Initialize an iterator to iterate over the intersection of two
|
||||
bitmaps. START_BIT is the bit to commence from. */
|
||||
|
||||
static inline void
|
||||
bmp_iter_and_init (bitmap_iterator *bi, bitmap map1, bitmap map2,
|
||||
unsigned start_bit, unsigned *bit_no)
|
||||
{
|
||||
bi->elt1 = map1->first;
|
||||
bi->elt2 = map2->first;
|
||||
|
||||
/* Advance elt1 until it is not before the block containing
|
||||
start_bit. */
|
||||
while (1)
|
||||
{
|
||||
if (!bi->elt1)
|
||||
{
|
||||
bi->elt2 = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
if (bi->elt1->indx >= start_bit / BITMAP_ELEMENT_ALL_BITS)
|
||||
break;
|
||||
bi->elt1 = bi->elt1->next;
|
||||
}
|
||||
|
||||
/* Advance elt2 until it is not before elt1. */
|
||||
while (1)
|
||||
{
|
||||
if (!bi->elt2)
|
||||
{
|
||||
bi->elt1 = bi->elt2 = &bitmap_zero_bits;
|
||||
break;
|
||||
}
|
||||
|
||||
if (bi->elt2->indx >= bi->elt1->indx)
|
||||
break;
|
||||
bi->elt2 = bi->elt2->next;
|
||||
}
|
||||
|
||||
/* If we're at the same index, then we have some intersecting bits. */
|
||||
if (bi->elt1->indx == bi->elt2->indx)
|
||||
{
|
||||
/* We might have advanced beyond the start_bit, so reinitialize
|
||||
for that. */
|
||||
if (bi->elt1->indx != start_bit / BITMAP_ELEMENT_ALL_BITS)
|
||||
start_bit = bi->elt1->indx * BITMAP_ELEMENT_ALL_BITS;
|
||||
|
||||
bi->word_no = start_bit / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS;
|
||||
bi->bits = bi->elt1->bits[bi->word_no] & bi->elt2->bits[bi->word_no];
|
||||
bi->bits >>= start_bit % BITMAP_WORD_BITS;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Otherwise we must immediately advance elt1, so initialize for
|
||||
that. */
|
||||
bi->word_no = BITMAP_ELEMENT_WORDS - 1;
|
||||
bi->bits = 0;
|
||||
}
|
||||
|
||||
/* If this word is zero, we must make sure we're not pointing at the
|
||||
first bit, otherwise our incrementing to the next word boundary
|
||||
will fail. It won't matter if this increment moves us into the
|
||||
next word. */
|
||||
start_bit += !bi->bits;
|
||||
|
||||
*bit_no = start_bit;
|
||||
}
|
||||
|
||||
/* Initialize an iterator to iterate over the bits in MAP1 & ~MAP2.
|
||||
*/
|
||||
|
||||
static inline void
|
||||
bmp_iter_and_compl_init (bitmap_iterator *bi, bitmap map1, bitmap map2,
|
||||
unsigned start_bit, unsigned *bit_no)
|
||||
{
|
||||
bi->elt1 = map1->first;
|
||||
bi->elt2 = map2->first;
|
||||
|
||||
/* Advance elt1 until it is not before the block containing start_bit. */
|
||||
while (1)
|
||||
{
|
||||
if (!bi->elt1)
|
||||
{
|
||||
bi->elt1 = &bitmap_zero_bits;
|
||||
break;
|
||||
}
|
||||
|
||||
if (bi->elt1->indx >= start_bit / BITMAP_ELEMENT_ALL_BITS)
|
||||
break;
|
||||
bi->elt1 = bi->elt1->next;
|
||||
}
|
||||
|
||||
/* Advance elt2 until it is not before elt1. */
|
||||
while (bi->elt2 && bi->elt2->indx < bi->elt1->indx)
|
||||
bi->elt2 = bi->elt2->next;
|
||||
|
||||
/* We might have advanced beyond the start_bit, so reinitialize for
|
||||
that. */
|
||||
if (bi->elt1->indx != start_bit / BITMAP_ELEMENT_ALL_BITS)
|
||||
start_bit = bi->elt1->indx * BITMAP_ELEMENT_ALL_BITS;
|
||||
|
||||
bi->word_no = start_bit / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS;
|
||||
bi->bits = bi->elt1->bits[bi->word_no];
|
||||
if (bi->elt2 && bi->elt1->indx == bi->elt2->indx)
|
||||
bi->bits &= ~bi->elt2->bits[bi->word_no];
|
||||
bi->bits >>= start_bit % BITMAP_WORD_BITS;
|
||||
|
||||
/* If this word is zero, we must make sure we're not pointing at the
|
||||
first bit, otherwise our incrementing to the next word boundary
|
||||
will fail. It won't matter if this increment moves us into the
|
||||
next word. */
|
||||
start_bit += !bi->bits;
|
||||
|
||||
*bit_no = start_bit;
|
||||
}
|
||||
|
||||
/* Advance to the next bit in BI. We don't advance to the next
|
||||
nonzero bit yet. */
|
||||
|
||||
static inline void
|
||||
bmp_iter_next (bitmap_iterator *bi, unsigned *bit_no)
|
||||
{
|
||||
bi->bits >>= 1;
|
||||
*bit_no += 1;
|
||||
}
|
||||
|
||||
/* Advance to the next nonzero bit of a single bitmap, we will have
|
||||
already advanced past the just iterated bit. Return true if there
|
||||
is a bit to iterate. */
|
||||
|
||||
static inline bool
|
||||
bmp_iter_set (bitmap_iterator *bi, unsigned *bit_no)
|
||||
{
|
||||
/* If our current word is nonzero, it contains the bit we want. */
|
||||
if (bi->bits)
|
||||
{
|
||||
next_bit:
|
||||
while (!(bi->bits & 1))
|
||||
{
|
||||
bi->bits >>= 1;
|
||||
*bit_no += 1;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Round up to the word boundary. We might have just iterated past
|
||||
the end of the last word, hence the -1. It is not possible for
|
||||
bit_no to point at the beginning of the now last word. */
|
||||
*bit_no = ((*bit_no + BITMAP_WORD_BITS - 1)
|
||||
/ BITMAP_WORD_BITS * BITMAP_WORD_BITS);
|
||||
bi->word_no++;
|
||||
|
||||
while (1)
|
||||
{
|
||||
/* Find the next nonzero word in this elt. */
|
||||
while (bi->word_no != BITMAP_ELEMENT_WORDS)
|
||||
{
|
||||
bi->bits = bi->elt1->bits[bi->word_no];
|
||||
if (bi->bits)
|
||||
goto next_bit;
|
||||
*bit_no += BITMAP_WORD_BITS;
|
||||
bi->word_no++;
|
||||
}
|
||||
|
||||
/* Advance to the next element. */
|
||||
bi->elt1 = bi->elt1->next;
|
||||
if (!bi->elt1)
|
||||
return false;
|
||||
*bit_no = bi->elt1->indx * BITMAP_ELEMENT_ALL_BITS;
|
||||
bi->word_no = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Advance to the next nonzero bit of an intersecting pair of
|
||||
bitmaps. We will have already advanced past the just iterated bit.
|
||||
Return true if there is a bit to iterate. */
|
||||
|
||||
static inline bool
|
||||
bmp_iter_and (bitmap_iterator *bi, unsigned *bit_no)
|
||||
{
|
||||
/* If our current word is nonzero, it contains the bit we want. */
|
||||
if (bi->bits)
|
||||
{
|
||||
next_bit:
|
||||
while (!(bi->bits & 1))
|
||||
{
|
||||
bi->bits >>= 1;
|
||||
*bit_no += 1;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Round up to the word boundary. We might have just iterated past
|
||||
the end of the last word, hence the -1. It is not possible for
|
||||
bit_no to point at the beginning of the now last word. */
|
||||
*bit_no = ((*bit_no + BITMAP_WORD_BITS - 1)
|
||||
/ BITMAP_WORD_BITS * BITMAP_WORD_BITS);
|
||||
bi->word_no++;
|
||||
|
||||
while (1)
|
||||
{
|
||||
/* Find the next nonzero word in this elt. */
|
||||
while (bi->word_no != BITMAP_ELEMENT_WORDS)
|
||||
{
|
||||
bi->bits = bi->elt1->bits[bi->word_no] & bi->elt2->bits[bi->word_no];
|
||||
if (bi->bits)
|
||||
goto next_bit;
|
||||
*bit_no += BITMAP_WORD_BITS;
|
||||
bi->word_no++;
|
||||
}
|
||||
|
||||
/* Advance to the next identical element. */
|
||||
do
|
||||
{
|
||||
/* Advance elt1 while it is less than elt2. We always want
|
||||
to advance one elt. */
|
||||
do
|
||||
{
|
||||
bi->elt1 = bi->elt1->next;
|
||||
if (!bi->elt1)
|
||||
return false;
|
||||
}
|
||||
while (bi->elt1->indx < bi->elt2->indx);
|
||||
|
||||
/* Advance elt2 to be no less than elt1. This might not
|
||||
advance. */
|
||||
while (bi->elt2->indx < bi->elt1->indx)
|
||||
{
|
||||
bi->elt2 = bi->elt2->next;
|
||||
if (!bi->elt2)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
while (bi->elt1->indx != bi->elt2->indx);
|
||||
|
||||
*bit_no = bi->elt1->indx * BITMAP_ELEMENT_ALL_BITS;
|
||||
bi->word_no = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Advance to the next nonzero bit in the intersection of
|
||||
complemented bitmaps. We will have already advanced past the just
|
||||
iterated bit. */
|
||||
|
||||
static inline bool
|
||||
bmp_iter_and_compl (bitmap_iterator *bi, unsigned *bit_no)
|
||||
{
|
||||
/* If our current word is nonzero, it contains the bit we want. */
|
||||
if (bi->bits)
|
||||
{
|
||||
next_bit:
|
||||
while (!(bi->bits & 1))
|
||||
{
|
||||
bi->bits >>= 1;
|
||||
*bit_no += 1;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Round up to the word boundary. We might have just iterated past
|
||||
the end of the last word, hence the -1. It is not possible for
|
||||
bit_no to point at the beginning of the now last word. */
|
||||
*bit_no = ((*bit_no + BITMAP_WORD_BITS - 1)
|
||||
/ BITMAP_WORD_BITS * BITMAP_WORD_BITS);
|
||||
bi->word_no++;
|
||||
|
||||
while (1)
|
||||
{
|
||||
/* Find the next nonzero word in this elt. */
|
||||
while (bi->word_no != BITMAP_ELEMENT_WORDS)
|
||||
{
|
||||
bi->bits = bi->elt1->bits[bi->word_no];
|
||||
if (bi->elt2 && bi->elt2->indx == bi->elt1->indx)
|
||||
bi->bits &= ~bi->elt2->bits[bi->word_no];
|
||||
if (bi->bits)
|
||||
goto next_bit;
|
||||
*bit_no += BITMAP_WORD_BITS;
|
||||
bi->word_no++;
|
||||
}
|
||||
|
||||
/* Advance to the next element of elt1. */
|
||||
bi->elt1 = bi->elt1->next;
|
||||
if (!bi->elt1)
|
||||
return false;
|
||||
|
||||
/* Advance elt2 until it is no less than elt1. */
|
||||
while (bi->elt2 && bi->elt2->indx < bi->elt1->indx)
|
||||
bi->elt2 = bi->elt2->next;
|
||||
|
||||
*bit_no = bi->elt1->indx * BITMAP_ELEMENT_ALL_BITS;
|
||||
bi->word_no = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Loop over all bits set in BITMAP, starting with MIN and setting
|
||||
BITNUM to the bit number. ITER is a bitmap iterator. BITNUM
|
||||
should be treated as a read-only variable as it contains loop
|
||||
state. */
|
||||
|
||||
#define EXECUTE_IF_SET_IN_BITMAP(BITMAP, MIN, BITNUM, ITER) \
|
||||
for (bmp_iter_set_init (&(ITER), (BITMAP), (MIN), &(BITNUM)); \
|
||||
bmp_iter_set (&(ITER), &(BITNUM)); \
|
||||
bmp_iter_next (&(ITER), &(BITNUM)))
|
||||
|
||||
/* Loop over all the bits set in BITMAP1 & BITMAP2, starting with MIN
|
||||
and setting BITNUM to the bit number. ITER is a bitmap iterator.
|
||||
BITNUM should be treated as a read-only variable as it contains
|
||||
loop state. */
|
||||
|
||||
#define EXECUTE_IF_AND_IN_BITMAP(BITMAP1, BITMAP2, MIN, BITNUM, ITER) \
|
||||
for (bmp_iter_and_init (&(ITER), (BITMAP1), (BITMAP2), (MIN), \
|
||||
&(BITNUM)); \
|
||||
bmp_iter_and (&(ITER), &(BITNUM)); \
|
||||
bmp_iter_next (&(ITER), &(BITNUM)))
|
||||
|
||||
/* Loop over all the bits set in BITMAP1 & ~BITMAP2, starting with MIN
|
||||
and setting BITNUM to the bit number. ITER is a bitmap iterator.
|
||||
BITNUM should be treated as a read-only variable as it contains
|
||||
loop state. */
|
||||
|
||||
#define EXECUTE_IF_AND_COMPL_IN_BITMAP(BITMAP1, BITMAP2, MIN, BITNUM, ITER) \
|
||||
for (bmp_iter_and_compl_init (&(ITER), (BITMAP1), (BITMAP2), (MIN), \
|
||||
&(BITNUM)); \
|
||||
bmp_iter_and_compl (&(ITER), &(BITNUM)); \
|
||||
bmp_iter_next (&(ITER), &(BITNUM)))
|
||||
|
||||
#endif /* GCC_BITMAP_H */
|
File diff suppressed because it is too large
Load Diff
@ -1,183 +0,0 @@
|
||||
/* Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
|
||||
Contributed by Joseph Myers <jsm28@cam.ac.uk>.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
/* This header provides a declarative way of describing the attributes
|
||||
that are applied to some functions by default.
|
||||
|
||||
Before including this header, you must define the following macros.
|
||||
In each case where there is an ENUM, it is an identifier used to
|
||||
reference the tree in subsequent definitions.
|
||||
|
||||
DEF_ATTR_NULL_TREE (ENUM)
|
||||
|
||||
Constructs a NULL_TREE.
|
||||
|
||||
DEF_ATTR_INT (ENUM, VALUE)
|
||||
|
||||
Constructs an INTEGER_CST with value VALUE (an integer representable
|
||||
in HOST_WIDE_INT).
|
||||
|
||||
DEF_ATTR_IDENT (ENUM, STRING)
|
||||
|
||||
Constructs an IDENTIFIER_NODE for STRING.
|
||||
|
||||
DEF_ATTR_TREE_LIST (ENUM, PURPOSE, VALUE, CHAIN)
|
||||
|
||||
Constructs a TREE_LIST with given PURPOSE, VALUE and CHAIN (given
|
||||
as previous ENUM names). */
|
||||
|
||||
DEF_ATTR_NULL_TREE (ATTR_NULL)
|
||||
|
||||
/* Construct a tree for a given integer and a list containing it. */
|
||||
#define DEF_ATTR_FOR_INT(VALUE) \
|
||||
DEF_ATTR_INT (ATTR_##VALUE, VALUE) \
|
||||
DEF_ATTR_TREE_LIST (ATTR_LIST_##VALUE, ATTR_NULL, \
|
||||
ATTR_##VALUE, ATTR_NULL)
|
||||
DEF_ATTR_FOR_INT (0)
|
||||
DEF_ATTR_FOR_INT (1)
|
||||
DEF_ATTR_FOR_INT (2)
|
||||
DEF_ATTR_FOR_INT (3)
|
||||
DEF_ATTR_FOR_INT (4)
|
||||
DEF_ATTR_FOR_INT (5)
|
||||
DEF_ATTR_FOR_INT (6)
|
||||
#undef DEF_ATTR_FOR_INT
|
||||
|
||||
/* Construct a tree for a list of two integers. */
|
||||
#define DEF_LIST_INT_INT(VALUE1, VALUE2) \
|
||||
DEF_ATTR_TREE_LIST (ATTR_LIST_##VALUE1##_##VALUE2, ATTR_NULL, \
|
||||
ATTR_##VALUE1, ATTR_LIST_##VALUE2)
|
||||
DEF_LIST_INT_INT (1,0)
|
||||
DEF_LIST_INT_INT (1,2)
|
||||
DEF_LIST_INT_INT (2,0)
|
||||
DEF_LIST_INT_INT (2,3)
|
||||
DEF_LIST_INT_INT (3,0)
|
||||
DEF_LIST_INT_INT (3,4)
|
||||
DEF_LIST_INT_INT (4,0)
|
||||
DEF_LIST_INT_INT (4,5)
|
||||
DEF_LIST_INT_INT (5,0)
|
||||
DEF_LIST_INT_INT (5,6)
|
||||
#undef DEF_LIST_INT_INT
|
||||
|
||||
/* Construct trees for identifiers. */
|
||||
DEF_ATTR_IDENT (ATTR_CONST, "const")
|
||||
DEF_ATTR_IDENT (ATTR_FORMAT, "format")
|
||||
DEF_ATTR_IDENT (ATTR_FORMAT_ARG, "format_arg")
|
||||
DEF_ATTR_IDENT (ATTR_MALLOC, "malloc")
|
||||
DEF_ATTR_IDENT (ATTR_NONNULL, "nonnull")
|
||||
DEF_ATTR_IDENT (ATTR_NORETURN, "noreturn")
|
||||
DEF_ATTR_IDENT (ATTR_NOTHROW, "nothrow")
|
||||
DEF_ATTR_IDENT (ATTR_PRINTF, "printf")
|
||||
DEF_ATTR_IDENT (ATTR_ASM_FPRINTF, "asm_fprintf")
|
||||
DEF_ATTR_IDENT (ATTR_GCC_DIAG, "gcc_diag")
|
||||
DEF_ATTR_IDENT (ATTR_GCC_CDIAG, "gcc_cdiag")
|
||||
DEF_ATTR_IDENT (ATTR_GCC_CXXDIAG, "gcc_cxxdiag")
|
||||
DEF_ATTR_IDENT (ATTR_PURE, "pure")
|
||||
DEF_ATTR_IDENT (ATTR_NOVOPS, "no vops")
|
||||
DEF_ATTR_IDENT (ATTR_SCANF, "scanf")
|
||||
DEF_ATTR_IDENT (ATTR_SENTINEL, "sentinel")
|
||||
DEF_ATTR_IDENT (ATTR_STRFMON, "strfmon")
|
||||
DEF_ATTR_IDENT (ATTR_STRFTIME, "strftime")
|
||||
|
||||
DEF_ATTR_TREE_LIST (ATTR_NOVOPS_LIST, ATTR_NOVOPS, ATTR_NULL, ATTR_NULL)
|
||||
|
||||
DEF_ATTR_TREE_LIST (ATTR_NOTHROW_LIST, ATTR_NOTHROW, ATTR_NULL, ATTR_NULL)
|
||||
|
||||
DEF_ATTR_TREE_LIST (ATTR_CONST_NOTHROW_LIST, ATTR_CONST, \
|
||||
ATTR_NULL, ATTR_NOTHROW_LIST)
|
||||
DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_LIST, ATTR_PURE, \
|
||||
ATTR_NULL, ATTR_NOTHROW_LIST)
|
||||
DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_NOVOPS_LIST, ATTR_NOVOPS, \
|
||||
ATTR_NULL, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_ATTR_TREE_LIST (ATTR_NORETURN_NOTHROW_LIST, ATTR_NORETURN, \
|
||||
ATTR_NULL, ATTR_NOTHROW_LIST)
|
||||
DEF_ATTR_TREE_LIST (ATTR_MALLOC_NOTHROW_LIST, ATTR_MALLOC, \
|
||||
ATTR_NULL, ATTR_NOTHROW_LIST)
|
||||
DEF_ATTR_TREE_LIST (ATTR_SENTINEL_NOTHROW_LIST, ATTR_SENTINEL, \
|
||||
ATTR_NULL, ATTR_NOTHROW_LIST)
|
||||
|
||||
/* Functions whose pointer parameter(s) are all nonnull. */
|
||||
DEF_ATTR_TREE_LIST (ATTR_NONNULL_LIST, ATTR_NONNULL, ATTR_NULL, ATTR_NULL)
|
||||
/* Functions whose first parameter is a nonnull pointer. */
|
||||
DEF_ATTR_TREE_LIST (ATTR_NONNULL_1, ATTR_NONNULL, ATTR_LIST_1, ATTR_NULL)
|
||||
/* Functions whose second parameter is a nonnull pointer. */
|
||||
DEF_ATTR_TREE_LIST (ATTR_NONNULL_2, ATTR_NONNULL, ATTR_LIST_2, ATTR_NULL)
|
||||
/* Nothrow functions with the sentinel(1) attribute. */
|
||||
DEF_ATTR_TREE_LIST (ATTR_NOTHROW_SENTINEL_1, ATTR_SENTINEL, ATTR_LIST_1, \
|
||||
ATTR_NOTHROW_LIST)
|
||||
/* Nothrow functions whose pointer parameter(s) are all nonnull. */
|
||||
DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL, ATTR_NONNULL, ATTR_NULL, \
|
||||
ATTR_NOTHROW_LIST)
|
||||
/* Nothrow functions whose first parameter is a nonnull pointer. */
|
||||
DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_1, ATTR_NONNULL, ATTR_LIST_1, \
|
||||
ATTR_NOTHROW_LIST)
|
||||
/* Nothrow functions whose second parameter is a nonnull pointer. */
|
||||
DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_2, ATTR_NONNULL, ATTR_LIST_2, \
|
||||
ATTR_NOTHROW_LIST)
|
||||
/* Nothrow functions whose third parameter is a nonnull pointer. */
|
||||
DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_3, ATTR_NONNULL, ATTR_LIST_3, \
|
||||
ATTR_NOTHROW_LIST)
|
||||
/* Nothrow functions whose fourth parameter is a nonnull pointer. */
|
||||
DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_4, ATTR_NONNULL, ATTR_LIST_4, \
|
||||
ATTR_NOTHROW_LIST)
|
||||
/* Nothrow functions whose fifth parameter is a nonnull pointer. */
|
||||
DEF_ATTR_TREE_LIST (ATTR_NOTHROW_NONNULL_5, ATTR_NONNULL, ATTR_LIST_5, \
|
||||
ATTR_NOTHROW_LIST)
|
||||
/* Nothrow const functions whose pointer parameter(s) are all nonnull. */
|
||||
DEF_ATTR_TREE_LIST (ATTR_CONST_NOTHROW_NONNULL, ATTR_CONST, ATTR_NULL, \
|
||||
ATTR_NOTHROW_NONNULL)
|
||||
/* Nothrow pure functions whose pointer parameter(s) are all nonnull. */
|
||||
DEF_ATTR_TREE_LIST (ATTR_PURE_NOTHROW_NONNULL, ATTR_PURE, ATTR_NULL, \
|
||||
ATTR_NOTHROW_NONNULL)
|
||||
/* Nothrow malloc functions whose pointer parameter(s) are all nonnull. */
|
||||
DEF_ATTR_TREE_LIST (ATTR_MALLOC_NOTHROW_NONNULL, ATTR_MALLOC, ATTR_NULL, \
|
||||
ATTR_NOTHROW_NONNULL)
|
||||
|
||||
/* Construct a tree for a format attribute. */
|
||||
#define DEF_FORMAT_ATTRIBUTE(TYPE, FA, VALUES) \
|
||||
DEF_ATTR_TREE_LIST (ATTR_##TYPE##_##VALUES, ATTR_NULL, \
|
||||
ATTR_##TYPE, ATTR_LIST_##VALUES) \
|
||||
DEF_ATTR_TREE_LIST (ATTR_FORMAT_##TYPE##_##VALUES, ATTR_FORMAT, \
|
||||
ATTR_##TYPE##_##VALUES, ATTR_NOTHROW_NONNULL_##FA)
|
||||
DEF_FORMAT_ATTRIBUTE(PRINTF,1,1_0)
|
||||
DEF_FORMAT_ATTRIBUTE(PRINTF,1,1_2)
|
||||
DEF_FORMAT_ATTRIBUTE(PRINTF,2,2_0)
|
||||
DEF_FORMAT_ATTRIBUTE(PRINTF,2,2_3)
|
||||
DEF_FORMAT_ATTRIBUTE(PRINTF,3,3_0)
|
||||
DEF_FORMAT_ATTRIBUTE(PRINTF,3,3_4)
|
||||
DEF_FORMAT_ATTRIBUTE(PRINTF,4,4_0)
|
||||
DEF_FORMAT_ATTRIBUTE(PRINTF,4,4_5)
|
||||
DEF_FORMAT_ATTRIBUTE(PRINTF,5,5_0)
|
||||
DEF_FORMAT_ATTRIBUTE(PRINTF,5,5_6)
|
||||
DEF_FORMAT_ATTRIBUTE(SCANF,1,1_0)
|
||||
DEF_FORMAT_ATTRIBUTE(SCANF,1,1_2)
|
||||
DEF_FORMAT_ATTRIBUTE(SCANF,2,2_0)
|
||||
DEF_FORMAT_ATTRIBUTE(SCANF,2,2_3)
|
||||
DEF_FORMAT_ATTRIBUTE(STRFTIME,3,3_0)
|
||||
DEF_FORMAT_ATTRIBUTE(STRFMON,3,3_4)
|
||||
#undef DEF_FORMAT_ATTRIBUTE
|
||||
|
||||
/* Construct a tree for a format_arg attribute. */
|
||||
#define DEF_FORMAT_ARG_ATTRIBUTE(FA) \
|
||||
DEF_ATTR_TREE_LIST (ATTR_FORMAT_ARG_##FA, ATTR_FORMAT_ARG, \
|
||||
ATTR_LIST_##FA, ATTR_NOTHROW_NONNULL_##FA)
|
||||
DEF_FORMAT_ARG_ATTRIBUTE(1)
|
||||
DEF_FORMAT_ARG_ATTRIBUTE(2)
|
||||
#undef DEF_FORMAT_ARG_ATTRIBUTE
|
||||
|
@ -1,443 +0,0 @@
|
||||
/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
/* This header provides a declarative way of describing the types that
|
||||
are used when declaring builtin functions.
|
||||
|
||||
Before including this header, you must define the following macros:
|
||||
|
||||
DEF_PRIMITIVE_TYPE (ENUM, TYPE)
|
||||
|
||||
The ENUM is an identifier indicating which type is being defined.
|
||||
TYPE is an expression for a `tree' that represents the type.
|
||||
|
||||
DEF_FUNCTION_TYPE_0 (ENUM, RETURN)
|
||||
DEF_FUNCTION_TYPE_1 (ENUM, RETURN, ARG1)
|
||||
DEF_FUNCTION_TYPE_2 (ENUM, RETURN, ARG1, ARG2)
|
||||
DEF_FUNCTION_TYPE_3 (ENUM, RETURN, ARG1, ARG2, ARG3)
|
||||
DEF_FUNCTION_TYPE_4 (ENUM, RETURN, ARG1, ARG2, ARG3, ARG4)
|
||||
DEF_FUNCTION_TYPE_5 (ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5)
|
||||
DEF_FUNCTION_TYPE_6 (ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6)
|
||||
DEF_FUNCTION_TYPE_7 (ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7)
|
||||
|
||||
These macros describe function types. ENUM is as above. The
|
||||
RETURN type is one of the enumerals already defined. ARG1, ARG2,
|
||||
and ARG3 give the types of the arguments, similarly.
|
||||
|
||||
DEF_FUNCTION_TYPE_VAR_0 (ENUM, RETURN)
|
||||
DEF_FUNCTION_TYPE_VAR_1 (ENUM, RETURN, ARG1)
|
||||
DEF_FUNCTION_TYPE_VAR_2 (ENUM, RETURN, ARG1, ARG2)
|
||||
DEF_FUNCTION_TYPE_VAR_3 (ENUM, RETURN, ARG1, ARG2, ARG3)
|
||||
DEF_FUNCTION_TYPE_VAR_4 (ENUM, RETURN, ARG1, ARG2, ARG3, ARG4)
|
||||
DEF_FUNCTION_TYPE_VAR_4 (ENUM, RETURN, ARG1, ARG2, ARG3, ARG4, ARG5)
|
||||
|
||||
Similar, but for function types that take variable arguments.
|
||||
For example:
|
||||
|
||||
DEF_FUNCTION_TYPE_1 (BT_INT_DOUBLE, BT_INT, BT_DOUBLE)
|
||||
|
||||
describes the type `int ()(double)', using the enumeral
|
||||
BT_INT_DOUBLE, whereas:
|
||||
|
||||
DEF_FUNCTION_TYPE_VAR_1 (BT_INT_DOUBLE_VAR, BT_INT, BT_DOUBLE)
|
||||
|
||||
describes the type `int ()(double, ...)'.
|
||||
|
||||
DEF_POINTER_TYPE (ENUM, TYPE)
|
||||
|
||||
This macro describes a pointer type. ENUM is as above; TYPE is
|
||||
the type pointed to. */
|
||||
|
||||
DEF_PRIMITIVE_TYPE (BT_VOID, void_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_BOOL, boolean_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_INT, integer_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_UINT, unsigned_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_LONG, long_integer_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_ULONG, long_unsigned_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_LONGLONG, long_long_integer_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_ULONGLONG, long_long_unsigned_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_INTMAX, intmax_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_UINTMAX, uintmax_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_UINT32, uint32_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_UINT64, uint64_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_WORD, (*lang_hooks.types.type_for_mode) (word_mode, 0))
|
||||
DEF_PRIMITIVE_TYPE (BT_FLOAT, float_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_DOUBLE, double_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_LONGDOUBLE, long_double_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_COMPLEX_FLOAT, complex_float_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_COMPLEX_DOUBLE, complex_double_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_COMPLEX_LONGDOUBLE, complex_long_double_type_node)
|
||||
|
||||
DEF_PRIMITIVE_TYPE (BT_PTR, ptr_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_FILEPTR, fileptr_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_CONST_PTR, const_ptr_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_VOLATILE_PTR,
|
||||
build_pointer_type
|
||||
(build_qualified_type (void_type_node,
|
||||
TYPE_QUAL_VOLATILE)))
|
||||
DEF_PRIMITIVE_TYPE (BT_PTRMODE, (*lang_hooks.types.type_for_mode)(ptr_mode, 0))
|
||||
DEF_PRIMITIVE_TYPE (BT_INT_PTR, integer_ptr_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_FLOAT_PTR, float_ptr_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_DOUBLE_PTR, double_ptr_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_LONGDOUBLE_PTR, long_double_ptr_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_PID, pid_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_SIZE, size_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_SSIZE, signed_size_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_WINT, wint_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_STRING, string_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_CONST_STRING, const_string_type_node)
|
||||
|
||||
DEF_PRIMITIVE_TYPE (BT_DFLOAT32, dfloat32_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_DFLOAT64, dfloat64_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_DFLOAT128, dfloat128_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_DFLOAT32_PTR, dfloat32_ptr_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_DFLOAT64_PTR, dfloat64_ptr_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_DFLOAT128_PTR, dfloat128_ptr_type_node)
|
||||
|
||||
DEF_PRIMITIVE_TYPE (BT_VALIST_REF, va_list_ref_type_node)
|
||||
DEF_PRIMITIVE_TYPE (BT_VALIST_ARG, va_list_arg_type_node)
|
||||
|
||||
DEF_PRIMITIVE_TYPE (BT_I1, builtin_type_for_size (BITS_PER_UNIT*1, 1))
|
||||
DEF_PRIMITIVE_TYPE (BT_I2, builtin_type_for_size (BITS_PER_UNIT*2, 1))
|
||||
DEF_PRIMITIVE_TYPE (BT_I4, builtin_type_for_size (BITS_PER_UNIT*4, 1))
|
||||
DEF_PRIMITIVE_TYPE (BT_I8, builtin_type_for_size (BITS_PER_UNIT*8, 1))
|
||||
DEF_PRIMITIVE_TYPE (BT_I16, builtin_type_for_size (BITS_PER_UNIT*16, 1))
|
||||
|
||||
DEF_POINTER_TYPE (BT_PTR_CONST_STRING, BT_CONST_STRING)
|
||||
DEF_POINTER_TYPE (BT_PTR_LONG, BT_LONG)
|
||||
DEF_POINTER_TYPE (BT_PTR_PTR, BT_PTR)
|
||||
|
||||
DEF_FUNCTION_TYPE_0 (BT_FN_VOID, BT_VOID)
|
||||
DEF_FUNCTION_TYPE_0 (BT_FN_BOOL, BT_BOOL)
|
||||
DEF_FUNCTION_TYPE_0 (BT_FN_PTR, BT_PTR)
|
||||
DEF_FUNCTION_TYPE_0 (BT_FN_PID, BT_PID)
|
||||
DEF_FUNCTION_TYPE_0 (BT_FN_INT, BT_INT)
|
||||
DEF_FUNCTION_TYPE_0 (BT_FN_UINT, BT_UINT)
|
||||
DEF_FUNCTION_TYPE_0 (BT_FN_FLOAT, BT_FLOAT)
|
||||
DEF_FUNCTION_TYPE_0 (BT_FN_DOUBLE, BT_DOUBLE)
|
||||
/* For "long double" we use LONGDOUBLE (not LONG_DOUBLE) to
|
||||
distinguish it from two types in sequence, "long" followed by
|
||||
"double". */
|
||||
DEF_FUNCTION_TYPE_0 (BT_FN_LONGDOUBLE, BT_LONGDOUBLE)
|
||||
DEF_FUNCTION_TYPE_0 (BT_FN_DFLOAT32, BT_DFLOAT32)
|
||||
DEF_FUNCTION_TYPE_0 (BT_FN_DFLOAT64, BT_DFLOAT64)
|
||||
DEF_FUNCTION_TYPE_0 (BT_FN_DFLOAT128, BT_DFLOAT128)
|
||||
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_LONG_LONG, BT_LONG, BT_LONG)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_LONGLONG_LONGLONG, BT_LONGLONG, BT_LONGLONG)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INTMAX_INTMAX, BT_INTMAX, BT_INTMAX)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_FLOAT_FLOAT, BT_FLOAT, BT_FLOAT)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_DOUBLE_DOUBLE, BT_DOUBLE, BT_DOUBLE)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_LONGDOUBLE_LONGDOUBLE,
|
||||
BT_LONGDOUBLE, BT_LONGDOUBLE)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT,
|
||||
BT_COMPLEX_FLOAT, BT_COMPLEX_FLOAT)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE,
|
||||
BT_COMPLEX_DOUBLE, BT_COMPLEX_DOUBLE)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE,
|
||||
BT_COMPLEX_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_FLOAT_COMPLEX_FLOAT,
|
||||
BT_FLOAT, BT_COMPLEX_FLOAT)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_DOUBLE_COMPLEX_DOUBLE,
|
||||
BT_DOUBLE, BT_COMPLEX_DOUBLE)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE,
|
||||
BT_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_PTR_UINT, BT_PTR, BT_UINT)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_PTR_SIZE, BT_PTR, BT_SIZE)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_INT, BT_INT, BT_INT)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_UINT, BT_INT, BT_UINT)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_LONG, BT_INT, BT_LONG)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_ULONG, BT_INT, BT_ULONG)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_LONGLONG, BT_INT, BT_LONGLONG)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_ULONGLONG, BT_INT, BT_ULONGLONG)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_INTMAX, BT_INT, BT_INTMAX)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_UINTMAX, BT_INT, BT_UINTMAX)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_PTR, BT_INT, BT_PTR)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_FLOAT, BT_INT, BT_FLOAT)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_DOUBLE, BT_INT, BT_DOUBLE)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_LONGDOUBLE, BT_INT, BT_LONGDOUBLE)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_DFLOAT32, BT_INT, BT_DFLOAT32)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_DFLOAT64, BT_INT, BT_DFLOAT64)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_DFLOAT128, BT_INT, BT_DFLOAT128)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_LONG_FLOAT, BT_LONG, BT_FLOAT)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_LONG_DOUBLE, BT_LONG, BT_DOUBLE)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_LONG_LONGDOUBLE, BT_LONG, BT_LONGDOUBLE)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_LONGLONG_FLOAT, BT_LONGLONG, BT_FLOAT)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_LONGLONG_DOUBLE, BT_LONGLONG, BT_DOUBLE)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_LONGLONG_LONGDOUBLE, BT_LONGLONG, BT_LONGDOUBLE)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_VOID_PTR, BT_VOID, BT_PTR)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_SIZE_CONST_STRING, BT_SIZE, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_CONST_STRING, BT_INT, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_PTR_PTR, BT_PTR, BT_PTR)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_VOID_VALIST_REF, BT_VOID, BT_VALIST_REF)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_VOID_INT, BT_VOID, BT_INT)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_FLOAT_CONST_STRING, BT_FLOAT, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_DOUBLE_CONST_STRING, BT_DOUBLE, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_LONGDOUBLE_CONST_STRING,
|
||||
BT_LONGDOUBLE, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT32_CONST_STRING, BT_DFLOAT32, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT64_CONST_STRING, BT_DFLOAT64, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT128_CONST_STRING,
|
||||
BT_DFLOAT128, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_STRING_CONST_STRING, BT_STRING, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_WORD_PTR, BT_WORD, BT_PTR)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_INT_WINT, BT_INT, BT_WINT)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_WINT_WINT, BT_WINT, BT_WINT)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT32_DFLOAT32, BT_DFLOAT32, BT_DFLOAT32)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT64_DFLOAT64, BT_DFLOAT64, BT_DFLOAT64)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_DFLOAT128_DFLOAT128, BT_DFLOAT128, BT_DFLOAT128)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_VOID_VPTR, BT_VOID, BT_VOLATILE_PTR)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_VOID_PTRPTR, BT_VOID, BT_PTR_PTR)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_UINT_UINT, BT_UINT, BT_UINT)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_ULONG_ULONG, BT_ULONG, BT_ULONG)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_ULONGLONG_ULONGLONG, BT_ULONGLONG, BT_ULONGLONG)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_UINT32_UINT32, BT_UINT32, BT_UINT32)
|
||||
DEF_FUNCTION_TYPE_1 (BT_FN_UINT64_UINT64, BT_UINT64, BT_UINT64)
|
||||
|
||||
DEF_POINTER_TYPE (BT_PTR_FN_VOID_PTR, BT_FN_VOID_PTR)
|
||||
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTR_INT, BT_VOID, BT_PTR, BT_INT)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_STRING_STRING_CONST_STRING,
|
||||
BT_STRING, BT_STRING, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_INT_CONST_STRING_CONST_STRING,
|
||||
BT_INT, BT_CONST_STRING, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_STRING_CONST_STRING_CONST_STRING,
|
||||
BT_STRING, BT_CONST_STRING, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_SIZE_CONST_STRING_CONST_STRING,
|
||||
BT_SIZE, BT_CONST_STRING, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_STRING_CONST_STRING_INT,
|
||||
BT_STRING, BT_CONST_STRING, BT_INT)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_STRING_CONST_STRING_SIZE,
|
||||
BT_STRING, BT_CONST_STRING, BT_SIZE)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_INT_CONST_STRING_FILEPTR,
|
||||
BT_INT, BT_CONST_STRING, BT_FILEPTR)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_INT_INT_FILEPTR,
|
||||
BT_INT, BT_INT, BT_FILEPTR)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTRMODE_PTR,
|
||||
BT_VOID, BT_PTRMODE, BT_PTR)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_VOID_VALIST_REF_VALIST_ARG,
|
||||
BT_VOID, BT_VALIST_REF, BT_VALIST_ARG)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_LONG_LONG_LONG,
|
||||
BT_LONG, BT_LONG, BT_LONG)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_INT_PTR_CONST_STRING,
|
||||
BT_INT, BT_PTR, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTR_SIZE,
|
||||
BT_VOID, BT_PTR, BT_SIZE)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_FLOAT_FLOAT_FLOAT,
|
||||
BT_FLOAT, BT_FLOAT, BT_FLOAT)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_DOUBLE_DOUBLE,
|
||||
BT_DOUBLE, BT_DOUBLE, BT_DOUBLE)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE,
|
||||
BT_LONGDOUBLE, BT_LONGDOUBLE, BT_LONGDOUBLE)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_FLOAT_FLOAT_FLOATPTR,
|
||||
BT_FLOAT, BT_FLOAT, BT_FLOAT_PTR)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_DOUBLE_DOUBLEPTR,
|
||||
BT_DOUBLE, BT_DOUBLE, BT_DOUBLE_PTR)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLEPTR,
|
||||
BT_LONGDOUBLE, BT_LONGDOUBLE, BT_LONGDOUBLE_PTR)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_FLOAT_FLOAT_LONGDOUBLE,
|
||||
BT_FLOAT, BT_FLOAT, BT_LONGDOUBLE)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_DOUBLE_LONGDOUBLE,
|
||||
BT_DOUBLE, BT_DOUBLE, BT_LONGDOUBLE)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_FLOAT_FLOAT_INT,
|
||||
BT_FLOAT, BT_FLOAT, BT_INT)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_DOUBLE_INT,
|
||||
BT_DOUBLE, BT_DOUBLE, BT_INT)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_LONGDOUBLE_LONGDOUBLE_INT,
|
||||
BT_LONGDOUBLE, BT_LONGDOUBLE, BT_INT)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_FLOAT_FLOAT_INTPTR,
|
||||
BT_FLOAT, BT_FLOAT, BT_INT_PTR)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_DOUBLE_INTPTR,
|
||||
BT_DOUBLE, BT_DOUBLE, BT_INT_PTR)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_LONGDOUBLE_LONGDOUBLE_INTPTR,
|
||||
BT_LONGDOUBLE, BT_LONGDOUBLE, BT_INT_PTR)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_FLOAT_INT_FLOAT,
|
||||
BT_FLOAT, BT_INT, BT_FLOAT)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_INT_DOUBLE,
|
||||
BT_DOUBLE, BT_INT, BT_DOUBLE)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_LONGDOUBLE_INT_LONGDOUBLE,
|
||||
BT_LONGDOUBLE, BT_INT, BT_LONGDOUBLE)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_FLOAT_FLOAT_LONG,
|
||||
BT_FLOAT, BT_FLOAT, BT_LONG)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_DOUBLE_DOUBLE_LONG,
|
||||
BT_DOUBLE, BT_DOUBLE, BT_LONG)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_LONGDOUBLE_LONGDOUBLE_LONG,
|
||||
BT_LONGDOUBLE, BT_LONGDOUBLE, BT_LONG)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_INT_CONST_STRING_VALIST_ARG,
|
||||
BT_INT, BT_CONST_STRING, BT_VALIST_ARG)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_PTR_SIZE_SIZE,
|
||||
BT_PTR, BT_SIZE, BT_SIZE)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT_COMPLEX_FLOAT,
|
||||
BT_COMPLEX_FLOAT, BT_COMPLEX_FLOAT, BT_COMPLEX_FLOAT)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE_COMPLEX_DOUBLE,
|
||||
BT_COMPLEX_DOUBLE, BT_COMPLEX_DOUBLE, BT_COMPLEX_DOUBLE)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE,
|
||||
BT_COMPLEX_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE, BT_COMPLEX_LONGDOUBLE)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_VOID_PTR_PTR, BT_VOID, BT_PTR, BT_PTR)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_INT_CONST_STRING_PTR_CONST_STRING,
|
||||
BT_INT, BT_CONST_STRING, BT_PTR_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_SIZE_CONST_PTR_INT, BT_SIZE, BT_CONST_PTR, BT_INT)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_I1_VPTR_I1, BT_I1, BT_VOLATILE_PTR, BT_I1)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_I2_VPTR_I2, BT_I2, BT_VOLATILE_PTR, BT_I2)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_I4_VPTR_I4, BT_I4, BT_VOLATILE_PTR, BT_I4)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_I8_VPTR_I8, BT_I8, BT_VOLATILE_PTR, BT_I8)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_I16_VPTR_I16, BT_I16, BT_VOLATILE_PTR, BT_I16)
|
||||
DEF_FUNCTION_TYPE_2 (BT_FN_BOOL_LONGPTR_LONGPTR,
|
||||
BT_BOOL, BT_PTR_LONG, BT_PTR_LONG)
|
||||
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_STRING_STRING_CONST_STRING_SIZE,
|
||||
BT_STRING, BT_STRING, BT_CONST_STRING, BT_SIZE)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_INT_CONST_STRING_CONST_STRING_SIZE,
|
||||
BT_INT, BT_CONST_STRING, BT_CONST_STRING, BT_SIZE)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_CONST_PTR_SIZE,
|
||||
BT_PTR, BT_PTR, BT_CONST_PTR, BT_SIZE)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_INT_CONST_PTR_CONST_PTR_SIZE,
|
||||
BT_INT, BT_CONST_PTR, BT_CONST_PTR, BT_SIZE)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_INT_SIZE,
|
||||
BT_PTR, BT_PTR, BT_INT, BT_SIZE)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_PTR_INT_INT,
|
||||
BT_VOID, BT_PTR, BT_INT, BT_INT)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_CONST_PTR_PTR_SIZE,
|
||||
BT_VOID, BT_CONST_PTR, BT_PTR, BT_SIZE)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_INT_STRING_CONST_STRING_VALIST_ARG,
|
||||
BT_INT, BT_STRING, BT_CONST_STRING, BT_VALIST_ARG)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG,
|
||||
BT_INT, BT_CONST_STRING, BT_CONST_STRING, BT_VALIST_ARG)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_INT_FILEPTR_CONST_STRING_VALIST_ARG,
|
||||
BT_INT, BT_FILEPTR, BT_CONST_STRING, BT_VALIST_ARG)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_STRING_CONST_STRING_CONST_STRING_INT,
|
||||
BT_STRING, BT_CONST_STRING, BT_CONST_STRING, BT_INT)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_FLOAT_FLOAT_FLOAT_FLOAT,
|
||||
BT_FLOAT, BT_FLOAT, BT_FLOAT, BT_FLOAT)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_DOUBLE_DOUBLE_DOUBLE_DOUBLE,
|
||||
BT_DOUBLE, BT_DOUBLE, BT_DOUBLE, BT_DOUBLE)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE,
|
||||
BT_LONGDOUBLE, BT_LONGDOUBLE, BT_LONGDOUBLE, BT_LONGDOUBLE)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_FLOAT_FLOAT_FLOAT_INTPTR,
|
||||
BT_FLOAT, BT_FLOAT, BT_FLOAT, BT_INT_PTR)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_DOUBLE_DOUBLE_DOUBLE_INTPTR,
|
||||
BT_DOUBLE, BT_DOUBLE, BT_DOUBLE, BT_INT_PTR)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_INTPTR,
|
||||
BT_LONGDOUBLE, BT_LONGDOUBLE, BT_LONGDOUBLE, BT_INT_PTR)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_FLOAT_FLOATPTR_FLOATPTR,
|
||||
BT_VOID, BT_FLOAT, BT_FLOAT_PTR, BT_FLOAT_PTR)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_DOUBLE_DOUBLEPTR_DOUBLEPTR,
|
||||
BT_VOID, BT_DOUBLE, BT_DOUBLE_PTR, BT_DOUBLE_PTR)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_LONGDOUBLE_LONGDOUBLEPTR_LONGDOUBLEPTR,
|
||||
BT_VOID, BT_LONGDOUBLE, BT_LONGDOUBLE_PTR, BT_LONGDOUBLE_PTR)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_PTR_PTR_PTR, BT_VOID, BT_PTR, BT_PTR, BT_PTR)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_INT_CONST_STRING_PTR_CONST_STRING_PTR_CONST_STRING,
|
||||
BT_INT, BT_CONST_STRING, BT_PTR_CONST_STRING, BT_PTR_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_INT_INT_CONST_STRING_VALIST_ARG,
|
||||
BT_INT, BT_INT, BT_CONST_STRING, BT_VALIST_ARG)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I1_I1, BT_BOOL, BT_VOLATILE_PTR,
|
||||
BT_I1, BT_I1)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I2_I2, BT_BOOL, BT_VOLATILE_PTR,
|
||||
BT_I2, BT_I2)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I4_I4, BT_BOOL, BT_VOLATILE_PTR,
|
||||
BT_I4, BT_I4)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I8_I8, BT_BOOL, BT_VOLATILE_PTR,
|
||||
BT_I8, BT_I8)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_BOOL_VPTR_I16_I16, BT_BOOL, BT_VOLATILE_PTR,
|
||||
BT_I16, BT_I16)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_I1_VPTR_I1_I1, BT_I1, BT_VOLATILE_PTR, BT_I1, BT_I1)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_I2_VPTR_I2_I2, BT_I2, BT_VOLATILE_PTR, BT_I2, BT_I2)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_I4_VPTR_I4_I4, BT_I4, BT_VOLATILE_PTR, BT_I4, BT_I4)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_I8_VPTR_I8_I8, BT_I8, BT_VOLATILE_PTR, BT_I8, BT_I8)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_I16_VPTR_I16_I16, BT_I16, BT_VOLATILE_PTR,
|
||||
BT_I16, BT_I16)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_VOID_OMPFN_PTR_UINT, BT_VOID, BT_PTR_FN_VOID_PTR,
|
||||
BT_PTR, BT_UINT)
|
||||
|
||||
DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_CONST_PTR_SIZE_SIZE_FILEPTR,
|
||||
BT_SIZE, BT_CONST_PTR, BT_SIZE, BT_SIZE, BT_FILEPTR)
|
||||
DEF_FUNCTION_TYPE_4 (BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG,
|
||||
BT_INT, BT_STRING, BT_SIZE, BT_CONST_STRING, BT_VALIST_ARG)
|
||||
DEF_FUNCTION_TYPE_4 (BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR,
|
||||
BT_SIZE, BT_STRING, BT_SIZE, BT_CONST_STRING, BT_CONST_PTR)
|
||||
DEF_FUNCTION_TYPE_4 (BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE,
|
||||
BT_PTR, BT_PTR, BT_CONST_PTR, BT_SIZE, BT_SIZE)
|
||||
DEF_FUNCTION_TYPE_4 (BT_FN_PTR_PTR_INT_SIZE_SIZE,
|
||||
BT_PTR, BT_PTR, BT_INT, BT_SIZE, BT_SIZE)
|
||||
DEF_FUNCTION_TYPE_4 (BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE,
|
||||
BT_STRING, BT_STRING, BT_CONST_STRING, BT_SIZE, BT_SIZE)
|
||||
DEF_FUNCTION_TYPE_4 (BT_FN_INT_FILEPTR_INT_CONST_STRING_VALIST_ARG,
|
||||
BT_INT, BT_FILEPTR, BT_INT, BT_CONST_STRING, BT_VALIST_ARG)
|
||||
DEF_FUNCTION_TYPE_4 (BT_FN_VOID_OMPFN_PTR_UINT_UINT,
|
||||
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT, BT_UINT)
|
||||
|
||||
DEF_FUNCTION_TYPE_5 (BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VALIST_ARG,
|
||||
BT_INT, BT_STRING, BT_INT, BT_SIZE, BT_CONST_STRING,
|
||||
BT_VALIST_ARG)
|
||||
DEF_FUNCTION_TYPE_5 (BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
|
||||
BT_BOOL, BT_LONG, BT_LONG, BT_LONG,
|
||||
BT_PTR_LONG, BT_PTR_LONG)
|
||||
|
||||
DEF_FUNCTION_TYPE_6 (BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VALIST_ARG,
|
||||
BT_INT, BT_STRING, BT_SIZE, BT_INT, BT_SIZE,
|
||||
BT_CONST_STRING, BT_VALIST_ARG)
|
||||
DEF_FUNCTION_TYPE_6 (BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
|
||||
BT_BOOL, BT_LONG, BT_LONG, BT_LONG, BT_LONG,
|
||||
BT_PTR_LONG, BT_PTR_LONG)
|
||||
DEF_FUNCTION_TYPE_6 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
|
||||
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT,
|
||||
BT_LONG, BT_LONG, BT_LONG)
|
||||
|
||||
DEF_FUNCTION_TYPE_7 (BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG,
|
||||
BT_VOID, BT_PTR_FN_VOID_PTR, BT_PTR, BT_UINT,
|
||||
BT_LONG, BT_LONG, BT_LONG, BT_LONG)
|
||||
|
||||
DEF_FUNCTION_TYPE_VAR_0 (BT_FN_VOID_VAR, BT_VOID)
|
||||
DEF_FUNCTION_TYPE_VAR_0 (BT_FN_INT_VAR, BT_INT)
|
||||
DEF_FUNCTION_TYPE_VAR_0 (BT_FN_PTR_VAR, BT_PTR)
|
||||
|
||||
DEF_FUNCTION_TYPE_VAR_1 (BT_FN_VOID_VALIST_REF_VAR,
|
||||
BT_VOID, BT_VALIST_REF)
|
||||
DEF_FUNCTION_TYPE_VAR_1 (BT_FN_VOID_CONST_PTR_VAR,
|
||||
BT_VOID, BT_CONST_PTR)
|
||||
DEF_FUNCTION_TYPE_VAR_1 (BT_FN_INT_CONST_STRING_VAR,
|
||||
BT_INT, BT_CONST_STRING)
|
||||
|
||||
DEF_FUNCTION_TYPE_VAR_2 (BT_FN_INT_FILEPTR_CONST_STRING_VAR,
|
||||
BT_INT, BT_FILEPTR, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_VAR_2 (BT_FN_INT_STRING_CONST_STRING_VAR,
|
||||
BT_INT, BT_STRING, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_VAR_2 (BT_FN_INT_CONST_STRING_CONST_STRING_VAR,
|
||||
BT_INT, BT_CONST_STRING, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_VAR_2 (BT_FN_INT_INT_CONST_STRING_VAR,
|
||||
BT_INT, BT_INT, BT_CONST_STRING)
|
||||
|
||||
DEF_FUNCTION_TYPE_VAR_3 (BT_FN_INT_STRING_SIZE_CONST_STRING_VAR,
|
||||
BT_INT, BT_STRING, BT_SIZE, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_VAR_3 (BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR,
|
||||
BT_SSIZE, BT_STRING, BT_SIZE, BT_CONST_STRING)
|
||||
DEF_FUNCTION_TYPE_VAR_3 (BT_FN_INT_FILEPTR_INT_CONST_STRING_VAR,
|
||||
BT_INT, BT_FILEPTR, BT_INT, BT_CONST_STRING)
|
||||
|
||||
DEF_FUNCTION_TYPE_VAR_4 (BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VAR,
|
||||
BT_INT, BT_STRING, BT_INT, BT_SIZE, BT_CONST_STRING)
|
||||
|
||||
DEF_FUNCTION_TYPE_VAR_5 (BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VAR,
|
||||
BT_INT, BT_STRING, BT_SIZE, BT_INT, BT_SIZE,
|
||||
BT_CONST_STRING)
|
||||
|
||||
DEF_POINTER_TYPE (BT_PTR_FN_VOID_VAR, BT_FN_VOID_VAR)
|
||||
DEF_FUNCTION_TYPE_3 (BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE,
|
||||
BT_PTR, BT_PTR_FN_VOID_VAR, BT_PTR, BT_SIZE)
|
11295
contrib/gcc/builtins.c
11295
contrib/gcc/builtins.c
File diff suppressed because it is too large
Load Diff
@ -1,732 +0,0 @@
|
||||
/* This file contains the definitions and documentation for the
|
||||
builtins used in the GNU compiler.
|
||||
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
/* Before including this file, you should define a macro:
|
||||
|
||||
DEF_BUILTIN (ENUM, NAME, CLASS, TYPE, LIBTYPE, BOTH_P,
|
||||
FALLBACK_P, NONANSI_P, ATTRS, IMPLICIT, COND)
|
||||
|
||||
This macro will be called once for each builtin function. The
|
||||
ENUM will be of type `enum built_in_function', and will indicate
|
||||
which builtin function is being processed. The NAME of the builtin
|
||||
function (which will always start with `__builtin_') is a string
|
||||
literal. The CLASS is of type `enum built_in_class' and indicates
|
||||
what kind of builtin is being processed.
|
||||
|
||||
Some builtins are actually two separate functions. For example,
|
||||
for `strcmp' there are two builtin functions; `__builtin_strcmp'
|
||||
and `strcmp' itself. Both behave identically. Other builtins
|
||||
define only the `__builtin' variant. If BOTH_P is TRUE, then this
|
||||
builtin has both variants; otherwise, it is has only the first
|
||||
variant.
|
||||
|
||||
TYPE indicates the type of the function. The symbols correspond to
|
||||
enumerals from builtin-types.def. If BOTH_P is true, then LIBTYPE
|
||||
is the type of the non-`__builtin_' variant. Otherwise, LIBTYPE
|
||||
should be ignored.
|
||||
|
||||
If FALLBACK_P is true then, if for some reason, the compiler cannot
|
||||
expand the builtin function directly, it will call the
|
||||
corresponding library function (which does not have the
|
||||
`__builtin_' prefix.
|
||||
|
||||
If NONANSI_P is true, then the non-`__builtin_' variant is not an
|
||||
ANSI/ISO library function, and so we should pretend it does not
|
||||
exist when compiling in ANSI conformant mode.
|
||||
|
||||
ATTRs is an attribute list as defined in builtin-attrs.def that
|
||||
describes the attributes of this builtin function.
|
||||
|
||||
IMPLICIT specifies condition when the builtin can be produced by
|
||||
compiler. For instance C90 reserves floorf function, but does not
|
||||
define it's meaning. When user uses floorf we may assume that the
|
||||
floorf has the meaning we expect, but we can't produce floorf by
|
||||
simplifying floor((double)float) since the runtime need not implement
|
||||
it.
|
||||
|
||||
The builtins is registered only if COND is true. */
|
||||
|
||||
/* A GCC builtin (like __builtin_saveregs) is provided by the
|
||||
compiler, but does not correspond to a function in the standard
|
||||
library. */
|
||||
#undef DEF_GCC_BUILTIN
|
||||
#define DEF_GCC_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
||||
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \
|
||||
false, false, false, ATTRS, true, true)
|
||||
|
||||
/* Like DEF_GCC_BUILTIN, except we don't prepend "__builtin_". */
|
||||
#undef DEF_SYNC_BUILTIN
|
||||
#define DEF_SYNC_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
||||
DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, TYPE, BT_LAST, \
|
||||
false, false, false, ATTRS, true, true)
|
||||
|
||||
/* A library builtin (like __builtin_strchr) is a builtin equivalent
|
||||
of an ANSI/ISO standard library function. In addition to the
|
||||
`__builtin' version, we will create an ordinary version (e.g,
|
||||
`strchr') as well. If we cannot compute the answer using the
|
||||
builtin function, we will fall back to the standard library
|
||||
version. */
|
||||
#undef DEF_LIB_BUILTIN
|
||||
#define DEF_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
||||
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
|
||||
true, true, false, ATTRS, true, true)
|
||||
|
||||
/* Like DEF_LIB_BUILTIN, except that the function is not one that is
|
||||
specified by ANSI/ISO C. So, when we're being fully conformant we
|
||||
ignore the version of these builtins that does not begin with
|
||||
__builtin. */
|
||||
#undef DEF_EXT_LIB_BUILTIN
|
||||
#define DEF_EXT_LIB_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
||||
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
|
||||
true, true, true, ATTRS, false, true)
|
||||
|
||||
/* Like DEF_LIB_BUILTIN, except that the function is only a part of
|
||||
the standard in C94 or above. */
|
||||
#undef DEF_C94_BUILTIN
|
||||
#define DEF_C94_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
||||
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
|
||||
true, true, !flag_isoc94, ATTRS, TARGET_C99_FUNCTIONS, true)
|
||||
|
||||
/* Like DEF_LIB_BUILTIN, except that the function is only a part of
|
||||
the standard in C99 or above. */
|
||||
#undef DEF_C99_BUILTIN
|
||||
#define DEF_C99_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
||||
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
|
||||
true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS, true)
|
||||
|
||||
/* Builtin that is specified by C99 and C90 reserve the name for future use.
|
||||
We can still recognize the builtin in C90 mode but we can't produce it
|
||||
implicitly. */
|
||||
#undef DEF_C99_C90RES_BUILTIN
|
||||
#define DEF_C99_C90RES_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
||||
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
|
||||
true, true, !flag_isoc99, ATTRS, TARGET_C99_FUNCTIONS, true)
|
||||
|
||||
/* Builtin that C99 reserve the name for future use. We can still recognize
|
||||
the builtin in C99 mode but we can't produce it implicitly. */
|
||||
#undef DEF_EXT_C99RES_BUILTIN
|
||||
#define DEF_EXT_C99RES_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
||||
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
|
||||
true, true, true, ATTRS, false, true)
|
||||
|
||||
/* Allocate the enum and the name for a builtin, but do not actually
|
||||
define it here at all. */
|
||||
#undef DEF_BUILTIN_STUB
|
||||
#define DEF_BUILTIN_STUB(ENUM, NAME) \
|
||||
DEF_BUILTIN (ENUM, NAME, BUILT_IN_NORMAL, 0, 0, false, false, \
|
||||
false, 0, false, false)
|
||||
|
||||
/* Builtin used by the implementation of GNU OpenMP. None of these are
|
||||
actually implemented in the compiler; they're all in libgomp. */
|
||||
#undef DEF_GOMP_BUILTIN
|
||||
#define DEF_GOMP_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
||||
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
|
||||
false, true, true, ATTRS, false, flag_openmp)
|
||||
|
||||
/* Define an attribute list for math functions that are normally
|
||||
"impure" because some of them may write into global memory for
|
||||
`errno'. If !flag_errno_math they are instead "const". */
|
||||
#undef ATTR_MATHFN_ERRNO
|
||||
#define ATTR_MATHFN_ERRNO (flag_errno_math ? \
|
||||
ATTR_NOTHROW_LIST : ATTR_CONST_NOTHROW_LIST)
|
||||
|
||||
/* Define an attribute list for math functions that are normally
|
||||
"pure" but if flag_unsafe_math_optimizations is set they are
|
||||
instead "const". This distinction accounts for the fact that some
|
||||
math functions check the rounding mode which is akin to examining
|
||||
global memory. In "unsafe" mode we can be less careful. */
|
||||
#undef ATTR_MATHFN_FPROUNDING
|
||||
#define ATTR_MATHFN_FPROUNDING (flag_unsafe_math_optimizations ? \
|
||||
ATTR_CONST_NOTHROW_LIST : ATTR_PURE_NOTHROW_NOVOPS_LIST)
|
||||
|
||||
/* Define an attribute list for math functions that are normally
|
||||
"impure" because some of them may write into global memory for
|
||||
`errno'. If !flag_errno_math, we can possibly use "pure" or
|
||||
"const" depending on whether we care about FP rounding. */
|
||||
#undef ATTR_MATHFN_FPROUNDING_ERRNO
|
||||
#define ATTR_MATHFN_FPROUNDING_ERRNO (flag_errno_math ? \
|
||||
ATTR_NOTHROW_LIST : ATTR_MATHFN_FPROUNDING)
|
||||
|
||||
/* Define an attribute list for math functions that need to mind FP
|
||||
rounding, but because they store into memory they are never "const"
|
||||
or "pure". Use of this macro is mainly for documentation and
|
||||
maintenance purposes. */
|
||||
#undef ATTR_MATHFN_FPROUNDING_STORE
|
||||
#define ATTR_MATHFN_FPROUNDING_STORE ATTR_NOTHROW_LIST
|
||||
|
||||
/* Category: math builtins. */
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ACOS, "acos", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_ACOSF, "acosf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ACOSH, "acosh", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ACOSHF, "acoshf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ACOSHL, "acoshl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_ACOSL, "acosl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ASIN, "asin", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_ASINF, "asinf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ASINH, "asinh", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ASINHF, "asinhf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ASINHL, "asinhl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_ASINL, "asinl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ATAN, "atan", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ATAN2, "atan2", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_ATAN2F, "atan2f", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_ATAN2L, "atan2l", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_ATANF, "atanf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ATANH, "atanh", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ATANHF, "atanhf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ATANHL, "atanhl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_ATANL, "atanl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CBRT, "cbrt", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CBRTF, "cbrtf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CBRTL, "cbrtl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_CEIL, "ceil", BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_CEILF, "ceilf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_CEILL, "ceill", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_COPYSIGN, "copysign", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_COPYSIGNF, "copysignf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_COPYSIGNL, "copysignl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_COS, "cos", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_COSF, "cosf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_COSH, "cosh", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_COSHF, "coshf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_COSHL, "coshl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_COSL, "cosl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_DREM, "drem", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_DREMF, "dremf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_DREML, "dreml", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ERF, "erf", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ERFC, "erfc", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ERFCF, "erfcf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ERFCL, "erfcl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ERFF, "erff", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ERFL, "erfl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_EXP, "exp", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_EXP10, "exp10", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_EXP10F, "exp10f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_EXP10L, "exp10l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_EXP2, "exp2", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_EXP2F, "exp2f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_EXP2L, "exp2l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_EXPF, "expf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_EXPL, "expl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_EXPM1, "expm1", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_EXPM1F, "expm1f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_EXPM1L, "expm1l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_FABS, "fabs", BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_FABSF, "fabsf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_FABSL, "fabsl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_FDIM, "fdim", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_FDIMF, "fdimf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_FDIML, "fdiml", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_FLOOR, "floor", BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_FLOORF, "floorf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_FLOORL, "floorl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_FMA, "fma", BT_FN_DOUBLE_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_FMAF, "fmaf", BT_FN_FLOAT_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_FMAL, "fmal", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_FMAX, "fmax", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_FMAXF, "fmaxf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_FMAXL, "fmaxl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_FMIN, "fmin", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_FMINF, "fminf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_FMINL, "fminl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_FMOD, "fmod", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_FMODF, "fmodf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_FMODL, "fmodl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_FREXP, "frexp", BT_FN_DOUBLE_DOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_FREXPF, "frexpf", BT_FN_FLOAT_FLOAT_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_FREXPL, "frexpl", BT_FN_LONGDOUBLE_LONGDOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMA, "gamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAF, "gammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAL, "gammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_HUGE_VAL, "huge_val", BT_FN_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_HUGE_VALF, "huge_valf", BT_FN_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_HUGE_VALL, "huge_vall", BT_FN_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_HYPOT, "hypot", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_HYPOTF, "hypotf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_HYPOTL, "hypotl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ILOGB, "ilogb", BT_FN_INT_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ILOGBF, "ilogbf", BT_FN_INT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ILOGBL, "ilogbl", BT_FN_INT_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_INF, "inf", BT_FN_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_INFF, "inff", BT_FN_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_INFL, "infl", BT_FN_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_INFD32, "infd32", BT_FN_DFLOAT32, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_INFD64, "infd64", BT_FN_DFLOAT64, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_INFD128, "infd128", BT_FN_DFLOAT128, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_J0, "j0", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_J0F, "j0f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_J0L, "j0l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_J1, "j1", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_J1F, "j1f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_J1L, "j1l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_JN, "jn", BT_FN_DOUBLE_INT_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_JNF, "jnf", BT_FN_FLOAT_INT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_JNL, "jnl", BT_FN_LONGDOUBLE_INT_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LCEIL, "lceil", BT_FN_LONG_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LCEILF, "lceilf", BT_FN_LONG_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LCEILL, "lceill", BT_FN_LONG_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_LDEXP, "ldexp", BT_FN_DOUBLE_DOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_LDEXPF, "ldexpf", BT_FN_FLOAT_FLOAT_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_LDEXPL, "ldexpl", BT_FN_LONGDOUBLE_LONGDOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LFLOOR, "lfloor", BT_FN_LONG_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LFLOORF, "lfloorf", BT_FN_LONG_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LFLOORL, "lfloorl", BT_FN_LONG_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LGAMMA, "lgamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LGAMMAF, "lgammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LGAMMAL, "lgammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LLCEIL, "llceil", BT_FN_LONGLONG_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LLCEILF, "llceilf", BT_FN_LONGLONG_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LLCEILL, "llceill", BT_FN_LONGLONG_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LLFLOOR, "llfloor", BT_FN_LONGLONG_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LLFLOORF, "llfloorf", BT_FN_LONGLONG_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LLFLOORL, "llfloorl", BT_FN_LONGLONG_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LLRINT, "llrint", BT_FN_LONGLONG_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LLRINTF, "llrintf", BT_FN_LONGLONG_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LLRINTL, "llrintl", BT_FN_LONGLONG_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LLROUND, "llround", BT_FN_LONGLONG_DOUBLE, ATTR_MATHFN_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LLROUNDF, "llroundf", BT_FN_LONGLONG_FLOAT, ATTR_MATHFN_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LLROUNDL, "llroundl", BT_FN_LONGLONG_LONGDOUBLE, ATTR_MATHFN_ERRNO)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_LOG, "log", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_LOG10, "log10", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_LOG10F, "log10f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_LOG10L, "log10l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LOG1P, "log1p", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LOG1PF, "log1pf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LOG1PL, "log1pl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LOG2, "log2", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LOG2F, "log2f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LOG2L, "log2l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LOGB, "logb", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LOGBF, "logbf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LOGBL, "logbl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_LOGF, "logf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_LOGL, "logl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LRINT, "lrint", BT_FN_LONG_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LRINTF, "lrintf", BT_FN_LONG_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LRINTL, "lrintl", BT_FN_LONG_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LROUND, "lround", BT_FN_LONG_DOUBLE, ATTR_MATHFN_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LROUNDF, "lroundf", BT_FN_LONG_FLOAT, ATTR_MATHFN_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LROUNDL, "lroundl", BT_FN_LONG_LONGDOUBLE, ATTR_MATHFN_ERRNO)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_MODF, "modf", BT_FN_DOUBLE_DOUBLE_DOUBLEPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_MODFF, "modff", BT_FN_FLOAT_FLOAT_FLOATPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_MODFL, "modfl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLEPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_NAN, "nan", BT_FN_DOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_NANF, "nanf", BT_FN_FLOAT_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_NANL, "nanl", BT_FN_LONGDOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_NAND32, "nand32", BT_FN_DFLOAT32_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_NAND64, "nand64", BT_FN_DFLOAT64_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_NAND128, "nand128", BT_FN_DFLOAT128_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_NANS, "nans", BT_FN_DOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_NANSF, "nansf", BT_FN_FLOAT_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_NANSL, "nansl", BT_FN_LONGDOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL)
|
||||
DEF_C99_BUILTIN (BUILT_IN_NEARBYINT, "nearbyint", BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_NEARBYINTF, "nearbyintf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_NEARBYINTL, "nearbyintl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_NEXTAFTER, "nextafter", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_NEXTAFTERF, "nextafterf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_NEXTAFTERL, "nextafterl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_NEXTTOWARD, "nexttoward", BT_FN_DOUBLE_DOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_NEXTTOWARDF, "nexttowardf", BT_FN_FLOAT_FLOAT_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_NEXTTOWARDL, "nexttowardl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_POW, "pow", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_POW10, "pow10", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_POW10F, "pow10f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_POW10L, "pow10l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_POWF, "powf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_POWI, "powi", BT_FN_DOUBLE_DOUBLE_INT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_POWIF, "powif", BT_FN_FLOAT_FLOAT_INT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_POWIL, "powil", BT_FN_LONGDOUBLE_LONGDOUBLE_INT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_POWL, "powl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_REMAINDER, "remainder", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_REMAINDERF, "remainderf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_REMAINDERL, "remainderl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_REMQUO, "remquo", BT_FN_DOUBLE_DOUBLE_DOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_C99_BUILTIN (BUILT_IN_REMQUOF, "remquof", BT_FN_FLOAT_FLOAT_FLOAT_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_C99_BUILTIN (BUILT_IN_REMQUOL, "remquol", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_C99_BUILTIN (BUILT_IN_RINT, "rint", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_RINTF, "rintf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_RINTL, "rintl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ROUND, "round", BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ROUNDF, "roundf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ROUNDL, "roundl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SCALB, "scalb", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SCALBF, "scalbf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SCALBL, "scalbl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_SCALBLN, "scalbln", BT_FN_DOUBLE_DOUBLE_LONG, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_SCALBLNF, "scalblnf", BT_FN_FLOAT_FLOAT_LONG, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_SCALBLNL, "scalblnl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONG, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_SCALBN, "scalbn", BT_FN_DOUBLE_DOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_SCALBNF, "scalbnf", BT_FN_FLOAT_FLOAT_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_SCALBNL, "scalbnl", BT_FN_LONGDOUBLE_LONGDOUBLE_INT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNBIT, "signbit", BT_FN_INT_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNBITF, "signbitf", BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNBITL, "signbitl", BT_FN_INT_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNIFICAND, "significand", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNIFICANDF, "significandf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNIFICANDL, "significandl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_SIN, "sin", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SINCOS, "sincos", BT_FN_VOID_DOUBLE_DOUBLEPTR_DOUBLEPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SINCOSF, "sincosf", BT_FN_VOID_FLOAT_FLOATPTR_FLOATPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SINCOSL, "sincosl", BT_FN_VOID_LONGDOUBLE_LONGDOUBLEPTR_LONGDOUBLEPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_SINF, "sinf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_SINH, "sinh", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_SINHF, "sinhf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_SINHL, "sinhl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_SINL, "sinl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_SQRT, "sqrt", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_SQRTF, "sqrtf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_SQRTL, "sqrtl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_TAN, "tan", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_TANF, "tanf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_TANH, "tanh", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_TANHF, "tanhf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_TANHL, "tanhl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_TANL, "tanl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_TGAMMA, "tgamma", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_TGAMMAF, "tgammaf", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_TGAMMAL, "tgammal", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_C99_BUILTIN (BUILT_IN_TRUNC, "trunc", BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_TRUNCF, "truncf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_TRUNCL, "truncl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_Y0, "y0", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_Y0F, "y0f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_Y0L, "y0l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_Y1, "y1", BT_FN_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_Y1F, "y1f", BT_FN_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_Y1L, "y1l", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_YN, "yn", BT_FN_DOUBLE_INT_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_YNF, "ynf", BT_FN_FLOAT_INT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_YNL, "ynl", BT_FN_LONGDOUBLE_INT_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
|
||||
/* Category: _Complex math builtins. */
|
||||
DEF_C99_BUILTIN (BUILT_IN_CABS, "cabs", BT_FN_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CABSF, "cabsf", BT_FN_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CABSL, "cabsl", BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CACOS, "cacos", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CACOSF, "cacosf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CACOSH, "cacosh", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CACOSHF, "cacoshf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CACOSHL, "cacoshl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CACOSL, "cacosl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CARG, "carg", BT_FN_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CARGF, "cargf", BT_FN_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CARGL, "cargl", BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CASIN, "casin", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CASINF, "casinf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CASINH, "casinh", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CASINHF, "casinhf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CASINHL, "casinhl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CASINL, "casinl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CATAN, "catan", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CATANF, "catanf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CATANH, "catanh", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CATANHF, "catanhf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CATANHL, "catanhl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CATANL, "catanl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CCOS, "ccos", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CCOSF, "ccosf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CCOSH, "ccosh", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CCOSHF, "ccoshf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CCOSHL, "ccoshl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CCOSL, "ccosl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CEXP, "cexp", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CEXPF, "cexpf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CEXPL, "cexpl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CIMAG, "cimag", BT_FN_DOUBLE_COMPLEX_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CIMAGF, "cimagf", BT_FN_FLOAT_COMPLEX_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CIMAGL, "cimagl", BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CLOG, "clog", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CLOGF, "clogf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CLOGL, "clogl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_EXT_C99RES_BUILTIN (BUILT_IN_CLOG10, "clog10", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_EXT_C99RES_BUILTIN (BUILT_IN_CLOG10F, "clog10f", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_EXT_C99RES_BUILTIN (BUILT_IN_CLOG10L, "clog10l", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CONJ, "conj", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CONJF, "conjf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CONJL, "conjl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CPOW, "cpow", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CPOWF, "cpowf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CPOWL, "cpowl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CPROJ, "cproj", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CPROJF, "cprojf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CPROJL, "cprojl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CREAL, "creal", BT_FN_DOUBLE_COMPLEX_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CREALF, "crealf", BT_FN_FLOAT_COMPLEX_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CREALL, "creall", BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CSIN, "csin", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CSINF, "csinf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CSINH, "csinh", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CSINHF, "csinhf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CSINHL, "csinhl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CSINL, "csinl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CSQRT, "csqrt", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CSQRTF, "csqrtf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CSQRTL, "csqrtl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CTAN, "ctan", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CTANF, "ctanf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CTANH, "ctanh", BT_FN_COMPLEX_DOUBLE_COMPLEX_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CTANHF, "ctanhf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CTANHL, "ctanhl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CTANL, "ctanl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
|
||||
/* Category: string/memory builtins. */
|
||||
/* bcmp, bcopy and bzero have traditionally accepted NULL pointers
|
||||
when the length parameter is zero, so don't apply attribute "nonnull". */
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_BCMP, "bcmp", BT_FN_INT_CONST_PTR_CONST_PTR_SIZE, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_BCOPY, "bcopy", BT_FN_VOID_CONST_PTR_PTR_SIZE, ATTR_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_BZERO, "bzero", BT_FN_VOID_PTR_SIZE, ATTR_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_INDEX, "index", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_MEMCMP, "memcmp", BT_FN_INT_CONST_PTR_CONST_PTR_SIZE, ATTR_PURE_NOTHROW_NONNULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_MEMCPY, "memcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_MEMMOVE, "memmove", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMPCPY, "mempcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_MEMSET, "memset", BT_FN_PTR_PTR_INT_SIZE, ATTR_NOTHROW_NONNULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_RINDEX, "rindex", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STPCPY, "stpcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STPNCPY, "stpncpy", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRCASECMP, "strcasecmp", BT_FN_INT_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRCAT, "strcat", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRCHR, "strchr", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRCMP, "strcmp", BT_FN_INT_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRCPY, "strcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRCSPN, "strcspn", BT_FN_SIZE_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRDUP, "strdup", BT_FN_STRING_CONST_STRING, ATTR_MALLOC_NOTHROW_NONNULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNDUP, "strndup", BT_FN_STRING_CONST_STRING_SIZE, ATTR_MALLOC_NOTHROW_NONNULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRLEN, "strlen", BT_FN_SIZE_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNCASECMP, "strncasecmp", BT_FN_INT_CONST_STRING_CONST_STRING_SIZE, ATTR_PURE_NOTHROW_NONNULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRNCAT, "strncat", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRNCMP, "strncmp", BT_FN_INT_CONST_STRING_CONST_STRING_SIZE, ATTR_PURE_NOTHROW_NONNULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRNCPY, "strncpy", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRPBRK, "strpbrk", BT_FN_STRING_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRRCHR, "strrchr", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRSPN, "strspn", BT_FN_SIZE_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRSTR, "strstr", BT_FN_STRING_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL)
|
||||
|
||||
/* Category: stdio builtins. */
|
||||
DEF_LIB_BUILTIN (BUILT_IN_FPRINTF, "fprintf", BT_FN_INT_FILEPTR_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_2_3)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FPRINTF_UNLOCKED, "fprintf_unlocked", BT_FN_INT_FILEPTR_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_2_3)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_PUTC, "putc", BT_FN_INT_INT_FILEPTR, ATTR_NONNULL_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_PUTC_UNLOCKED, "putc_unlocked", BT_FN_INT_INT_FILEPTR, ATTR_NONNULL_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_FPUTC, "fputc", BT_FN_INT_INT_FILEPTR, ATTR_NONNULL_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FPUTC_UNLOCKED, "fputc_unlocked", BT_FN_INT_INT_FILEPTR, ATTR_NONNULL_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_FPUTS, "fputs", BT_FN_INT_CONST_STRING_FILEPTR, ATTR_NONNULL_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FPUTS_UNLOCKED, "fputs_unlocked", BT_FN_INT_CONST_STRING_FILEPTR, ATTR_NONNULL_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_FSCANF, "fscanf", BT_FN_INT_FILEPTR_CONST_STRING_VAR, ATTR_FORMAT_SCANF_2_3)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_FWRITE, "fwrite", BT_FN_SIZE_CONST_PTR_SIZE_SIZE_FILEPTR, ATTR_NONNULL_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FWRITE_UNLOCKED, "fwrite_unlocked", BT_FN_SIZE_CONST_PTR_SIZE_SIZE_FILEPTR, ATTR_NONNULL_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_PRINTF, "printf", BT_FN_INT_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_1_2)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_PRINTF_UNLOCKED, "printf_unlocked", BT_FN_INT_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_1_2)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_PUTCHAR, "putchar", BT_FN_INT_INT, ATTR_NULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_PUTCHAR_UNLOCKED, "putchar_unlocked", BT_FN_INT_INT, ATTR_NULL)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_PUTS, "puts", BT_FN_INT_CONST_STRING, ATTR_NONNULL_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_PUTS_UNLOCKED, "puts_unlocked", BT_FN_INT_CONST_STRING, ATTR_NONNULL_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_SCANF, "scanf", BT_FN_INT_CONST_STRING_VAR, ATTR_FORMAT_SCANF_1_2)
|
||||
DEF_C99_BUILTIN (BUILT_IN_SNPRINTF, "snprintf", BT_FN_INT_STRING_SIZE_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_3_4)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_SPRINTF, "sprintf", BT_FN_INT_STRING_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_2_3)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_SSCANF, "sscanf", BT_FN_INT_CONST_STRING_CONST_STRING_VAR, ATTR_FORMAT_SCANF_2_3)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_VFPRINTF, "vfprintf", BT_FN_INT_FILEPTR_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_2_0)
|
||||
DEF_C99_BUILTIN (BUILT_IN_VFSCANF, "vfscanf", BT_FN_INT_FILEPTR_CONST_STRING_VALIST_ARG, ATTR_FORMAT_SCANF_2_0)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_VPRINTF, "vprintf", BT_FN_INT_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_1_0)
|
||||
DEF_C99_BUILTIN (BUILT_IN_VSCANF, "vscanf", BT_FN_INT_CONST_STRING_VALIST_ARG, ATTR_FORMAT_SCANF_1_0)
|
||||
DEF_C99_BUILTIN (BUILT_IN_VSNPRINTF, "vsnprintf", BT_FN_INT_STRING_SIZE_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_3_0)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_VSPRINTF, "vsprintf", BT_FN_INT_STRING_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_2_0)
|
||||
DEF_C99_BUILTIN (BUILT_IN_VSSCANF, "vsscanf", BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG, ATTR_FORMAT_SCANF_2_0)
|
||||
|
||||
/* Category: ctype builtins. */
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISALNUM, "isalnum", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISALPHA, "isalpha", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISASCII, "isascii", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ISBLANK, "isblank", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISCNTRL, "iscntrl", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISDIGIT, "isdigit", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISGRAPH, "isgraph", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISLOWER, "islower", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISPRINT, "isprint", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISPUNCT, "ispunct", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISSPACE, "isspace", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISUPPER, "isupper", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISXDIGIT, "isxdigit", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_TOASCII, "toascii", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_TOLOWER, "tolower", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_TOUPPER, "toupper", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LIST)
|
||||
|
||||
/* Category: wctype builtins. */
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWALNUM, "iswalnum", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWALPHA, "iswalpha", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ISWBLANK, "iswblank", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWCNTRL, "iswcntrl", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWDIGIT, "iswdigit", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWGRAPH, "iswgraph", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWLOWER, "iswlower", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWPRINT, "iswprint", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWPUNCT, "iswpunct", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWSPACE, "iswspace", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWUPPER, "iswupper", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWXDIGIT, "iswxdigit", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_TOWLOWER, "towlower", BT_FN_WINT_WINT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_TOWUPPER, "towupper", BT_FN_WINT_WINT, ATTR_PURE_NOTHROW_LIST)
|
||||
|
||||
/* Category: miscellaneous builtins. */
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ABORT, "abort", BT_FN_VOID, ATTR_NORETURN_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ABS, "abs", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_AGGREGATE_INCOMING_ADDRESS, "aggregate_incoming_address", BT_FN_PTR_VAR, ATTR_NULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ALLOCA, "alloca", BT_FN_PTR_SIZE, ATTR_MALLOC_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_APPLY, "apply", BT_FN_PTR_PTR_FN_VOID_VAR_PTR_SIZE, ATTR_NULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_APPLY_ARGS, "apply_args", BT_FN_PTR_VAR, ATTR_NULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ARGS_INFO, "args_info", BT_FN_INT_INT, ATTR_NULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_BSWAP32, "bswap32", BT_FN_UINT32_UINT32, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_BSWAP64, "bswap64", BT_FN_UINT64_UINT64, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_CALLOC, "calloc", BT_FN_PTR_SIZE_SIZE, ATTR_MALLOC_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CLASSIFY_TYPE, "classify_type", BT_FN_INT_VAR, ATTR_NULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CLZ, "clz", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CLZIMAX, "clzimax", BT_FN_INT_UINTMAX, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CLZL, "clzl", BT_FN_INT_ULONG, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CLZLL, "clzll", BT_FN_INT_ULONGLONG, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CONSTANT_P, "constant_p", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CTZ, "ctz", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CTZIMAX, "ctzimax", BT_FN_INT_UINTMAX, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CTZL, "ctzl", BT_FN_INT_ULONG, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CTZLL, "ctzll", BT_FN_INT_ULONGLONG, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_DCGETTEXT, "dcgettext", BT_FN_STRING_CONST_STRING_CONST_STRING_INT, ATTR_FORMAT_ARG_2)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_DGETTEXT, "dgettext", BT_FN_STRING_CONST_STRING_CONST_STRING, ATTR_FORMAT_ARG_2)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_DWARF_CFA, "dwarf_cfa", BT_FN_PTR, ATTR_NULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_DWARF_SP_COLUMN, "dwarf_sp_column", BT_FN_UINT, ATTR_NULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_EH_RETURN, "eh_return", BT_FN_VOID_PTRMODE_PTR, ATTR_NORETURN_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_EH_RETURN_DATA_REGNO, "eh_return_data_regno", BT_FN_INT_INT, ATTR_NULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_EXECL, "execl", BT_FN_INT_CONST_STRING_CONST_STRING_VAR, ATTR_SENTINEL_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_EXECLP, "execlp", BT_FN_INT_CONST_STRING_CONST_STRING_VAR, ATTR_SENTINEL_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_EXECLE, "execle", BT_FN_INT_CONST_STRING_CONST_STRING_VAR, ATTR_NOTHROW_SENTINEL_1)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_EXECV, "execv", BT_FN_INT_CONST_STRING_PTR_CONST_STRING, ATTR_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_EXECVP, "execvp", BT_FN_INT_CONST_STRING_PTR_CONST_STRING, ATTR_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_EXECVE, "execve", BT_FN_INT_CONST_STRING_PTR_CONST_STRING_PTR_CONST_STRING, ATTR_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_EXIT, "exit", BT_FN_VOID_INT, ATTR_NORETURN_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_EXPECT, "expect", BT_FN_LONG_LONG_LONG, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_EXTEND_POINTER, "extend_pointer", BT_FN_WORD_PTR, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_EXTRACT_RETURN_ADDR, "extract_return_addr", BT_FN_PTR_PTR, ATTR_NULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FFS, "ffs", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSIMAX, "ffsimax", BT_FN_INT_INTMAX, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSL, "ffsl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSLL, "ffsll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FORK, "fork", BT_FN_PID, ATTR_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_FRAME_ADDRESS, "frame_address", BT_FN_PTR_UINT, ATTR_NULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_FROB_RETURN_ADDR, "frob_return_addr", BT_FN_PTR_PTR, ATTR_NULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_GETTEXT, "gettext", BT_FN_STRING_CONST_STRING, ATTR_FORMAT_ARG_1)
|
||||
DEF_C99_BUILTIN (BUILT_IN_IMAXABS, "imaxabs", BT_FN_INTMAX_INTMAX, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_INIT_DWARF_REG_SIZES, "init_dwarf_reg_size_table", BT_FN_VOID_PTR, ATTR_NULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITE, "finite", BT_FN_INT_DOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITEF, "finitef", BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITEL, "finitel", BT_FN_INT_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITED32, "finited32", BT_FN_INT_DFLOAT32, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITED64, "finited64", BT_FN_INT_DFLOAT64, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITED128, "finited128", BT_FN_INT_DFLOAT128, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_ISINF, "isinf", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISINFF, "isinff", BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISINFL, "isinfl", BT_FN_INT_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISINFD32, "isinfd32", BT_FN_INT_DFLOAT32, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISINFD64, "isinfd64", BT_FN_INT_DFLOAT64, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISINFD128, "isinfd128", BT_FN_INT_DFLOAT128, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_ISNAN, "isnan", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISNANF, "isnanf", BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISNANL, "isnanl", BT_FN_INT_LONGDOUBLE, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISNAND32, "isnand32", BT_FN_INT_DFLOAT32, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISNAND64, "isnand64", BT_FN_INT_DFLOAT64, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISNAND128, "isnand128", BT_FN_INT_DFLOAT128, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ISGREATER, "isgreater", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ISGREATEREQUAL, "isgreaterequal", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ISLESS, "isless", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ISLESSEQUAL, "islessequal", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ISLESSGREATER, "islessgreater", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ISUNORDERED, "isunordered", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_LABS, "labs", BT_FN_LONG_LONG, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LLABS, "llabs", BT_FN_LONGLONG_LONGLONG, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LONGJMP, "longjmp", BT_FN_VOID_PTR_INT, ATTR_NORETURN_NOTHROW_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_MALLOC, "malloc", BT_FN_PTR_SIZE, ATTR_MALLOC_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_NEXT_ARG, "next_arg", BT_FN_PTR_VAR, ATTR_NULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_PARITY, "parity", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_PARITYIMAX, "parityimax", BT_FN_INT_UINTMAX, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_PARITYL, "parityl", BT_FN_INT_ULONG, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_PARITYLL, "parityll", BT_FN_INT_ULONGLONG, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_POPCOUNT, "popcount", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTIMAX, "popcountimax", BT_FN_INT_UINTMAX, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTL, "popcountl", BT_FN_INT_ULONG, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTLL, "popcountll", BT_FN_INT_ULONGLONG, ATTR_CONST_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_PREFETCH, "prefetch", BT_FN_VOID_CONST_PTR_VAR, ATTR_NOVOPS_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_RETURN, "return", BT_FN_VOID_PTR, ATTR_NORETURN_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_RETURN_ADDRESS, "return_address", BT_FN_PTR_UINT, ATTR_NULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_SAVEREGS, "saveregs", BT_FN_PTR_VAR, ATTR_NULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_SETJMP, "setjmp", BT_FN_INT_PTR, ATTR_NULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_STDARG_START, "stdarg_start", BT_FN_VOID_VALIST_REF_VAR, ATTR_NULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRFMON, "strfmon", BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR, ATTR_FORMAT_STRFMON_3_4)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRFTIME, "strftime", BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR, ATTR_FORMAT_STRFTIME_3_0)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_TRAP, "trap", BT_FN_VOID, ATTR_NORETURN_NOTHROW_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_UNWIND_INIT, "unwind_init", BT_FN_VOID, ATTR_NULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_UPDATE_SETJMP_BUF, "update_setjmp_buf", BT_FN_VOID_PTR_INT, ATTR_NULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_VA_COPY, "va_copy", BT_FN_VOID_VALIST_REF_VALIST_ARG, ATTR_NULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_VA_END, "va_end", BT_FN_VOID_VALIST_REF, ATTR_NULL)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_VA_START, "va_start", BT_FN_VOID_VALIST_REF_VAR, ATTR_NULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN__EXIT, "_exit", BT_FN_VOID_INT, ATTR_NORETURN_NOTHROW_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN__EXIT2, "_Exit", BT_FN_VOID_INT, ATTR_NORETURN_NOTHROW_LIST)
|
||||
|
||||
/* Implementing nested functions. */
|
||||
DEF_BUILTIN_STUB (BUILT_IN_INIT_TRAMPOLINE, "__builtin_init_trampoline")
|
||||
DEF_BUILTIN_STUB (BUILT_IN_ADJUST_TRAMPOLINE, "__builtin_adjust_trampoline")
|
||||
DEF_BUILTIN_STUB (BUILT_IN_NONLOCAL_GOTO, "__builtin_nonlocal_goto")
|
||||
|
||||
/* Implementing __builtin_setjmp. */
|
||||
DEF_BUILTIN_STUB (BUILT_IN_SETJMP_SETUP, "__builtin_setjmp_setup")
|
||||
DEF_BUILTIN_STUB (BUILT_IN_SETJMP_DISPATCHER, "__builtin_setjmp_dispatcher")
|
||||
DEF_BUILTIN_STUB (BUILT_IN_SETJMP_RECEIVER, "__builtin_setjmp_receiver")
|
||||
|
||||
/* Implementing variable sized local variables. */
|
||||
DEF_BUILTIN_STUB (BUILT_IN_STACK_SAVE, "__builtin_stack_save")
|
||||
DEF_BUILTIN_STUB (BUILT_IN_STACK_RESTORE, "__builtin_stack_restore")
|
||||
|
||||
/* Object size checking builtins. */
|
||||
DEF_GCC_BUILTIN (BUILT_IN_OBJECT_SIZE, "object_size", BT_FN_SIZE_CONST_PTR_INT, ATTR_PURE_NOTHROW_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMCPY_CHK, "__memcpy_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_NOTHROW_NONNULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMMOVE_CHK, "__memmove_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_NOTHROW_NONNULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMPCPY_CHK, "__mempcpy_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_NOTHROW_NONNULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMSET_CHK, "__memset_chk", BT_FN_PTR_PTR_INT_SIZE_SIZE, ATTR_NOTHROW_NONNULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STPCPY_CHK, "__stpcpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRCAT_CHK, "__strcat_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRCPY_CHK, "__strcpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNCAT_CHK, "__strncat_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_NOTHROW_NONNULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNCPY_CHK, "__strncpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_NOTHROW_NONNULL)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SNPRINTF_CHK, "__snprintf_chk", BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_5_6)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SPRINTF_CHK, "__sprintf_chk", BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_4_5)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_VSNPRINTF_CHK, "__vsnprintf_chk", BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_5_0)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_VSPRINTF_CHK, "__vsprintf_chk", BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_4_0)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FPRINTF_CHK, "__fprintf_chk", BT_FN_INT_FILEPTR_INT_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_3_4)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_PRINTF_CHK, "__printf_chk", BT_FN_INT_INT_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_2_3)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_VFPRINTF_CHK, "__vfprintf_chk", BT_FN_INT_FILEPTR_INT_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_3_0)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_VPRINTF_CHK, "__vprintf_chk", BT_FN_INT_INT_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_2_0)
|
||||
|
||||
/* Profiling hooks. */
|
||||
DEF_BUILTIN_STUB (BUILT_IN_PROFILE_FUNC_ENTER, "profile_func_enter")
|
||||
DEF_BUILTIN_STUB (BUILT_IN_PROFILE_FUNC_EXIT, "profile_func_exit")
|
||||
|
||||
/* Synchronization Primitives. */
|
||||
#include "sync-builtins.def"
|
||||
|
||||
/* OpenMP builtins. */
|
||||
#include "omp-builtins.def"
|
@ -1,591 +0,0 @@
|
||||
/* Generate information regarding function declarations and definitions based
|
||||
on information stored in GCC's tree structure. This code implements the
|
||||
-aux-info option.
|
||||
Copyright (C) 1989, 1991, 1994, 1995, 1997, 1998,
|
||||
1999, 2000, 2003, 2004 Free Software Foundation, Inc.
|
||||
Contributed by Ron Guilmette (rfg@segfault.us.com).
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "flags.h"
|
||||
#include "tree.h"
|
||||
#include "c-tree.h"
|
||||
#include "toplev.h"
|
||||
|
||||
enum formals_style_enum {
|
||||
ansi,
|
||||
k_and_r_names,
|
||||
k_and_r_decls
|
||||
};
|
||||
typedef enum formals_style_enum formals_style;
|
||||
|
||||
|
||||
static const char *data_type;
|
||||
|
||||
static char *affix_data_type (const char *) ATTRIBUTE_MALLOC;
|
||||
static const char *gen_formal_list_for_type (tree, formals_style);
|
||||
static int deserves_ellipsis (tree);
|
||||
static const char *gen_formal_list_for_func_def (tree, formals_style);
|
||||
static const char *gen_type (const char *, tree, formals_style);
|
||||
static const char *gen_decl (tree, int, formals_style);
|
||||
|
||||
/* Given a string representing an entire type or an entire declaration
|
||||
which only lacks the actual "data-type" specifier (at its left end),
|
||||
affix the data-type specifier to the left end of the given type
|
||||
specification or object declaration.
|
||||
|
||||
Because of C language weirdness, the data-type specifier (which normally
|
||||
goes in at the very left end) may have to be slipped in just to the
|
||||
right of any leading "const" or "volatile" qualifiers (there may be more
|
||||
than one). Actually this may not be strictly necessary because it seems
|
||||
that GCC (at least) accepts `<data-type> const foo;' and treats it the
|
||||
same as `const <data-type> foo;' but people are accustomed to seeing
|
||||
`const char *foo;' and *not* `char const *foo;' so we try to create types
|
||||
that look as expected. */
|
||||
|
||||
static char *
|
||||
affix_data_type (const char *param)
|
||||
{
|
||||
char *const type_or_decl = ASTRDUP (param);
|
||||
char *p = type_or_decl;
|
||||
char *qualifiers_then_data_type;
|
||||
char saved;
|
||||
|
||||
/* Skip as many leading const's or volatile's as there are. */
|
||||
|
||||
for (;;)
|
||||
{
|
||||
if (!strncmp (p, "volatile ", 9))
|
||||
{
|
||||
p += 9;
|
||||
continue;
|
||||
}
|
||||
if (!strncmp (p, "const ", 6))
|
||||
{
|
||||
p += 6;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* p now points to the place where we can insert the data type. We have to
|
||||
add a blank after the data-type of course. */
|
||||
|
||||
if (p == type_or_decl)
|
||||
return concat (data_type, " ", type_or_decl, NULL);
|
||||
|
||||
saved = *p;
|
||||
*p = '\0';
|
||||
qualifiers_then_data_type = concat (type_or_decl, data_type, NULL);
|
||||
*p = saved;
|
||||
return reconcat (qualifiers_then_data_type,
|
||||
qualifiers_then_data_type, " ", p, NULL);
|
||||
}
|
||||
|
||||
/* Given a tree node which represents some "function type", generate the
|
||||
source code version of a formal parameter list (of some given style) for
|
||||
this function type. Return the whole formal parameter list (including
|
||||
a pair of surrounding parens) as a string. Note that if the style
|
||||
we are currently aiming for is non-ansi, then we just return a pair
|
||||
of empty parens here. */
|
||||
|
||||
static const char *
|
||||
gen_formal_list_for_type (tree fntype, formals_style style)
|
||||
{
|
||||
const char *formal_list = "";
|
||||
tree formal_type;
|
||||
|
||||
if (style != ansi)
|
||||
return "()";
|
||||
|
||||
formal_type = TYPE_ARG_TYPES (fntype);
|
||||
while (formal_type && TREE_VALUE (formal_type) != void_type_node)
|
||||
{
|
||||
const char *this_type;
|
||||
|
||||
if (*formal_list)
|
||||
formal_list = concat (formal_list, ", ", NULL);
|
||||
|
||||
this_type = gen_type ("", TREE_VALUE (formal_type), ansi);
|
||||
formal_list
|
||||
= ((strlen (this_type))
|
||||
? concat (formal_list, affix_data_type (this_type), NULL)
|
||||
: concat (formal_list, data_type, NULL));
|
||||
|
||||
formal_type = TREE_CHAIN (formal_type);
|
||||
}
|
||||
|
||||
/* If we got to here, then we are trying to generate an ANSI style formal
|
||||
parameters list.
|
||||
|
||||
New style prototyped ANSI formal parameter lists should in theory always
|
||||
contain some stuff between the opening and closing parens, even if it is
|
||||
only "void".
|
||||
|
||||
The brutal truth though is that there is lots of old K&R code out there
|
||||
which contains declarations of "pointer-to-function" parameters and
|
||||
these almost never have fully specified formal parameter lists associated
|
||||
with them. That is, the pointer-to-function parameters are declared
|
||||
with just empty parameter lists.
|
||||
|
||||
In cases such as these, protoize should really insert *something* into
|
||||
the vacant parameter lists, but what? It has no basis on which to insert
|
||||
anything in particular.
|
||||
|
||||
Here, we make life easy for protoize by trying to distinguish between
|
||||
K&R empty parameter lists and new-style prototyped parameter lists
|
||||
that actually contain "void". In the latter case we (obviously) want
|
||||
to output the "void" verbatim, and that what we do. In the former case,
|
||||
we do our best to give protoize something nice to insert.
|
||||
|
||||
This "something nice" should be something that is still valid (when
|
||||
re-compiled) but something that can clearly indicate to the user that
|
||||
more typing information (for the parameter list) should be added (by
|
||||
hand) at some convenient moment.
|
||||
|
||||
The string chosen here is a comment with question marks in it. */
|
||||
|
||||
if (!*formal_list)
|
||||
{
|
||||
if (TYPE_ARG_TYPES (fntype))
|
||||
/* assert (TREE_VALUE (TYPE_ARG_TYPES (fntype)) == void_type_node); */
|
||||
formal_list = "void";
|
||||
else
|
||||
formal_list = "/* ??? */";
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If there were at least some parameters, and if the formals-types-list
|
||||
petered out to a NULL (i.e. without being terminated by a
|
||||
void_type_node) then we need to tack on an ellipsis. */
|
||||
if (!formal_type)
|
||||
formal_list = concat (formal_list, ", ...", NULL);
|
||||
}
|
||||
|
||||
return concat (" (", formal_list, ")", NULL);
|
||||
}
|
||||
|
||||
/* For the generation of an ANSI prototype for a function definition, we have
|
||||
to look at the formal parameter list of the function's own "type" to
|
||||
determine if the function's formal parameter list should end with an
|
||||
ellipsis. Given a tree node, the following function will return nonzero
|
||||
if the "function type" parameter list should end with an ellipsis. */
|
||||
|
||||
static int
|
||||
deserves_ellipsis (tree fntype)
|
||||
{
|
||||
tree formal_type;
|
||||
|
||||
formal_type = TYPE_ARG_TYPES (fntype);
|
||||
while (formal_type && TREE_VALUE (formal_type) != void_type_node)
|
||||
formal_type = TREE_CHAIN (formal_type);
|
||||
|
||||
/* If there were at least some parameters, and if the formals-types-list
|
||||
petered out to a NULL (i.e. without being terminated by a void_type_node)
|
||||
then we need to tack on an ellipsis. */
|
||||
|
||||
return (!formal_type && TYPE_ARG_TYPES (fntype));
|
||||
}
|
||||
|
||||
/* Generate a parameter list for a function definition (in some given style).
|
||||
|
||||
Note that this routine has to be separate (and different) from the code that
|
||||
generates the prototype parameter lists for function declarations, because
|
||||
in the case of a function declaration, all we have to go on is a tree node
|
||||
representing the function's own "function type". This can tell us the types
|
||||
of all of the formal parameters for the function, but it cannot tell us the
|
||||
actual *names* of each of the formal parameters. We need to output those
|
||||
parameter names for each function definition.
|
||||
|
||||
This routine gets a pointer to a tree node which represents the actual
|
||||
declaration of the given function, and this DECL node has a list of formal
|
||||
parameter (variable) declarations attached to it. These formal parameter
|
||||
(variable) declaration nodes give us the actual names of the formal
|
||||
parameters for the given function definition.
|
||||
|
||||
This routine returns a string which is the source form for the entire
|
||||
function formal parameter list. */
|
||||
|
||||
static const char *
|
||||
gen_formal_list_for_func_def (tree fndecl, formals_style style)
|
||||
{
|
||||
const char *formal_list = "";
|
||||
tree formal_decl;
|
||||
|
||||
formal_decl = DECL_ARGUMENTS (fndecl);
|
||||
while (formal_decl)
|
||||
{
|
||||
const char *this_formal;
|
||||
|
||||
if (*formal_list && ((style == ansi) || (style == k_and_r_names)))
|
||||
formal_list = concat (formal_list, ", ", NULL);
|
||||
this_formal = gen_decl (formal_decl, 0, style);
|
||||
if (style == k_and_r_decls)
|
||||
formal_list = concat (formal_list, this_formal, "; ", NULL);
|
||||
else
|
||||
formal_list = concat (formal_list, this_formal, NULL);
|
||||
formal_decl = TREE_CHAIN (formal_decl);
|
||||
}
|
||||
if (style == ansi)
|
||||
{
|
||||
if (!DECL_ARGUMENTS (fndecl))
|
||||
formal_list = concat (formal_list, "void", NULL);
|
||||
if (deserves_ellipsis (TREE_TYPE (fndecl)))
|
||||
formal_list = concat (formal_list, ", ...", NULL);
|
||||
}
|
||||
if ((style == ansi) || (style == k_and_r_names))
|
||||
formal_list = concat (" (", formal_list, ")", NULL);
|
||||
return formal_list;
|
||||
}
|
||||
|
||||
/* Generate a string which is the source code form for a given type (t). This
|
||||
routine is ugly and complex because the C syntax for declarations is ugly
|
||||
and complex. This routine is straightforward so long as *no* pointer types,
|
||||
array types, or function types are involved.
|
||||
|
||||
In the simple cases, this routine will return the (string) value which was
|
||||
passed in as the "ret_val" argument. Usually, this starts out either as an
|
||||
empty string, or as the name of the declared item (i.e. the formal function
|
||||
parameter variable).
|
||||
|
||||
This routine will also return with the global variable "data_type" set to
|
||||
some string value which is the "basic" data-type of the given complete type.
|
||||
This "data_type" string can be concatenated onto the front of the returned
|
||||
string after this routine returns to its caller.
|
||||
|
||||
In complicated cases involving pointer types, array types, or function
|
||||
types, the C declaration syntax requires an "inside out" approach, i.e. if
|
||||
you have a type which is a "pointer-to-function" type, you need to handle
|
||||
the "pointer" part first, but it also has to be "innermost" (relative to
|
||||
the declaration stuff for the "function" type). Thus, is this case, you
|
||||
must prepend a "(*" and append a ")" to the name of the item (i.e. formal
|
||||
variable). Then you must append and prepend the other info for the
|
||||
"function type" part of the overall type.
|
||||
|
||||
To handle the "innermost precedence" rules of complicated C declarators, we
|
||||
do the following (in this routine). The input parameter called "ret_val"
|
||||
is treated as a "seed". Each time gen_type is called (perhaps recursively)
|
||||
some additional strings may be appended or prepended (or both) to the "seed"
|
||||
string. If yet another (lower) level of the GCC tree exists for the given
|
||||
type (as in the case of a pointer type, an array type, or a function type)
|
||||
then the (wrapped) seed is passed to a (recursive) invocation of gen_type()
|
||||
this recursive invocation may again "wrap" the (new) seed with yet more
|
||||
declarator stuff, by appending, prepending (or both). By the time the
|
||||
recursion bottoms out, the "seed value" at that point will have a value
|
||||
which is (almost) the complete source version of the declarator (except
|
||||
for the data_type info). Thus, this deepest "seed" value is simply passed
|
||||
back up through all of the recursive calls until it is given (as the return
|
||||
value) to the initial caller of the gen_type() routine. All that remains
|
||||
to do at this point is for the initial caller to prepend the "data_type"
|
||||
string onto the returned "seed". */
|
||||
|
||||
static const char *
|
||||
gen_type (const char *ret_val, tree t, formals_style style)
|
||||
{
|
||||
tree chain_p;
|
||||
|
||||
/* If there is a typedef name for this type, use it. */
|
||||
if (TYPE_NAME (t) && TREE_CODE (TYPE_NAME (t)) == TYPE_DECL)
|
||||
data_type = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (t)));
|
||||
else
|
||||
{
|
||||
switch (TREE_CODE (t))
|
||||
{
|
||||
case POINTER_TYPE:
|
||||
if (TYPE_READONLY (t))
|
||||
ret_val = concat ("const ", ret_val, NULL);
|
||||
if (TYPE_VOLATILE (t))
|
||||
ret_val = concat ("volatile ", ret_val, NULL);
|
||||
|
||||
ret_val = concat ("*", ret_val, NULL);
|
||||
|
||||
if (TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE || TREE_CODE (TREE_TYPE (t)) == FUNCTION_TYPE)
|
||||
ret_val = concat ("(", ret_val, ")", NULL);
|
||||
|
||||
ret_val = gen_type (ret_val, TREE_TYPE (t), style);
|
||||
|
||||
return ret_val;
|
||||
|
||||
case ARRAY_TYPE:
|
||||
if (!COMPLETE_TYPE_P (t) || TREE_CODE (TYPE_SIZE (t)) != INTEGER_CST)
|
||||
ret_val = gen_type (concat (ret_val, "[]", NULL),
|
||||
TREE_TYPE (t), style);
|
||||
else if (int_size_in_bytes (t) == 0)
|
||||
ret_val = gen_type (concat (ret_val, "[0]", NULL),
|
||||
TREE_TYPE (t), style);
|
||||
else
|
||||
{
|
||||
int size = (int_size_in_bytes (t) / int_size_in_bytes (TREE_TYPE (t)));
|
||||
char buff[10];
|
||||
sprintf (buff, "[%d]", size);
|
||||
ret_val = gen_type (concat (ret_val, buff, NULL),
|
||||
TREE_TYPE (t), style);
|
||||
}
|
||||
break;
|
||||
|
||||
case FUNCTION_TYPE:
|
||||
ret_val = gen_type (concat (ret_val,
|
||||
gen_formal_list_for_type (t, style),
|
||||
NULL),
|
||||
TREE_TYPE (t), style);
|
||||
break;
|
||||
|
||||
case IDENTIFIER_NODE:
|
||||
data_type = IDENTIFIER_POINTER (t);
|
||||
break;
|
||||
|
||||
/* The following three cases are complicated by the fact that a
|
||||
user may do something really stupid, like creating a brand new
|
||||
"anonymous" type specification in a formal argument list (or as
|
||||
part of a function return type specification). For example:
|
||||
|
||||
int f (enum { red, green, blue } color);
|
||||
|
||||
In such cases, we have no name that we can put into the prototype
|
||||
to represent the (anonymous) type. Thus, we have to generate the
|
||||
whole darn type specification. Yuck! */
|
||||
|
||||
case RECORD_TYPE:
|
||||
if (TYPE_NAME (t))
|
||||
data_type = IDENTIFIER_POINTER (TYPE_NAME (t));
|
||||
else
|
||||
{
|
||||
data_type = "";
|
||||
chain_p = TYPE_FIELDS (t);
|
||||
while (chain_p)
|
||||
{
|
||||
data_type = concat (data_type, gen_decl (chain_p, 0, ansi),
|
||||
NULL);
|
||||
chain_p = TREE_CHAIN (chain_p);
|
||||
data_type = concat (data_type, "; ", NULL);
|
||||
}
|
||||
data_type = concat ("{ ", data_type, "}", NULL);
|
||||
}
|
||||
data_type = concat ("struct ", data_type, NULL);
|
||||
break;
|
||||
|
||||
case UNION_TYPE:
|
||||
if (TYPE_NAME (t))
|
||||
data_type = IDENTIFIER_POINTER (TYPE_NAME (t));
|
||||
else
|
||||
{
|
||||
data_type = "";
|
||||
chain_p = TYPE_FIELDS (t);
|
||||
while (chain_p)
|
||||
{
|
||||
data_type = concat (data_type, gen_decl (chain_p, 0, ansi),
|
||||
NULL);
|
||||
chain_p = TREE_CHAIN (chain_p);
|
||||
data_type = concat (data_type, "; ", NULL);
|
||||
}
|
||||
data_type = concat ("{ ", data_type, "}", NULL);
|
||||
}
|
||||
data_type = concat ("union ", data_type, NULL);
|
||||
break;
|
||||
|
||||
case ENUMERAL_TYPE:
|
||||
if (TYPE_NAME (t))
|
||||
data_type = IDENTIFIER_POINTER (TYPE_NAME (t));
|
||||
else
|
||||
{
|
||||
data_type = "";
|
||||
chain_p = TYPE_VALUES (t);
|
||||
while (chain_p)
|
||||
{
|
||||
data_type = concat (data_type,
|
||||
IDENTIFIER_POINTER (TREE_PURPOSE (chain_p)), NULL);
|
||||
chain_p = TREE_CHAIN (chain_p);
|
||||
if (chain_p)
|
||||
data_type = concat (data_type, ", ", NULL);
|
||||
}
|
||||
data_type = concat ("{ ", data_type, " }", NULL);
|
||||
}
|
||||
data_type = concat ("enum ", data_type, NULL);
|
||||
break;
|
||||
|
||||
case TYPE_DECL:
|
||||
data_type = IDENTIFIER_POINTER (DECL_NAME (t));
|
||||
break;
|
||||
|
||||
case INTEGER_TYPE:
|
||||
data_type = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (t)));
|
||||
/* Normally, `unsigned' is part of the deal. Not so if it comes
|
||||
with a type qualifier. */
|
||||
if (TYPE_UNSIGNED (t) && TYPE_QUALS (t))
|
||||
data_type = concat ("unsigned ", data_type, NULL);
|
||||
break;
|
||||
|
||||
case REAL_TYPE:
|
||||
data_type = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (t)));
|
||||
break;
|
||||
|
||||
case VOID_TYPE:
|
||||
data_type = "void";
|
||||
break;
|
||||
|
||||
case ERROR_MARK:
|
||||
data_type = "[ERROR]";
|
||||
break;
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
if (TYPE_READONLY (t))
|
||||
ret_val = concat ("const ", ret_val, NULL);
|
||||
if (TYPE_VOLATILE (t))
|
||||
ret_val = concat ("volatile ", ret_val, NULL);
|
||||
if (TYPE_RESTRICT (t))
|
||||
ret_val = concat ("restrict ", ret_val, NULL);
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/* Generate a string (source) representation of an entire entity declaration
|
||||
(using some particular style for function types).
|
||||
|
||||
The given entity may be either a variable or a function.
|
||||
|
||||
If the "is_func_definition" parameter is nonzero, assume that the thing
|
||||
we are generating a declaration for is a FUNCTION_DECL node which is
|
||||
associated with a function definition. In this case, we can assume that
|
||||
an attached list of DECL nodes for function formal arguments is present. */
|
||||
|
||||
static const char *
|
||||
gen_decl (tree decl, int is_func_definition, formals_style style)
|
||||
{
|
||||
const char *ret_val;
|
||||
|
||||
if (DECL_NAME (decl))
|
||||
ret_val = IDENTIFIER_POINTER (DECL_NAME (decl));
|
||||
else
|
||||
ret_val = "";
|
||||
|
||||
/* If we are just generating a list of names of formal parameters, we can
|
||||
simply return the formal parameter name (with no typing information
|
||||
attached to it) now. */
|
||||
|
||||
if (style == k_and_r_names)
|
||||
return ret_val;
|
||||
|
||||
/* Note that for the declaration of some entity (either a function or a
|
||||
data object, like for instance a parameter) if the entity itself was
|
||||
declared as either const or volatile, then const and volatile properties
|
||||
are associated with just the declaration of the entity, and *not* with
|
||||
the `type' of the entity. Thus, for such declared entities, we have to
|
||||
generate the qualifiers here. */
|
||||
|
||||
if (TREE_THIS_VOLATILE (decl))
|
||||
ret_val = concat ("volatile ", ret_val, NULL);
|
||||
if (TREE_READONLY (decl))
|
||||
ret_val = concat ("const ", ret_val, NULL);
|
||||
|
||||
data_type = "";
|
||||
|
||||
/* For FUNCTION_DECL nodes, there are two possible cases here. First, if
|
||||
this FUNCTION_DECL node was generated from a function "definition", then
|
||||
we will have a list of DECL_NODE's, one for each of the function's formal
|
||||
parameters. In this case, we can print out not only the types of each
|
||||
formal, but also each formal's name. In the second case, this
|
||||
FUNCTION_DECL node came from an actual function declaration (and *not*
|
||||
a definition). In this case, we do nothing here because the formal
|
||||
argument type-list will be output later, when the "type" of the function
|
||||
is added to the string we are building. Note that the ANSI-style formal
|
||||
parameter list is considered to be a (suffix) part of the "type" of the
|
||||
function. */
|
||||
|
||||
if (TREE_CODE (decl) == FUNCTION_DECL && is_func_definition)
|
||||
{
|
||||
ret_val = concat (ret_val, gen_formal_list_for_func_def (decl, ansi),
|
||||
NULL);
|
||||
|
||||
/* Since we have already added in the formals list stuff, here we don't
|
||||
add the whole "type" of the function we are considering (which
|
||||
would include its parameter-list info), rather, we only add in
|
||||
the "type" of the "type" of the function, which is really just
|
||||
the return-type of the function (and does not include the parameter
|
||||
list info). */
|
||||
|
||||
ret_val = gen_type (ret_val, TREE_TYPE (TREE_TYPE (decl)), style);
|
||||
}
|
||||
else
|
||||
ret_val = gen_type (ret_val, TREE_TYPE (decl), style);
|
||||
|
||||
ret_val = affix_data_type (ret_val);
|
||||
|
||||
if (TREE_CODE (decl) != FUNCTION_DECL && C_DECL_REGISTER (decl))
|
||||
ret_val = concat ("register ", ret_val, NULL);
|
||||
if (TREE_PUBLIC (decl))
|
||||
ret_val = concat ("extern ", ret_val, NULL);
|
||||
if (TREE_CODE (decl) == FUNCTION_DECL && !TREE_PUBLIC (decl))
|
||||
ret_val = concat ("static ", ret_val, NULL);
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
extern FILE *aux_info_file;
|
||||
|
||||
/* Generate and write a new line of info to the aux-info (.X) file. This
|
||||
routine is called once for each function declaration, and once for each
|
||||
function definition (even the implicit ones). */
|
||||
|
||||
void
|
||||
gen_aux_info_record (tree fndecl, int is_definition, int is_implicit,
|
||||
int is_prototyped)
|
||||
{
|
||||
if (flag_gen_aux_info)
|
||||
{
|
||||
static int compiled_from_record = 0;
|
||||
expanded_location xloc = expand_location (DECL_SOURCE_LOCATION (fndecl));
|
||||
|
||||
/* Each output .X file must have a header line. Write one now if we
|
||||
have not yet done so. */
|
||||
|
||||
if (!compiled_from_record++)
|
||||
{
|
||||
/* The first line tells which directory file names are relative to.
|
||||
Currently, -aux-info works only for files in the working
|
||||
directory, so just use a `.' as a placeholder for now. */
|
||||
fprintf (aux_info_file, "/* compiled from: . */\n");
|
||||
}
|
||||
|
||||
/* Write the actual line of auxiliary info. */
|
||||
|
||||
fprintf (aux_info_file, "/* %s:%d:%c%c */ %s;",
|
||||
xloc.file, xloc.line,
|
||||
(is_implicit) ? 'I' : (is_prototyped) ? 'N' : 'O',
|
||||
(is_definition) ? 'F' : 'C',
|
||||
gen_decl (fndecl, is_definition, ansi));
|
||||
|
||||
/* If this is an explicit function declaration, we need to also write
|
||||
out an old-style (i.e. K&R) function header, just in case the user
|
||||
wants to run unprotoize. */
|
||||
|
||||
if (is_definition)
|
||||
{
|
||||
fprintf (aux_info_file, " /*%s %s*/",
|
||||
gen_formal_list_for_func_def (fndecl, k_and_r_names),
|
||||
gen_formal_list_for_func_def (fndecl, k_and_r_decls));
|
||||
}
|
||||
|
||||
fprintf (aux_info_file, "\n");
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,39 +0,0 @@
|
||||
/* This file contains the definitions and documentation for the
|
||||
additional tree codes used in the GNU C compiler (see tree.def
|
||||
for the standard codes).
|
||||
Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998,
|
||||
1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
|
||||
Written by Benjamin Chelf <chelf@codesourcery.com>
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
/* Tree nodes used in the C frontend. These are also shared with the
|
||||
C++ and Objective C frontends. */
|
||||
|
||||
/* A COMPOUND_LITERAL_EXPR represents a C99 compound literal. The
|
||||
COMPOUND_LITERAL_EXPR_DECL_STMT is the a DECL_STMT containing the decl
|
||||
for the anonymous object represented by the COMPOUND_LITERAL;
|
||||
the DECL_INITIAL of that decl is the CONSTRUCTOR that initializes
|
||||
the compound literal. */
|
||||
DEFTREECODE (COMPOUND_LITERAL_EXPR, "compound_literal_expr", tcc_expression, 1)
|
||||
|
||||
/*
|
||||
Local variables:
|
||||
mode:c
|
||||
End:
|
||||
*/
|
File diff suppressed because it is too large
Load Diff
@ -1,26 +0,0 @@
|
||||
# Top level configure fragment for GNU C - C language.
|
||||
# Copyright (C) 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
|
||||
|
||||
#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 2, 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 COPYING. If not, write to
|
||||
#the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
#Boston, MA 02110-1301, USA.
|
||||
|
||||
# This file c-config-lang.c is a special pseudo config-lang.in file
|
||||
# for the language C. It has limited use, specifically to record the
|
||||
# files used by C that have garbage collection GTY macros in them
|
||||
# which therefore need to be scanned by gengtype.c.
|
||||
|
||||
gtfiles="\$(srcdir)/c-lang.c \$(srcdir)/c-tree.h \$(srcdir)/c-decl.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-pragma.c \$(srcdir)/c-objc-common.c \$(srcdir)/c-parser.c"
|
@ -1,123 +0,0 @@
|
||||
/* Language-level data type conversion for GNU C.
|
||||
Copyright (C) 1987, 1988, 1991, 1998, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
|
||||
/* This file contains the functions for converting C expressions
|
||||
to different data types. The only entry point is `convert'.
|
||||
Every language front end must have a `convert' function
|
||||
but what kind of conversions it does will depend on the language. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "tree.h"
|
||||
#include "flags.h"
|
||||
#include "convert.h"
|
||||
#include "c-common.h"
|
||||
#include "c-tree.h"
|
||||
#include "langhooks.h"
|
||||
#include "toplev.h"
|
||||
#include "target.h"
|
||||
|
||||
/* Change of width--truncation and extension of integers or reals--
|
||||
is represented with NOP_EXPR. Proper functioning of many things
|
||||
assumes that no other conversions can be NOP_EXPRs.
|
||||
|
||||
Conversion between integer and pointer is represented with CONVERT_EXPR.
|
||||
Converting integer to real uses FLOAT_EXPR
|
||||
and real to integer uses FIX_TRUNC_EXPR.
|
||||
|
||||
Here is a list of all the functions that assume that widening and
|
||||
narrowing is always done with a NOP_EXPR:
|
||||
In convert.c, convert_to_integer.
|
||||
In c-typeck.c, build_binary_op (boolean ops), and
|
||||
c_common_truthvalue_conversion.
|
||||
In expr.c: expand_expr, for operands of a MULT_EXPR.
|
||||
In fold-const.c: fold.
|
||||
In tree.c: get_narrower and get_unwidened. */
|
||||
|
||||
/* Subroutines of `convert'. */
|
||||
|
||||
|
||||
|
||||
/* Create an expression whose value is that of EXPR,
|
||||
converted to type TYPE. The TREE_TYPE of the value
|
||||
is always TYPE. This function implements all reasonable
|
||||
conversions; callers should filter out those that are
|
||||
not permitted by the language being compiled. */
|
||||
|
||||
tree
|
||||
convert (tree type, tree expr)
|
||||
{
|
||||
tree e = expr;
|
||||
enum tree_code code = TREE_CODE (type);
|
||||
const char *invalid_conv_diag;
|
||||
|
||||
if (type == error_mark_node
|
||||
|| expr == error_mark_node
|
||||
|| TREE_TYPE (expr) == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
||||
if ((invalid_conv_diag
|
||||
= targetm.invalid_conversion (TREE_TYPE (expr), type)))
|
||||
{
|
||||
error (invalid_conv_diag, "");
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
if (type == TREE_TYPE (expr))
|
||||
return expr;
|
||||
|
||||
if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (expr)))
|
||||
return fold_convert (type, expr);
|
||||
if (TREE_CODE (TREE_TYPE (expr)) == ERROR_MARK)
|
||||
return error_mark_node;
|
||||
if (TREE_CODE (TREE_TYPE (expr)) == VOID_TYPE)
|
||||
{
|
||||
error ("void value not ignored as it ought to be");
|
||||
return error_mark_node;
|
||||
}
|
||||
if (code == VOID_TYPE)
|
||||
return fold_convert (type, e);
|
||||
if (code == INTEGER_TYPE || code == ENUMERAL_TYPE)
|
||||
return fold (convert_to_integer (type, e));
|
||||
if (code == BOOLEAN_TYPE)
|
||||
return fold_convert (type, c_objc_common_truthvalue_conversion (expr));
|
||||
if (code == POINTER_TYPE || code == REFERENCE_TYPE)
|
||||
return fold (convert_to_pointer (type, e));
|
||||
/* APPLE LOCAL begin blocks (C++ ck) */
|
||||
if (code == BLOCK_POINTER_TYPE)
|
||||
return fold (convert_to_block_pointer (type, e));
|
||||
/* APPLE LOCAL end blocks (C++ ck) */
|
||||
if (code == REAL_TYPE)
|
||||
return fold (convert_to_real (type, e));
|
||||
if (code == COMPLEX_TYPE)
|
||||
return fold (convert_to_complex (type, e));
|
||||
if (code == VECTOR_TYPE)
|
||||
return fold (convert_to_vector (type, e));
|
||||
if ((code == RECORD_TYPE || code == UNION_TYPE)
|
||||
&& lang_hooks.types_compatible_p (type, TREE_TYPE (expr)))
|
||||
return e;
|
||||
|
||||
error ("conversion to non-scalar type requested");
|
||||
return error_mark_node;
|
||||
}
|
@ -1,763 +0,0 @@
|
||||
/* Define builtin-in macros for the C family front ends.
|
||||
Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "tree.h"
|
||||
#include "version.h"
|
||||
#include "flags.h"
|
||||
#include "real.h"
|
||||
#include "c-common.h"
|
||||
#include "c-pragma.h"
|
||||
#include "output.h"
|
||||
#include "except.h" /* For USING_SJLJ_EXCEPTIONS. */
|
||||
#include "toplev.h"
|
||||
#include "tm_p.h" /* Target prototypes. */
|
||||
#include "target.h"
|
||||
|
||||
#ifndef TARGET_OS_CPP_BUILTINS
|
||||
# define TARGET_OS_CPP_BUILTINS()
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_OBJFMT_CPP_BUILTINS
|
||||
# define TARGET_OBJFMT_CPP_BUILTINS()
|
||||
#endif
|
||||
|
||||
#ifndef REGISTER_PREFIX
|
||||
#define REGISTER_PREFIX ""
|
||||
#endif
|
||||
|
||||
/* Non-static as some targets don't use it. */
|
||||
void builtin_define_std (const char *) ATTRIBUTE_UNUSED;
|
||||
static void builtin_define_with_value_n (const char *, const char *,
|
||||
size_t);
|
||||
static void builtin_define_with_int_value (const char *, HOST_WIDE_INT);
|
||||
static void builtin_define_with_hex_fp_value (const char *, tree,
|
||||
int, const char *,
|
||||
const char *,
|
||||
const char *);
|
||||
static void builtin_define_stdint_macros (void);
|
||||
static void builtin_define_type_max (const char *, tree, int);
|
||||
static void builtin_define_type_precision (const char *, tree);
|
||||
static void builtin_define_float_constants (const char *,
|
||||
const char *,
|
||||
const char *,
|
||||
tree);
|
||||
static void define__GNUC__ (void);
|
||||
|
||||
/* Define NAME with value TYPE precision. */
|
||||
static void
|
||||
builtin_define_type_precision (const char *name, tree type)
|
||||
{
|
||||
builtin_define_with_int_value (name, TYPE_PRECISION (type));
|
||||
}
|
||||
|
||||
/* Define the float.h constants for TYPE using NAME_PREFIX, FP_SUFFIX,
|
||||
and FP_CAST. */
|
||||
static void
|
||||
builtin_define_float_constants (const char *name_prefix,
|
||||
const char *fp_suffix,
|
||||
const char *fp_cast,
|
||||
tree type)
|
||||
{
|
||||
/* Used to convert radix-based values to base 10 values in several cases.
|
||||
|
||||
In the max_exp -> max_10_exp conversion for 128-bit IEEE, we need at
|
||||
least 6 significant digits for correct results. Using the fraction
|
||||
formed by (log(2)*1e6)/(log(10)*1e6) overflows a 32-bit integer as an
|
||||
intermediate; perhaps someone can find a better approximation, in the
|
||||
mean time, I suspect using doubles won't harm the bootstrap here. */
|
||||
|
||||
const double log10_2 = .30102999566398119521;
|
||||
double log10_b;
|
||||
const struct real_format *fmt;
|
||||
|
||||
char name[64], buf[128];
|
||||
int dig, min_10_exp, max_10_exp;
|
||||
int decimal_dig;
|
||||
|
||||
fmt = REAL_MODE_FORMAT (TYPE_MODE (type));
|
||||
gcc_assert (fmt->b != 10);
|
||||
|
||||
/* The radix of the exponent representation. */
|
||||
if (type == float_type_node)
|
||||
builtin_define_with_int_value ("__FLT_RADIX__", fmt->b);
|
||||
log10_b = log10_2 * fmt->log2_b;
|
||||
|
||||
/* The number of radix digits, p, in the floating-point significand. */
|
||||
sprintf (name, "__%s_MANT_DIG__", name_prefix);
|
||||
builtin_define_with_int_value (name, fmt->p);
|
||||
|
||||
/* The number of decimal digits, q, such that any floating-point number
|
||||
with q decimal digits can be rounded into a floating-point number with
|
||||
p radix b digits and back again without change to the q decimal digits,
|
||||
|
||||
p log10 b if b is a power of 10
|
||||
floor((p - 1) log10 b) otherwise
|
||||
*/
|
||||
dig = (fmt->p - 1) * log10_b;
|
||||
sprintf (name, "__%s_DIG__", name_prefix);
|
||||
builtin_define_with_int_value (name, dig);
|
||||
|
||||
/* The minimum negative int x such that b**(x-1) is a normalized float. */
|
||||
sprintf (name, "__%s_MIN_EXP__", name_prefix);
|
||||
sprintf (buf, "(%d)", fmt->emin);
|
||||
builtin_define_with_value (name, buf, 0);
|
||||
|
||||
/* The minimum negative int x such that 10**x is a normalized float,
|
||||
|
||||
ceil (log10 (b ** (emin - 1)))
|
||||
= ceil (log10 (b) * (emin - 1))
|
||||
|
||||
Recall that emin is negative, so the integer truncation calculates
|
||||
the ceiling, not the floor, in this case. */
|
||||
min_10_exp = (fmt->emin - 1) * log10_b;
|
||||
sprintf (name, "__%s_MIN_10_EXP__", name_prefix);
|
||||
sprintf (buf, "(%d)", min_10_exp);
|
||||
builtin_define_with_value (name, buf, 0);
|
||||
|
||||
/* The maximum int x such that b**(x-1) is a representable float. */
|
||||
sprintf (name, "__%s_MAX_EXP__", name_prefix);
|
||||
builtin_define_with_int_value (name, fmt->emax);
|
||||
|
||||
/* The maximum int x such that 10**x is in the range of representable
|
||||
finite floating-point numbers,
|
||||
|
||||
floor (log10((1 - b**-p) * b**emax))
|
||||
= floor (log10(1 - b**-p) + log10(b**emax))
|
||||
= floor (log10(1 - b**-p) + log10(b)*emax)
|
||||
|
||||
The safest thing to do here is to just compute this number. But since
|
||||
we don't link cc1 with libm, we cannot. We could implement log10 here
|
||||
a series expansion, but that seems too much effort because:
|
||||
|
||||
Note that the first term, for all extant p, is a number exceedingly close
|
||||
to zero, but slightly negative. Note that the second term is an integer
|
||||
scaling an irrational number, and that because of the floor we are only
|
||||
interested in its integral portion.
|
||||
|
||||
In order for the first term to have any effect on the integral portion
|
||||
of the second term, the second term has to be exceedingly close to an
|
||||
integer itself (e.g. 123.000000000001 or something). Getting a result
|
||||
that close to an integer requires that the irrational multiplicand have
|
||||
a long series of zeros in its expansion, which doesn't occur in the
|
||||
first 20 digits or so of log10(b).
|
||||
|
||||
Hand-waving aside, crunching all of the sets of constants above by hand
|
||||
does not yield a case for which the first term is significant, which
|
||||
in the end is all that matters. */
|
||||
max_10_exp = fmt->emax * log10_b;
|
||||
sprintf (name, "__%s_MAX_10_EXP__", name_prefix);
|
||||
builtin_define_with_int_value (name, max_10_exp);
|
||||
|
||||
/* The number of decimal digits, n, such that any floating-point number
|
||||
can be rounded to n decimal digits and back again without change to
|
||||
the value.
|
||||
|
||||
p * log10(b) if b is a power of 10
|
||||
ceil(1 + p * log10(b)) otherwise
|
||||
|
||||
The only macro we care about is this number for the widest supported
|
||||
floating type, but we want this value for rendering constants below. */
|
||||
{
|
||||
double d_decimal_dig = 1 + fmt->p * log10_b;
|
||||
decimal_dig = d_decimal_dig;
|
||||
if (decimal_dig < d_decimal_dig)
|
||||
decimal_dig++;
|
||||
}
|
||||
if (type == long_double_type_node)
|
||||
builtin_define_with_int_value ("__DECIMAL_DIG__", decimal_dig);
|
||||
|
||||
/* Since, for the supported formats, B is always a power of 2, we
|
||||
construct the following numbers directly as a hexadecimal
|
||||
constants. */
|
||||
|
||||
/* The maximum representable finite floating-point number,
|
||||
(1 - b**-p) * b**emax */
|
||||
{
|
||||
int i, n;
|
||||
char *p;
|
||||
|
||||
strcpy (buf, "0x0.");
|
||||
n = fmt->p * fmt->log2_b;
|
||||
for (i = 0, p = buf + 4; i + 3 < n; i += 4)
|
||||
*p++ = 'f';
|
||||
if (i < n)
|
||||
*p++ = "08ce"[n - i];
|
||||
sprintf (p, "p%d", fmt->emax * fmt->log2_b);
|
||||
if (fmt->pnan < fmt->p)
|
||||
{
|
||||
/* This is an IBM extended double format made up of two IEEE
|
||||
doubles. The value of the long double is the sum of the
|
||||
values of the two parts. The most significant part is
|
||||
required to be the value of the long double rounded to the
|
||||
nearest double. Rounding means we need a slightly smaller
|
||||
value for LDBL_MAX. */
|
||||
buf[4 + fmt->pnan / 4] = "7bde"[fmt->pnan % 4];
|
||||
}
|
||||
}
|
||||
sprintf (name, "__%s_MAX__", name_prefix);
|
||||
builtin_define_with_hex_fp_value (name, type, decimal_dig, buf, fp_suffix, fp_cast);
|
||||
|
||||
/* The minimum normalized positive floating-point number,
|
||||
b**(emin-1). */
|
||||
sprintf (name, "__%s_MIN__", name_prefix);
|
||||
sprintf (buf, "0x1p%d", (fmt->emin - 1) * fmt->log2_b);
|
||||
builtin_define_with_hex_fp_value (name, type, decimal_dig, buf, fp_suffix, fp_cast);
|
||||
|
||||
/* The difference between 1 and the least value greater than 1 that is
|
||||
representable in the given floating point type, b**(1-p). */
|
||||
sprintf (name, "__%s_EPSILON__", name_prefix);
|
||||
if (fmt->pnan < fmt->p)
|
||||
/* This is an IBM extended double format, so 1.0 + any double is
|
||||
representable precisely. */
|
||||
sprintf (buf, "0x1p%d", (fmt->emin - fmt->p) * fmt->log2_b);
|
||||
else
|
||||
sprintf (buf, "0x1p%d", (1 - fmt->p) * fmt->log2_b);
|
||||
builtin_define_with_hex_fp_value (name, type, decimal_dig, buf, fp_suffix, fp_cast);
|
||||
|
||||
/* For C++ std::numeric_limits<T>::denorm_min. The minimum denormalized
|
||||
positive floating-point number, b**(emin-p). Zero for formats that
|
||||
don't support denormals. */
|
||||
sprintf (name, "__%s_DENORM_MIN__", name_prefix);
|
||||
if (fmt->has_denorm)
|
||||
{
|
||||
sprintf (buf, "0x1p%d", (fmt->emin - fmt->p) * fmt->log2_b);
|
||||
builtin_define_with_hex_fp_value (name, type, decimal_dig,
|
||||
buf, fp_suffix, fp_cast);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf (buf, "0.0%s", fp_suffix);
|
||||
builtin_define_with_value (name, buf, 0);
|
||||
}
|
||||
|
||||
sprintf (name, "__%s_HAS_DENORM__", name_prefix);
|
||||
builtin_define_with_value (name, fmt->has_denorm ? "1" : "0", 0);
|
||||
|
||||
/* For C++ std::numeric_limits<T>::has_infinity. */
|
||||
sprintf (name, "__%s_HAS_INFINITY__", name_prefix);
|
||||
builtin_define_with_int_value (name,
|
||||
MODE_HAS_INFINITIES (TYPE_MODE (type)));
|
||||
/* For C++ std::numeric_limits<T>::has_quiet_NaN. We do not have a
|
||||
predicate to distinguish a target that has both quiet and
|
||||
signalling NaNs from a target that has only quiet NaNs or only
|
||||
signalling NaNs, so we assume that a target that has any kind of
|
||||
NaN has quiet NaNs. */
|
||||
sprintf (name, "__%s_HAS_QUIET_NAN__", name_prefix);
|
||||
builtin_define_with_int_value (name, MODE_HAS_NANS (TYPE_MODE (type)));
|
||||
}
|
||||
|
||||
/* Define __DECx__ constants for TYPE using NAME_PREFIX and SUFFIX. */
|
||||
static void
|
||||
builtin_define_decimal_float_constants (const char *name_prefix,
|
||||
const char *suffix,
|
||||
tree type)
|
||||
{
|
||||
const struct real_format *fmt;
|
||||
char name[64], buf[128], *p;
|
||||
int digits;
|
||||
|
||||
fmt = REAL_MODE_FORMAT (TYPE_MODE (type));
|
||||
|
||||
/* The number of radix digits, p, in the significand. */
|
||||
sprintf (name, "__%s_MANT_DIG__", name_prefix);
|
||||
builtin_define_with_int_value (name, fmt->p);
|
||||
|
||||
/* The minimum negative int x such that b**(x-1) is a normalized float. */
|
||||
sprintf (name, "__%s_MIN_EXP__", name_prefix);
|
||||
sprintf (buf, "(%d)", fmt->emin);
|
||||
builtin_define_with_value (name, buf, 0);
|
||||
|
||||
/* The maximum int x such that b**(x-1) is a representable float. */
|
||||
sprintf (name, "__%s_MAX_EXP__", name_prefix);
|
||||
builtin_define_with_int_value (name, fmt->emax);
|
||||
|
||||
/* Compute the minimum representable value. */
|
||||
sprintf (name, "__%s_MIN__", name_prefix);
|
||||
sprintf (buf, "1E%d%s", fmt->emin, suffix);
|
||||
builtin_define_with_value (name, buf, 0);
|
||||
|
||||
/* Compute the maximum representable value. */
|
||||
sprintf (name, "__%s_MAX__", name_prefix);
|
||||
p = buf;
|
||||
for (digits = fmt->p; digits; digits--)
|
||||
{
|
||||
*p++ = '9';
|
||||
if (digits == fmt->p)
|
||||
*p++ = '.';
|
||||
}
|
||||
*p = 0;
|
||||
/* fmt->p plus 1, to account for the decimal point. */
|
||||
sprintf (&buf[fmt->p + 1], "E%d%s", fmt->emax, suffix);
|
||||
builtin_define_with_value (name, buf, 0);
|
||||
|
||||
/* Compute epsilon (the difference between 1 and least value greater
|
||||
than 1 representable). */
|
||||
sprintf (name, "__%s_EPSILON__", name_prefix);
|
||||
sprintf (buf, "1E-%d%s", fmt->p - 1, suffix);
|
||||
builtin_define_with_value (name, buf, 0);
|
||||
|
||||
/* Minimum denormalized postive decimal value. */
|
||||
sprintf (name, "__%s_DEN__", name_prefix);
|
||||
p = buf;
|
||||
for (digits = fmt->p; digits > 1; digits--)
|
||||
{
|
||||
*p++ = '0';
|
||||
if (digits == fmt->p)
|
||||
*p++ = '.';
|
||||
}
|
||||
*p = 0;
|
||||
sprintf (&buf[fmt->p], "1E%d%s", fmt->emin, suffix);
|
||||
builtin_define_with_value (name, buf, 0);
|
||||
}
|
||||
|
||||
/* Define __GNUC__, __GNUC_MINOR__ and __GNUC_PATCHLEVEL__. */
|
||||
static void
|
||||
define__GNUC__ (void)
|
||||
{
|
||||
/* The format of the version string, enforced below, is
|
||||
([^0-9]*-)?[0-9]+[.][0-9]+([.][0-9]+)?([- ].*)? */
|
||||
const char *q, *v = version_string;
|
||||
|
||||
while (*v && !ISDIGIT (*v))
|
||||
v++;
|
||||
gcc_assert (*v && (v <= version_string || v[-1] == '-'));
|
||||
|
||||
q = v;
|
||||
while (ISDIGIT (*v))
|
||||
v++;
|
||||
builtin_define_with_value_n ("__GNUC__", q, v - q);
|
||||
if (c_dialect_cxx ())
|
||||
builtin_define_with_value_n ("__GNUG__", q, v - q);
|
||||
|
||||
gcc_assert (*v == '.' && ISDIGIT (v[1]));
|
||||
|
||||
q = ++v;
|
||||
while (ISDIGIT (*v))
|
||||
v++;
|
||||
builtin_define_with_value_n ("__GNUC_MINOR__", q, v - q);
|
||||
|
||||
if (*v == '.')
|
||||
{
|
||||
gcc_assert (ISDIGIT (v[1]));
|
||||
q = ++v;
|
||||
while (ISDIGIT (*v))
|
||||
v++;
|
||||
builtin_define_with_value_n ("__GNUC_PATCHLEVEL__", q, v - q);
|
||||
}
|
||||
else
|
||||
builtin_define_with_value_n ("__GNUC_PATCHLEVEL__", "0", 1);
|
||||
|
||||
gcc_assert (!*v || *v == ' ' || *v == '-');
|
||||
}
|
||||
|
||||
/* Define macros used by <stdint.h>. Currently only defines limits
|
||||
for intmax_t, used by the testsuite. */
|
||||
static void
|
||||
builtin_define_stdint_macros (void)
|
||||
{
|
||||
int intmax_long;
|
||||
if (intmax_type_node == long_long_integer_type_node)
|
||||
intmax_long = 2;
|
||||
else if (intmax_type_node == long_integer_type_node)
|
||||
intmax_long = 1;
|
||||
else if (intmax_type_node == integer_type_node)
|
||||
intmax_long = 0;
|
||||
else
|
||||
gcc_unreachable ();
|
||||
builtin_define_type_max ("__INTMAX_MAX__", intmax_type_node, intmax_long);
|
||||
}
|
||||
|
||||
/* Hook that registers front end and target-specific built-ins. */
|
||||
void
|
||||
c_cpp_builtins (cpp_reader *pfile)
|
||||
{
|
||||
/* -undef turns off target-specific built-ins. */
|
||||
if (flag_undef)
|
||||
return;
|
||||
|
||||
define__GNUC__ ();
|
||||
|
||||
/* For stddef.h. They require macros defined in c-common.c. */
|
||||
c_stddef_cpp_builtins ();
|
||||
|
||||
if (c_dialect_cxx ())
|
||||
{
|
||||
if (flag_weak && SUPPORTS_ONE_ONLY)
|
||||
cpp_define (pfile, "__GXX_WEAK__=1");
|
||||
else
|
||||
cpp_define (pfile, "__GXX_WEAK__=0");
|
||||
if (warn_deprecated)
|
||||
cpp_define (pfile, "__DEPRECATED");
|
||||
}
|
||||
/* Note that we define this for C as well, so that we know if
|
||||
__attribute__((cleanup)) will interface with EH. */
|
||||
if (flag_exceptions)
|
||||
cpp_define (pfile, "__EXCEPTIONS");
|
||||
|
||||
/* Represents the C++ ABI version, always defined so it can be used while
|
||||
preprocessing C and assembler. */
|
||||
if (flag_abi_version == 0)
|
||||
/* Use a very large value so that:
|
||||
|
||||
#if __GXX_ABI_VERSION >= <value for version X>
|
||||
|
||||
will work whether the user explicitly says "-fabi-version=x" or
|
||||
"-fabi-version=0". Do not use INT_MAX because that will be
|
||||
different from system to system. */
|
||||
builtin_define_with_int_value ("__GXX_ABI_VERSION", 999999);
|
||||
else if (flag_abi_version == 1)
|
||||
/* Due to a historical accident, this version had the value
|
||||
"102". */
|
||||
builtin_define_with_int_value ("__GXX_ABI_VERSION", 102);
|
||||
else
|
||||
/* Newer versions have values 1002, 1003, .... */
|
||||
builtin_define_with_int_value ("__GXX_ABI_VERSION",
|
||||
1000 + flag_abi_version);
|
||||
|
||||
/* libgcc needs to know this. */
|
||||
if (USING_SJLJ_EXCEPTIONS)
|
||||
cpp_define (pfile, "__USING_SJLJ_EXCEPTIONS__");
|
||||
|
||||
/* limits.h needs to know these. */
|
||||
builtin_define_type_max ("__SCHAR_MAX__", signed_char_type_node, 0);
|
||||
builtin_define_type_max ("__SHRT_MAX__", short_integer_type_node, 0);
|
||||
builtin_define_type_max ("__INT_MAX__", integer_type_node, 0);
|
||||
builtin_define_type_max ("__LONG_MAX__", long_integer_type_node, 1);
|
||||
builtin_define_type_max ("__LONG_LONG_MAX__", long_long_integer_type_node, 2);
|
||||
builtin_define_type_max ("__WCHAR_MAX__", wchar_type_node, 0);
|
||||
|
||||
builtin_define_type_precision ("__CHAR_BIT__", char_type_node);
|
||||
|
||||
/* stdint.h (eventually) and the testsuite need to know these. */
|
||||
builtin_define_stdint_macros ();
|
||||
|
||||
/* float.h needs to know these. */
|
||||
|
||||
builtin_define_with_int_value ("__FLT_EVAL_METHOD__",
|
||||
TARGET_FLT_EVAL_METHOD);
|
||||
|
||||
/* And decfloat.h needs this. */
|
||||
builtin_define_with_int_value ("__DEC_EVAL_METHOD__",
|
||||
TARGET_DEC_EVAL_METHOD);
|
||||
|
||||
builtin_define_float_constants ("FLT", "F", "%s", float_type_node);
|
||||
/* Cast the double precision constants when single precision constants are
|
||||
specified. The correct result is computed by the compiler when using
|
||||
macros that include a cast. This has the side-effect of making the value
|
||||
unusable in const expressions. */
|
||||
if (flag_single_precision_constant)
|
||||
builtin_define_float_constants ("DBL", "L", "((double)%s)", double_type_node);
|
||||
else
|
||||
builtin_define_float_constants ("DBL", "", "%s", double_type_node);
|
||||
builtin_define_float_constants ("LDBL", "L", "%s", long_double_type_node);
|
||||
|
||||
/* For decfloat.h. */
|
||||
builtin_define_decimal_float_constants ("DEC32", "DF", dfloat32_type_node);
|
||||
builtin_define_decimal_float_constants ("DEC64", "DD", dfloat64_type_node);
|
||||
builtin_define_decimal_float_constants ("DEC128", "DL", dfloat128_type_node);
|
||||
|
||||
/* For use in assembly language. */
|
||||
builtin_define_with_value ("__REGISTER_PREFIX__", REGISTER_PREFIX, 0);
|
||||
builtin_define_with_value ("__USER_LABEL_PREFIX__", user_label_prefix, 0);
|
||||
|
||||
/* Misc. */
|
||||
builtin_define_with_value ("__VERSION__", version_string, 1);
|
||||
|
||||
if (flag_gnu89_inline)
|
||||
cpp_define (pfile, "__GNUC_GNU_INLINE__");
|
||||
else
|
||||
cpp_define (pfile, "__GNUC_STDC_INLINE__");
|
||||
|
||||
/* Definitions for LP64 model. */
|
||||
if (TYPE_PRECISION (long_integer_type_node) == 64
|
||||
&& POINTER_SIZE == 64
|
||||
&& TYPE_PRECISION (integer_type_node) == 32)
|
||||
{
|
||||
cpp_define (pfile, "_LP64");
|
||||
cpp_define (pfile, "__LP64__");
|
||||
}
|
||||
|
||||
/* Other target-independent built-ins determined by command-line
|
||||
options. */
|
||||
/* APPLE LOCAL begin blocks */
|
||||
/* APPLE LOCAL radar 5868913 */
|
||||
if (flag_blocks)
|
||||
{
|
||||
cpp_define (pfile, "__block=__attribute__((__blocks__(byref)))");
|
||||
cpp_define (pfile, "__BLOCKS__=1");
|
||||
}
|
||||
/* APPLE LOCAL end blocks */
|
||||
if (optimize_size)
|
||||
cpp_define (pfile, "__OPTIMIZE_SIZE__");
|
||||
if (optimize)
|
||||
cpp_define (pfile, "__OPTIMIZE__");
|
||||
|
||||
if (fast_math_flags_set_p ())
|
||||
cpp_define (pfile, "__FAST_MATH__");
|
||||
if (flag_really_no_inline)
|
||||
cpp_define (pfile, "__NO_INLINE__");
|
||||
if (flag_signaling_nans)
|
||||
cpp_define (pfile, "__SUPPORT_SNAN__");
|
||||
if (flag_finite_math_only)
|
||||
cpp_define (pfile, "__FINITE_MATH_ONLY__=1");
|
||||
else
|
||||
cpp_define (pfile, "__FINITE_MATH_ONLY__=0");
|
||||
if (flag_pic)
|
||||
{
|
||||
builtin_define_with_int_value ("__pic__", flag_pic);
|
||||
builtin_define_with_int_value ("__PIC__", flag_pic);
|
||||
}
|
||||
|
||||
if (flag_iso)
|
||||
cpp_define (pfile, "__STRICT_ANSI__");
|
||||
|
||||
if (!flag_signed_char)
|
||||
cpp_define (pfile, "__CHAR_UNSIGNED__");
|
||||
|
||||
if (c_dialect_cxx () && TYPE_UNSIGNED (wchar_type_node))
|
||||
cpp_define (pfile, "__WCHAR_UNSIGNED__");
|
||||
|
||||
/* Make the choice of ObjC runtime visible to source code. */
|
||||
if (c_dialect_objc () && flag_next_runtime)
|
||||
cpp_define (pfile, "__NEXT_RUNTIME__");
|
||||
|
||||
/* Show the availability of some target pragmas. */
|
||||
if (flag_mudflap || targetm.handle_pragma_redefine_extname)
|
||||
cpp_define (pfile, "__PRAGMA_REDEFINE_EXTNAME");
|
||||
|
||||
if (targetm.handle_pragma_extern_prefix)
|
||||
cpp_define (pfile, "__PRAGMA_EXTERN_PREFIX");
|
||||
|
||||
/* Make the choice of the stack protector runtime visible to source code.
|
||||
The macro names and values here were chosen for compatibility with an
|
||||
earlier implementation, i.e. ProPolice. */
|
||||
if (flag_stack_protect == 3)
|
||||
cpp_define (pfile, "__SSP_STRONG__=3");
|
||||
else if (flag_stack_protect == 2)
|
||||
cpp_define (pfile, "__SSP_ALL__=2");
|
||||
else if (flag_stack_protect == 1)
|
||||
cpp_define (pfile, "__SSP__=1");
|
||||
|
||||
if (flag_openmp)
|
||||
cpp_define (pfile, "_OPENMP=200505");
|
||||
|
||||
/* A straightforward target hook doesn't work, because of problems
|
||||
linking that hook's body when part of non-C front ends. */
|
||||
# define preprocessing_asm_p() (cpp_get_options (pfile)->lang == CLK_ASM)
|
||||
# define preprocessing_trad_p() (cpp_get_options (pfile)->traditional)
|
||||
# define builtin_define(TXT) cpp_define (pfile, TXT)
|
||||
# define builtin_assert(TXT) cpp_assert (pfile, TXT)
|
||||
TARGET_CPU_CPP_BUILTINS ();
|
||||
TARGET_OS_CPP_BUILTINS ();
|
||||
TARGET_OBJFMT_CPP_BUILTINS ();
|
||||
|
||||
/* Support the __declspec keyword by turning them into attributes.
|
||||
Note that the current way we do this may result in a collision
|
||||
with predefined attributes later on. This can be solved by using
|
||||
one attribute, say __declspec__, and passing args to it. The
|
||||
problem with that approach is that args are not accumulated: each
|
||||
new appearance would clobber any existing args. */
|
||||
if (TARGET_DECLSPEC)
|
||||
builtin_define ("__declspec(x)=__attribute__((x))");
|
||||
}
|
||||
|
||||
/* Pass an object-like macro. If it doesn't lie in the user's
|
||||
namespace, defines it unconditionally. Otherwise define a version
|
||||
with two leading underscores, and another version with two leading
|
||||
and trailing underscores, and define the original only if an ISO
|
||||
standard was not nominated.
|
||||
|
||||
e.g. passing "unix" defines "__unix", "__unix__" and possibly
|
||||
"unix". Passing "_mips" defines "__mips", "__mips__" and possibly
|
||||
"_mips". */
|
||||
void
|
||||
builtin_define_std (const char *macro)
|
||||
{
|
||||
size_t len = strlen (macro);
|
||||
char *buff = (char *) alloca (len + 5);
|
||||
char *p = buff + 2;
|
||||
char *q = p + len;
|
||||
|
||||
/* prepend __ (or maybe just _) if in user's namespace. */
|
||||
memcpy (p, macro, len + 1);
|
||||
if (!( *p == '_' && (p[1] == '_' || ISUPPER (p[1]))))
|
||||
{
|
||||
if (*p != '_')
|
||||
*--p = '_';
|
||||
if (p[1] != '_')
|
||||
*--p = '_';
|
||||
}
|
||||
cpp_define (parse_in, p);
|
||||
|
||||
/* If it was in user's namespace... */
|
||||
if (p != buff + 2)
|
||||
{
|
||||
/* Define the macro with leading and following __. */
|
||||
if (q[-1] != '_')
|
||||
*q++ = '_';
|
||||
if (q[-2] != '_')
|
||||
*q++ = '_';
|
||||
*q = '\0';
|
||||
cpp_define (parse_in, p);
|
||||
|
||||
/* Finally, define the original macro if permitted. */
|
||||
if (!flag_iso)
|
||||
cpp_define (parse_in, macro);
|
||||
}
|
||||
}
|
||||
|
||||
/* Pass an object-like macro and a value to define it to. The third
|
||||
parameter says whether or not to turn the value into a string
|
||||
constant. */
|
||||
void
|
||||
builtin_define_with_value (const char *macro, const char *expansion, int is_str)
|
||||
{
|
||||
char *buf;
|
||||
size_t mlen = strlen (macro);
|
||||
size_t elen = strlen (expansion);
|
||||
size_t extra = 2; /* space for an = and a NUL */
|
||||
|
||||
if (is_str)
|
||||
extra += 2; /* space for two quote marks */
|
||||
|
||||
buf = (char *) alloca (mlen + elen + extra);
|
||||
if (is_str)
|
||||
sprintf (buf, "%s=\"%s\"", macro, expansion);
|
||||
else
|
||||
sprintf (buf, "%s=%s", macro, expansion);
|
||||
|
||||
cpp_define (parse_in, buf);
|
||||
}
|
||||
|
||||
/* Pass an object-like macro and a value to define it to. The third
|
||||
parameter is the length of the expansion. */
|
||||
static void
|
||||
builtin_define_with_value_n (const char *macro, const char *expansion, size_t elen)
|
||||
{
|
||||
char *buf;
|
||||
size_t mlen = strlen (macro);
|
||||
|
||||
/* Space for an = and a NUL. */
|
||||
buf = (char *) alloca (mlen + elen + 2);
|
||||
memcpy (buf, macro, mlen);
|
||||
buf[mlen] = '=';
|
||||
memcpy (buf + mlen + 1, expansion, elen);
|
||||
buf[mlen + elen + 1] = '\0';
|
||||
|
||||
cpp_define (parse_in, buf);
|
||||
}
|
||||
|
||||
/* Pass an object-like macro and an integer value to define it to. */
|
||||
static void
|
||||
builtin_define_with_int_value (const char *macro, HOST_WIDE_INT value)
|
||||
{
|
||||
char *buf;
|
||||
size_t mlen = strlen (macro);
|
||||
size_t vlen = 18;
|
||||
size_t extra = 2; /* space for = and NUL. */
|
||||
|
||||
buf = (char *) alloca (mlen + vlen + extra);
|
||||
memcpy (buf, macro, mlen);
|
||||
buf[mlen] = '=';
|
||||
sprintf (buf + mlen + 1, HOST_WIDE_INT_PRINT_DEC, value);
|
||||
|
||||
cpp_define (parse_in, buf);
|
||||
}
|
||||
|
||||
/* Pass an object-like macro a hexadecimal floating-point value. */
|
||||
static void
|
||||
builtin_define_with_hex_fp_value (const char *macro,
|
||||
tree type ATTRIBUTE_UNUSED, int digits,
|
||||
const char *hex_str,
|
||||
const char *fp_suffix,
|
||||
const char *fp_cast)
|
||||
{
|
||||
REAL_VALUE_TYPE real;
|
||||
char dec_str[64], buf1[256], buf2[256];
|
||||
|
||||
/* Hex values are really cool and convenient, except that they're
|
||||
not supported in strict ISO C90 mode. First, the "p-" sequence
|
||||
is not valid as part of a preprocessor number. Second, we get a
|
||||
pedwarn from the preprocessor, which has no context, so we can't
|
||||
suppress the warning with __extension__.
|
||||
|
||||
So instead what we do is construct the number in hex (because
|
||||
it's easy to get the exact correct value), parse it as a real,
|
||||
then print it back out as decimal. */
|
||||
|
||||
real_from_string (&real, hex_str);
|
||||
real_to_decimal (dec_str, &real, sizeof (dec_str), digits, 0);
|
||||
|
||||
/* Assemble the macro in the following fashion
|
||||
macro = fp_cast [dec_str fp_suffix] */
|
||||
sprintf (buf1, "%s%s", dec_str, fp_suffix);
|
||||
sprintf (buf2, fp_cast, buf1);
|
||||
sprintf (buf1, "%s=%s", macro, buf2);
|
||||
|
||||
cpp_define (parse_in, buf1);
|
||||
}
|
||||
|
||||
/* Define MAX for TYPE based on the precision of the type. IS_LONG is
|
||||
1 for type "long" and 2 for "long long". We have to handle
|
||||
unsigned types, since wchar_t might be unsigned. */
|
||||
|
||||
static void
|
||||
builtin_define_type_max (const char *macro, tree type, int is_long)
|
||||
{
|
||||
static const char *const values[]
|
||||
= { "127", "255",
|
||||
"32767", "65535",
|
||||
"2147483647", "4294967295",
|
||||
"9223372036854775807", "18446744073709551615",
|
||||
"170141183460469231731687303715884105727",
|
||||
"340282366920938463463374607431768211455" };
|
||||
static const char *const suffixes[] = { "", "U", "L", "UL", "LL", "ULL" };
|
||||
|
||||
const char *value, *suffix;
|
||||
char *buf;
|
||||
size_t idx;
|
||||
|
||||
/* Pre-rendering the values mean we don't have to futz with printing a
|
||||
multi-word decimal value. There are also a very limited number of
|
||||
precisions that we support, so it's really a waste of time. */
|
||||
switch (TYPE_PRECISION (type))
|
||||
{
|
||||
case 8: idx = 0; break;
|
||||
case 16: idx = 2; break;
|
||||
case 32: idx = 4; break;
|
||||
case 64: idx = 6; break;
|
||||
case 128: idx = 8; break;
|
||||
default: gcc_unreachable ();
|
||||
}
|
||||
|
||||
value = values[idx + TYPE_UNSIGNED (type)];
|
||||
suffix = suffixes[is_long * 2 + TYPE_UNSIGNED (type)];
|
||||
|
||||
buf = (char *) alloca (strlen (macro) + 1 + strlen (value)
|
||||
+ strlen (suffix) + 1);
|
||||
sprintf (buf, "%s=%s%s", macro, value, suffix);
|
||||
|
||||
cpp_define (parse_in, buf);
|
||||
}
|
9138
contrib/gcc/c-decl.c
9138
contrib/gcc/c-decl.c
File diff suppressed because it is too large
Load Diff
@ -1,62 +0,0 @@
|
||||
/* Tree-dumping functionality for C-family languages.
|
||||
Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
|
||||
Written by Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "tree.h"
|
||||
#include "c-tree.h"
|
||||
#include "tree-dump.h"
|
||||
|
||||
/* Dump information common to statements from STMT. */
|
||||
|
||||
void
|
||||
dump_stmt (dump_info_p di, tree t)
|
||||
{
|
||||
if (EXPR_HAS_LOCATION (t))
|
||||
dump_int (di, "line", EXPR_LINENO (t));
|
||||
}
|
||||
|
||||
/* Dump any C-specific tree codes and attributes of common codes. */
|
||||
|
||||
bool
|
||||
c_dump_tree (void *dump_info, tree t)
|
||||
{
|
||||
enum tree_code code;
|
||||
dump_info_p di = (dump_info_p) dump_info;
|
||||
|
||||
/* Figure out what kind of node this is. */
|
||||
code = TREE_CODE (t);
|
||||
|
||||
switch (code)
|
||||
{
|
||||
case FIELD_DECL:
|
||||
if (DECL_C_BIT_FIELD (t))
|
||||
dump_string (di, "bitfield");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
@ -1,63 +0,0 @@
|
||||
/* Various diagnostic subroutines for the GNU C language.
|
||||
Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
|
||||
Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "tree.h"
|
||||
#include "c-tree.h"
|
||||
#include "tm_p.h"
|
||||
#include "flags.h"
|
||||
#include "diagnostic.h"
|
||||
|
||||
/* Issue an ISO C99 pedantic warning MSGID. */
|
||||
|
||||
void
|
||||
pedwarn_c99 (const char *gmsgid, ...)
|
||||
{
|
||||
diagnostic_info diagnostic;
|
||||
va_list ap;
|
||||
|
||||
va_start (ap, gmsgid);
|
||||
diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
|
||||
flag_isoc99 ? pedantic_error_kind () : DK_WARNING);
|
||||
report_diagnostic (&diagnostic);
|
||||
va_end (ap);
|
||||
}
|
||||
|
||||
/* Issue an ISO C90 pedantic warning MSGID. This function is supposed to
|
||||
be used for matters that are allowed in ISO C99 but not supported in
|
||||
ISO C90, thus we explicitly don't pedwarn when C99 is specified.
|
||||
(There is no flag_c90.) */
|
||||
|
||||
void
|
||||
pedwarn_c90 (const char *gmsgid, ...)
|
||||
{
|
||||
diagnostic_info diagnostic;
|
||||
va_list ap;
|
||||
|
||||
va_start (ap, gmsgid);
|
||||
diagnostic_set_info (&diagnostic, gmsgid, &ap, input_location,
|
||||
flag_isoc99 ? DK_WARNING : pedantic_error_kind ());
|
||||
report_diagnostic (&diagnostic);
|
||||
va_end (ap);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,309 +0,0 @@
|
||||
/* Check calls to formatted I/O functions (-Wformat).
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||
2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifndef GCC_C_FORMAT_H
|
||||
#define GCC_C_FORMAT_H
|
||||
|
||||
/* The meaningfully distinct length modifiers for format checking recognized
|
||||
by GCC. */
|
||||
enum format_lengths
|
||||
{
|
||||
FMT_LEN_none,
|
||||
FMT_LEN_hh,
|
||||
FMT_LEN_h,
|
||||
FMT_LEN_l,
|
||||
FMT_LEN_ll,
|
||||
FMT_LEN_L,
|
||||
FMT_LEN_z,
|
||||
FMT_LEN_t,
|
||||
FMT_LEN_j,
|
||||
FMT_LEN_H,
|
||||
FMT_LEN_D,
|
||||
FMT_LEN_DD,
|
||||
FMT_LEN_MAX
|
||||
};
|
||||
|
||||
|
||||
/* The standard versions in which various format features appeared. */
|
||||
enum format_std_version
|
||||
{
|
||||
STD_C89,
|
||||
STD_C94,
|
||||
STD_C9L, /* C99, but treat as C89 if -Wno-long-long. */
|
||||
STD_C99,
|
||||
STD_EXT
|
||||
};
|
||||
|
||||
/* Flags that may apply to a particular kind of format checked by GCC. */
|
||||
enum
|
||||
{
|
||||
/* This format converts arguments of types determined by the
|
||||
format string. */
|
||||
FMT_FLAG_ARG_CONVERT = 1,
|
||||
/* The scanf allocation 'a' kludge applies to this format kind. */
|
||||
FMT_FLAG_SCANF_A_KLUDGE = 2,
|
||||
/* A % during parsing a specifier is allowed to be a modified % rather
|
||||
that indicating the format is broken and we are out-of-sync. */
|
||||
FMT_FLAG_FANCY_PERCENT_OK = 4,
|
||||
/* With $ operand numbers, it is OK to reference the same argument more
|
||||
than once. */
|
||||
FMT_FLAG_DOLLAR_MULTIPLE = 8,
|
||||
/* This format type uses $ operand numbers (strfmon doesn't). */
|
||||
FMT_FLAG_USE_DOLLAR = 16,
|
||||
/* Zero width is bad in this type of format (scanf). */
|
||||
FMT_FLAG_ZERO_WIDTH_BAD = 32,
|
||||
/* Empty precision specification is OK in this type of format (printf). */
|
||||
FMT_FLAG_EMPTY_PREC_OK = 64,
|
||||
/* Gaps are allowed in the arguments with $ operand numbers if all
|
||||
arguments are pointers (scanf). */
|
||||
FMT_FLAG_DOLLAR_GAP_POINTER_OK = 128,
|
||||
/* Not included here: details of whether width or precision may occur
|
||||
(controlled by width_char and precision_char); details of whether
|
||||
'*' can be used for these (width_type and precision_type); details
|
||||
of whether length modifiers can occur (length_char_specs). */
|
||||
FMT_FLAG_NULL_FORMAT_OK = 256
|
||||
};
|
||||
|
||||
|
||||
/* Structure describing a length modifier supported in format checking, and
|
||||
possibly a doubled version such as "hh". */
|
||||
typedef struct
|
||||
{
|
||||
/* Name of the single-character length modifier. */
|
||||
const char *name;
|
||||
/* Index into a format_char_info.types array. */
|
||||
enum format_lengths index;
|
||||
/* Standard version this length appears in. */
|
||||
enum format_std_version std;
|
||||
/* Same, if the modifier can be repeated, or NULL if it can't. */
|
||||
const char *double_name;
|
||||
enum format_lengths double_index;
|
||||
enum format_std_version double_std;
|
||||
} format_length_info;
|
||||
|
||||
|
||||
/* Structure describing the combination of a conversion specifier
|
||||
(or a set of specifiers which act identically) and a length modifier. */
|
||||
typedef struct
|
||||
{
|
||||
/* The standard version this combination of length and type appeared in.
|
||||
This is only relevant if greater than those for length and type
|
||||
individually; otherwise it is ignored. */
|
||||
enum format_std_version std;
|
||||
/* The name to use for the type, if different from that generated internally
|
||||
(e.g., "signed size_t"). */
|
||||
const char *name;
|
||||
/* The type itself. */
|
||||
tree *type;
|
||||
} format_type_detail;
|
||||
|
||||
|
||||
/* Macros to fill out tables of these. */
|
||||
#define NOARGUMENTS { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }
|
||||
#define BADLEN { 0, NULL, NULL }
|
||||
#define NOLENGTHS { BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }
|
||||
|
||||
|
||||
/* Structure describing a format conversion specifier (or a set of specifiers
|
||||
which act identically), and the length modifiers used with it. */
|
||||
typedef struct format_char_info
|
||||
{
|
||||
const char *format_chars;
|
||||
int pointer_count;
|
||||
enum format_std_version std;
|
||||
/* Types accepted for each length modifier. */
|
||||
format_type_detail types[FMT_LEN_MAX];
|
||||
/* List of other modifier characters allowed with these specifiers.
|
||||
This lists flags, and additionally "w" for width, "p" for precision
|
||||
(right precision, for strfmon), "#" for left precision (strfmon),
|
||||
"a" for scanf "a" allocation extension (not applicable in C99 mode),
|
||||
"*" for scanf suppression, and "E" and "O" for those strftime
|
||||
modifiers. */
|
||||
const char *flag_chars;
|
||||
/* List of additional flags describing these conversion specifiers.
|
||||
"c" for generic character pointers being allowed, "2" for strftime
|
||||
two digit year formats, "3" for strftime formats giving two digit
|
||||
years in some locales, "4" for "2" which becomes "3" with an "E" modifier,
|
||||
"o" if use of strftime "O" is a GNU extension beyond C99,
|
||||
"W" if the argument is a pointer which is dereferenced and written into,
|
||||
"R" if the argument is a pointer which is dereferenced and read from,
|
||||
"i" for printf integer formats where the '0' flag is ignored with
|
||||
precision, and "[" for the starting character of a scanf scanset. */
|
||||
const char *flags2;
|
||||
/* If this format conversion character consumes more than one argument,
|
||||
CHAIN points to information about the next argument. For later
|
||||
arguments, only POINTER_COUNT, TYPES, and the "c", "R", and "W" flags
|
||||
in FLAGS2 are used. */
|
||||
const struct format_char_info *chain;
|
||||
} format_char_info;
|
||||
|
||||
|
||||
/* Structure describing a flag accepted by some kind of format. */
|
||||
typedef struct
|
||||
{
|
||||
/* The flag character in question (0 for end of array). */
|
||||
int flag_char;
|
||||
/* Zero if this entry describes the flag character in general, or a
|
||||
nonzero character that may be found in flags2 if it describes the
|
||||
flag when used with certain formats only. If the latter, only
|
||||
the first such entry found that applies to the current conversion
|
||||
specifier is used; the values of 'name' and 'long_name' it supplies
|
||||
will be used, if non-NULL and the standard version is higher than
|
||||
the unpredicated one, for any pedantic warning. For example, 'o'
|
||||
for strftime formats (meaning 'O' is an extension over C99). */
|
||||
int predicate;
|
||||
/* Nonzero if the next character after this flag in the format should
|
||||
be skipped ('=' in strfmon), zero otherwise. */
|
||||
int skip_next_char;
|
||||
/* The name to use for this flag in diagnostic messages. For example,
|
||||
N_("'0' flag"), N_("field width"). */
|
||||
const char *name;
|
||||
/* Long name for this flag in diagnostic messages; currently only used for
|
||||
"ISO C does not support ...". For example, N_("the 'I' printf flag"). */
|
||||
const char *long_name;
|
||||
/* The standard version in which it appeared. */
|
||||
enum format_std_version std;
|
||||
} format_flag_spec;
|
||||
|
||||
|
||||
/* Structure describing a combination of flags that is bad for some kind
|
||||
of format. */
|
||||
typedef struct
|
||||
{
|
||||
/* The first flag character in question (0 for end of array). */
|
||||
int flag_char1;
|
||||
/* The second flag character. */
|
||||
int flag_char2;
|
||||
/* Nonzero if the message should say that the first flag is ignored with
|
||||
the second, zero if the combination should simply be objected to. */
|
||||
int ignored;
|
||||
/* Zero if this entry applies whenever this flag combination occurs,
|
||||
a nonzero character from flags2 if it only applies in some
|
||||
circumstances (e.g. 'i' for printf formats ignoring 0 with precision). */
|
||||
int predicate;
|
||||
} format_flag_pair;
|
||||
|
||||
|
||||
/* Structure describing a particular kind of format processed by GCC. */
|
||||
typedef struct
|
||||
{
|
||||
/* The name of this kind of format, for use in diagnostics. Also
|
||||
the name of the attribute (without preceding and following __). */
|
||||
const char *name;
|
||||
/* Specifications of the length modifiers accepted; possibly NULL. */
|
||||
const format_length_info *length_char_specs;
|
||||
/* Details of the conversion specification characters accepted. */
|
||||
const format_char_info *conversion_specs;
|
||||
/* String listing the flag characters that are accepted. */
|
||||
const char *flag_chars;
|
||||
/* String listing modifier characters (strftime) accepted. May be NULL. */
|
||||
const char *modifier_chars;
|
||||
/* Details of the flag characters, including pseudo-flags. */
|
||||
const format_flag_spec *flag_specs;
|
||||
/* Details of bad combinations of flags. */
|
||||
const format_flag_pair *bad_flag_pairs;
|
||||
/* Flags applicable to this kind of format. */
|
||||
int flags;
|
||||
/* Flag character to treat a width as, or 0 if width not used. */
|
||||
int width_char;
|
||||
/* Flag character to treat a left precision (strfmon) as,
|
||||
or 0 if left precision not used. */
|
||||
int left_precision_char;
|
||||
/* Flag character to treat a precision (for strfmon, right precision) as,
|
||||
or 0 if precision not used. */
|
||||
int precision_char;
|
||||
/* If a flag character has the effect of suppressing the conversion of
|
||||
an argument ('*' in scanf), that flag character, otherwise 0. */
|
||||
int suppression_char;
|
||||
/* Flag character to treat a length modifier as (ignored if length
|
||||
modifiers not used). Need not be placed in flag_chars for conversion
|
||||
specifiers, but is used to check for bad combinations such as length
|
||||
modifier with assignment suppression in scanf. */
|
||||
int length_code_char;
|
||||
/* Pointer to type of argument expected if '*' is used for a width,
|
||||
or NULL if '*' not used for widths. */
|
||||
tree *width_type;
|
||||
/* Pointer to type of argument expected if '*' is used for a precision,
|
||||
or NULL if '*' not used for precisions. */
|
||||
tree *precision_type;
|
||||
} format_kind_info;
|
||||
|
||||
#define T_I &integer_type_node
|
||||
#define T89_I { STD_C89, NULL, T_I }
|
||||
#define T_L &long_integer_type_node
|
||||
#define T89_L { STD_C89, NULL, T_L }
|
||||
#define T_LL &long_long_integer_type_node
|
||||
#define T9L_LL { STD_C9L, NULL, T_LL }
|
||||
#define TEX_LL { STD_EXT, NULL, T_LL }
|
||||
#define T_S &short_integer_type_node
|
||||
#define T89_S { STD_C89, NULL, T_S }
|
||||
#define T_UI &unsigned_type_node
|
||||
#define T89_UI { STD_C89, NULL, T_UI }
|
||||
#define T_UL &long_unsigned_type_node
|
||||
#define T89_UL { STD_C89, NULL, T_UL }
|
||||
#define T_ULL &long_long_unsigned_type_node
|
||||
#define T9L_ULL { STD_C9L, NULL, T_ULL }
|
||||
#define TEX_ULL { STD_EXT, NULL, T_ULL }
|
||||
#define T_US &short_unsigned_type_node
|
||||
#define T89_US { STD_C89, NULL, T_US }
|
||||
#define T_F &float_type_node
|
||||
#define T89_F { STD_C89, NULL, T_F }
|
||||
#define T99_F { STD_C99, NULL, T_F }
|
||||
#define T_D &double_type_node
|
||||
#define T89_D { STD_C89, NULL, T_D }
|
||||
#define T99_D { STD_C99, NULL, T_D }
|
||||
#define T_LD &long_double_type_node
|
||||
#define T89_LD { STD_C89, NULL, T_LD }
|
||||
#define T99_LD { STD_C99, NULL, T_LD }
|
||||
#define T_C &char_type_node
|
||||
#define T89_C { STD_C89, NULL, T_C }
|
||||
#define T_SC &signed_char_type_node
|
||||
#define T99_SC { STD_C99, NULL, T_SC }
|
||||
#define T_UC &unsigned_char_type_node
|
||||
#define T99_UC { STD_C99, NULL, T_UC }
|
||||
#define T_V &void_type_node
|
||||
#define T89_V { STD_C89, NULL, T_V }
|
||||
#define T_W &wchar_type_node
|
||||
#define T94_W { STD_C94, "wchar_t", T_W }
|
||||
#define TEX_W { STD_EXT, "wchar_t", T_W }
|
||||
#define T_WI &wint_type_node
|
||||
#define T94_WI { STD_C94, "wint_t", T_WI }
|
||||
#define TEX_WI { STD_EXT, "wint_t", T_WI }
|
||||
#define T_ST &size_type_node
|
||||
#define T99_ST { STD_C99, "size_t", T_ST }
|
||||
#define T_SST &signed_size_type_node
|
||||
#define T99_SST { STD_C99, "signed size_t", T_SST }
|
||||
#define T_PD &ptrdiff_type_node
|
||||
#define T99_PD { STD_C99, "ptrdiff_t", T_PD }
|
||||
#define T_UPD &unsigned_ptrdiff_type_node
|
||||
#define T99_UPD { STD_C99, "unsigned ptrdiff_t", T_UPD }
|
||||
#define T_IM &intmax_type_node
|
||||
#define T99_IM { STD_C99, "intmax_t", T_IM }
|
||||
#define T_UIM &uintmax_type_node
|
||||
#define T99_UIM { STD_C99, "uintmax_t", T_UIM }
|
||||
#define T_D32 &dfloat32_type_node
|
||||
#define TEX_D32 { STD_EXT, "_Decimal32", T_D32 }
|
||||
#define T_D64 &dfloat64_type_node
|
||||
#define TEX_D64 { STD_EXT, "_Decimal64", T_D64 }
|
||||
#define T_D128 &dfloat128_type_node
|
||||
#define TEX_D128 { STD_EXT, "_Decimal128", T_D128 }
|
||||
|
||||
#endif /* GCC_C_FORMAT_H */
|
@ -1,226 +0,0 @@
|
||||
/* Tree lowering pass. This pass gimplifies the tree representation built
|
||||
by the C-based front ends. The structure of gimplified, or
|
||||
language-independent, trees is dictated by the grammar described in this
|
||||
file.
|
||||
Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Lowering of expressions contributed by Sebastian Pop <s.pop@laposte.net>
|
||||
Re-written to support lowering of whole function trees, documentation
|
||||
and miscellaneous cleanups by Diego Novillo <dnovillo@redhat.com>
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "tree.h"
|
||||
#include "varray.h"
|
||||
#include "c-tree.h"
|
||||
#include "c-common.h"
|
||||
#include "tree-gimple.h"
|
||||
#include "hard-reg-set.h"
|
||||
#include "basic-block.h"
|
||||
#include "tree-flow.h"
|
||||
#include "tree-inline.h"
|
||||
#include "diagnostic.h"
|
||||
#include "langhooks.h"
|
||||
#include "langhooks-def.h"
|
||||
#include "flags.h"
|
||||
#include "rtl.h"
|
||||
#include "toplev.h"
|
||||
#include "tree-dump.h"
|
||||
#include "c-pretty-print.h"
|
||||
#include "cgraph.h"
|
||||
|
||||
|
||||
/* The gimplification pass converts the language-dependent trees
|
||||
(ld-trees) emitted by the parser into language-independent trees
|
||||
(li-trees) that are the target of SSA analysis and transformations.
|
||||
|
||||
Language-independent trees are based on the SIMPLE intermediate
|
||||
representation used in the McCAT compiler framework:
|
||||
|
||||
"Designing the McCAT Compiler Based on a Family of Structured
|
||||
Intermediate Representations,"
|
||||
L. Hendren, C. Donawa, M. Emami, G. Gao, Justiani, and B. Sridharan,
|
||||
Proceedings of the 5th International Workshop on Languages and
|
||||
Compilers for Parallel Computing, no. 757 in Lecture Notes in
|
||||
Computer Science, New Haven, Connecticut, pp. 406-420,
|
||||
Springer-Verlag, August 3-5, 1992.
|
||||
|
||||
http://www-acaps.cs.mcgill.ca/info/McCAT/McCAT.html
|
||||
|
||||
Basically, we walk down gimplifying the nodes that we encounter. As we
|
||||
walk back up, we check that they fit our constraints, and copy them
|
||||
into temporaries if not. */
|
||||
|
||||
/* Gimplification of statement trees. */
|
||||
|
||||
/* Convert the tree representation of FNDECL from C frontend trees to
|
||||
GENERIC. */
|
||||
|
||||
void
|
||||
c_genericize (tree fndecl)
|
||||
{
|
||||
FILE *dump_orig;
|
||||
int local_dump_flags;
|
||||
struct cgraph_node *cgn;
|
||||
|
||||
/* Dump the C-specific tree IR. */
|
||||
dump_orig = dump_begin (TDI_original, &local_dump_flags);
|
||||
if (dump_orig)
|
||||
{
|
||||
fprintf (dump_orig, "\n;; Function %s",
|
||||
lang_hooks.decl_printable_name (fndecl, 2));
|
||||
fprintf (dump_orig, " (%s)\n",
|
||||
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fndecl)));
|
||||
fprintf (dump_orig, ";; enabled by -%s\n", dump_flag_name (TDI_original));
|
||||
fprintf (dump_orig, "\n");
|
||||
|
||||
if (local_dump_flags & TDF_RAW)
|
||||
dump_node (DECL_SAVED_TREE (fndecl),
|
||||
TDF_SLIM | local_dump_flags, dump_orig);
|
||||
else
|
||||
print_c_tree (dump_orig, DECL_SAVED_TREE (fndecl));
|
||||
fprintf (dump_orig, "\n");
|
||||
|
||||
dump_end (TDI_original, dump_orig);
|
||||
}
|
||||
|
||||
/* Go ahead and gimplify for now. */
|
||||
gimplify_function_tree (fndecl);
|
||||
|
||||
/* Dump the genericized tree IR. */
|
||||
dump_function (TDI_generic, fndecl);
|
||||
|
||||
/* Genericize all nested functions now. We do things in this order so
|
||||
that items like VLA sizes are expanded properly in the context of
|
||||
the correct function. */
|
||||
cgn = cgraph_node (fndecl);
|
||||
for (cgn = cgn->nested; cgn ; cgn = cgn->next_nested)
|
||||
c_genericize (cgn->decl);
|
||||
}
|
||||
|
||||
static void
|
||||
add_block_to_enclosing (tree block)
|
||||
{
|
||||
tree enclosing;
|
||||
|
||||
for (enclosing = gimple_current_bind_expr ();
|
||||
enclosing; enclosing = TREE_CHAIN (enclosing))
|
||||
if (BIND_EXPR_BLOCK (enclosing))
|
||||
break;
|
||||
|
||||
enclosing = BIND_EXPR_BLOCK (enclosing);
|
||||
BLOCK_SUBBLOCKS (enclosing) = chainon (BLOCK_SUBBLOCKS (enclosing), block);
|
||||
}
|
||||
|
||||
/* Genericize a scope by creating a new BIND_EXPR.
|
||||
BLOCK is either a BLOCK representing the scope or a chain of _DECLs.
|
||||
In the latter case, we need to create a new BLOCK and add it to the
|
||||
BLOCK_SUBBLOCKS of the enclosing block.
|
||||
BODY is a chain of C _STMT nodes for the contents of the scope, to be
|
||||
genericized. */
|
||||
|
||||
tree
|
||||
c_build_bind_expr (tree block, tree body)
|
||||
{
|
||||
tree decls, bind;
|
||||
|
||||
if (block == NULL_TREE)
|
||||
decls = NULL_TREE;
|
||||
else if (TREE_CODE (block) == BLOCK)
|
||||
decls = BLOCK_VARS (block);
|
||||
else
|
||||
{
|
||||
decls = block;
|
||||
if (DECL_ARTIFICIAL (decls))
|
||||
block = NULL_TREE;
|
||||
else
|
||||
{
|
||||
block = make_node (BLOCK);
|
||||
BLOCK_VARS (block) = decls;
|
||||
add_block_to_enclosing (block);
|
||||
}
|
||||
}
|
||||
|
||||
if (!body)
|
||||
body = build_empty_stmt ();
|
||||
if (decls || block)
|
||||
{
|
||||
bind = build3 (BIND_EXPR, void_type_node, decls, body, block);
|
||||
TREE_SIDE_EFFECTS (bind) = 1;
|
||||
}
|
||||
else
|
||||
bind = body;
|
||||
|
||||
return bind;
|
||||
}
|
||||
|
||||
/* Gimplification of expression trees. */
|
||||
|
||||
/* Gimplify a C99 compound literal expression. This just means adding
|
||||
the DECL_EXPR before the current statement and using its anonymous
|
||||
decl instead. */
|
||||
|
||||
static enum gimplify_status
|
||||
gimplify_compound_literal_expr (tree *expr_p, tree *pre_p)
|
||||
{
|
||||
tree decl_s = COMPOUND_LITERAL_EXPR_DECL_STMT (*expr_p);
|
||||
tree decl = DECL_EXPR_DECL (decl_s);
|
||||
|
||||
/* This decl isn't mentioned in the enclosing block, so add it to the
|
||||
list of temps. FIXME it seems a bit of a kludge to say that
|
||||
anonymous artificial vars aren't pushed, but everything else is. */
|
||||
if (DECL_NAME (decl) == NULL_TREE && !DECL_SEEN_IN_BIND_EXPR_P (decl))
|
||||
gimple_add_tmp_var (decl);
|
||||
|
||||
gimplify_and_add (decl_s, pre_p);
|
||||
*expr_p = decl;
|
||||
return GS_OK;
|
||||
}
|
||||
|
||||
/* Do C-specific gimplification. Args are as for gimplify_expr. */
|
||||
|
||||
int
|
||||
c_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p ATTRIBUTE_UNUSED)
|
||||
{
|
||||
enum tree_code code = TREE_CODE (*expr_p);
|
||||
|
||||
switch (code)
|
||||
{
|
||||
case DECL_EXPR:
|
||||
/* This is handled mostly by gimplify.c, but we have to deal with
|
||||
not warning about int x = x; as it is a GCC extension to turn off
|
||||
this warning but only if warn_init_self is zero. */
|
||||
if (TREE_CODE (DECL_EXPR_DECL (*expr_p)) == VAR_DECL
|
||||
&& !DECL_EXTERNAL (DECL_EXPR_DECL (*expr_p))
|
||||
&& !TREE_STATIC (DECL_EXPR_DECL (*expr_p))
|
||||
&& (DECL_INITIAL (DECL_EXPR_DECL (*expr_p))
|
||||
== DECL_EXPR_DECL (*expr_p))
|
||||
&& !warn_init_self)
|
||||
TREE_NO_WARNING (DECL_EXPR_DECL (*expr_p)) = 1;
|
||||
return GS_UNHANDLED;
|
||||
|
||||
case COMPOUND_LITERAL_EXPR:
|
||||
return gimplify_compound_literal_expr (expr_p, pre_p);
|
||||
|
||||
default:
|
||||
return GS_UNHANDLED;
|
||||
}
|
||||
}
|
@ -1,417 +0,0 @@
|
||||
/* Set up combined include path chain for the preprocessor.
|
||||
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
||||
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
Broken out of cppinit.c and cppfiles.c and rewritten Mar 2003.
|
||||
|
||||
This program 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 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program 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 this program; if not, write to the Free Software
|
||||
Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "machmode.h"
|
||||
#include "target.h"
|
||||
#include "tm.h"
|
||||
#include "cpplib.h"
|
||||
#include "prefix.h"
|
||||
#include "intl.h"
|
||||
#include "c-incpath.h"
|
||||
#include "cppdefault.h"
|
||||
|
||||
/* Windows does not natively support inodes, and neither does MSDOS.
|
||||
Cygwin's emulation can generate non-unique inodes, so don't use it.
|
||||
VMS has non-numeric inodes. */
|
||||
#ifdef VMS
|
||||
# define INO_T_EQ(A, B) (!memcmp (&(A), &(B), sizeof (A)))
|
||||
# define INO_T_COPY(DEST, SRC) memcpy(&(DEST), &(SRC), sizeof (SRC))
|
||||
#else
|
||||
# if (defined _WIN32 && !defined (_UWIN)) || defined __MSDOS__
|
||||
# define INO_T_EQ(A, B) 0
|
||||
# else
|
||||
# define INO_T_EQ(A, B) ((A) == (B))
|
||||
# endif
|
||||
# define INO_T_COPY(DEST, SRC) (DEST) = (SRC)
|
||||
#endif
|
||||
|
||||
static const char dir_separator_str[] = { DIR_SEPARATOR, 0 };
|
||||
|
||||
static void add_env_var_paths (const char *, int);
|
||||
static void add_standard_paths (const char *, const char *, const char *, int);
|
||||
static void free_path (struct cpp_dir *, int);
|
||||
static void merge_include_chains (cpp_reader *, int);
|
||||
static struct cpp_dir *remove_duplicates (cpp_reader *, struct cpp_dir *,
|
||||
struct cpp_dir *,
|
||||
struct cpp_dir *, int);
|
||||
|
||||
/* Include chains heads and tails. */
|
||||
static struct cpp_dir *heads[4];
|
||||
static struct cpp_dir *tails[4];
|
||||
static bool quote_ignores_source_dir;
|
||||
enum { REASON_QUIET = 0, REASON_NOENT, REASON_DUP, REASON_DUP_SYS };
|
||||
|
||||
/* Free an element of the include chain, possibly giving a reason. */
|
||||
static void
|
||||
free_path (struct cpp_dir *path, int reason)
|
||||
{
|
||||
switch (reason)
|
||||
{
|
||||
case REASON_DUP:
|
||||
case REASON_DUP_SYS:
|
||||
fprintf (stderr, _("ignoring duplicate directory \"%s\"\n"), path->name);
|
||||
if (reason == REASON_DUP_SYS)
|
||||
fprintf (stderr, "%s",
|
||||
_(" as it is a non-system directory that duplicates a system directory\n"));
|
||||
break;
|
||||
|
||||
case REASON_NOENT:
|
||||
fprintf (stderr, _("ignoring nonexistent directory \"%s\"\n"),
|
||||
path->name);
|
||||
break;
|
||||
|
||||
case REASON_QUIET:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
free (path->name);
|
||||
free (path);
|
||||
}
|
||||
|
||||
/* Read ENV_VAR for a PATH_SEPARATOR-separated list of file names; and
|
||||
append all the names to the search path CHAIN. */
|
||||
static void
|
||||
add_env_var_paths (const char *env_var, int chain)
|
||||
{
|
||||
char *p, *q, *path;
|
||||
|
||||
GET_ENVIRONMENT (q, env_var);
|
||||
|
||||
if (!q)
|
||||
return;
|
||||
|
||||
for (p = q; *q; p = q + 1)
|
||||
{
|
||||
q = p;
|
||||
while (*q != 0 && *q != PATH_SEPARATOR)
|
||||
q++;
|
||||
|
||||
if (p == q)
|
||||
path = xstrdup (".");
|
||||
else
|
||||
{
|
||||
path = XNEWVEC (char, q - p + 1);
|
||||
memcpy (path, p, q - p);
|
||||
path[q - p] = '\0';
|
||||
}
|
||||
|
||||
add_path (path, chain, chain == SYSTEM, false);
|
||||
}
|
||||
}
|
||||
|
||||
/* Append the standard include chain defined in cppdefault.c. */
|
||||
static void
|
||||
add_standard_paths (const char *sysroot, const char *iprefix,
|
||||
const char *imultilib, int cxx_stdinc)
|
||||
{
|
||||
const struct default_include *p;
|
||||
size_t len;
|
||||
|
||||
if (iprefix && (len = cpp_GCC_INCLUDE_DIR_len) != 0)
|
||||
{
|
||||
/* Look for directories that start with the standard prefix.
|
||||
"Translate" them, i.e. replace /usr/local/lib/gcc... with
|
||||
IPREFIX and search them first. */
|
||||
for (p = cpp_include_defaults; p->fname; p++)
|
||||
{
|
||||
if (!p->cplusplus || cxx_stdinc)
|
||||
{
|
||||
/* Should we be translating sysrooted dirs too? Assume
|
||||
that iprefix and sysroot are mutually exclusive, for
|
||||
now. */
|
||||
if (sysroot && p->add_sysroot)
|
||||
continue;
|
||||
if (!strncmp (p->fname, cpp_GCC_INCLUDE_DIR, len))
|
||||
{
|
||||
char *str = concat (iprefix, p->fname + len, NULL);
|
||||
if (p->multilib && imultilib)
|
||||
str = concat (str, dir_separator_str, imultilib, NULL);
|
||||
add_path (str, SYSTEM, p->cxx_aware, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (p = cpp_include_defaults; p->fname; p++)
|
||||
{
|
||||
if (!p->cplusplus || cxx_stdinc)
|
||||
{
|
||||
char *str;
|
||||
|
||||
/* Should this directory start with the sysroot? */
|
||||
if (sysroot && p->add_sysroot)
|
||||
str = concat (sysroot, p->fname, NULL);
|
||||
else
|
||||
str = update_path (p->fname, p->component);
|
||||
|
||||
if (p->multilib && imultilib)
|
||||
str = concat (str, dir_separator_str, imultilib, NULL);
|
||||
|
||||
add_path (str, SYSTEM, p->cxx_aware, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* For each duplicate path in chain HEAD, keep just the first one.
|
||||
Remove each path in chain HEAD that also exists in chain SYSTEM.
|
||||
Set the NEXT pointer of the last path in the resulting chain to
|
||||
JOIN, unless it duplicates JOIN in which case the last path is
|
||||
removed. Return the head of the resulting chain. Any of HEAD,
|
||||
JOIN and SYSTEM can be NULL. */
|
||||
|
||||
static struct cpp_dir *
|
||||
remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
|
||||
struct cpp_dir *system, struct cpp_dir *join,
|
||||
int verbose)
|
||||
{
|
||||
struct cpp_dir **pcur, *tmp, *cur;
|
||||
struct stat st;
|
||||
|
||||
for (pcur = &head; *pcur; )
|
||||
{
|
||||
int reason = REASON_QUIET;
|
||||
|
||||
cur = *pcur;
|
||||
|
||||
if (stat (cur->name, &st))
|
||||
{
|
||||
/* Dirs that don't exist are silently ignored, unless verbose. */
|
||||
if (errno != ENOENT)
|
||||
cpp_errno (pfile, CPP_DL_ERROR, cur->name);
|
||||
else
|
||||
{
|
||||
/* If -Wmissing-include-dirs is given, warn. */
|
||||
cpp_options *opts = cpp_get_options (pfile);
|
||||
if (opts->warn_missing_include_dirs && cur->user_supplied_p)
|
||||
cpp_errno (pfile, CPP_DL_WARNING, cur->name);
|
||||
reason = REASON_NOENT;
|
||||
}
|
||||
}
|
||||
else if (!S_ISDIR (st.st_mode))
|
||||
cpp_error_with_line (pfile, CPP_DL_ERROR, 0, 0,
|
||||
"%s: not a directory", cur->name);
|
||||
else
|
||||
{
|
||||
INO_T_COPY (cur->ino, st.st_ino);
|
||||
cur->dev = st.st_dev;
|
||||
|
||||
/* Remove this one if it is in the system chain. */
|
||||
reason = REASON_DUP_SYS;
|
||||
for (tmp = system; tmp; tmp = tmp->next)
|
||||
if (INO_T_EQ (tmp->ino, cur->ino) && tmp->dev == cur->dev
|
||||
&& cur->construct == tmp->construct)
|
||||
break;
|
||||
|
||||
if (!tmp)
|
||||
{
|
||||
/* Duplicate of something earlier in the same chain? */
|
||||
reason = REASON_DUP;
|
||||
for (tmp = head; tmp != cur; tmp = tmp->next)
|
||||
if (INO_T_EQ (cur->ino, tmp->ino) && cur->dev == tmp->dev
|
||||
&& cur->construct == tmp->construct)
|
||||
break;
|
||||
|
||||
if (tmp == cur
|
||||
/* Last in the chain and duplicate of JOIN? */
|
||||
&& !(cur->next == NULL && join
|
||||
&& INO_T_EQ (cur->ino, join->ino)
|
||||
&& cur->dev == join->dev
|
||||
&& cur->construct == join->construct))
|
||||
{
|
||||
/* Unique, so keep this directory. */
|
||||
pcur = &cur->next;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove this entry from the chain. */
|
||||
*pcur = cur->next;
|
||||
free_path (cur, verbose ? reason: REASON_QUIET);
|
||||
}
|
||||
|
||||
*pcur = join;
|
||||
return head;
|
||||
}
|
||||
|
||||
/* Merge the four include chains together in the order quote, bracket,
|
||||
system, after. Remove duplicate dirs (as determined by
|
||||
INO_T_EQ()).
|
||||
|
||||
We can't just merge the lists and then uniquify them because then
|
||||
we may lose directories from the <> search path that should be
|
||||
there; consider -iquote foo -iquote bar -Ifoo -Iquux. It is
|
||||
however safe to treat -iquote bar -iquote foo -Ifoo -Iquux as if
|
||||
written -iquote bar -Ifoo -Iquux. */
|
||||
|
||||
static void
|
||||
merge_include_chains (cpp_reader *pfile, int verbose)
|
||||
{
|
||||
/* Join the SYSTEM and AFTER chains. Remove duplicates in the
|
||||
resulting SYSTEM chain. */
|
||||
if (heads[SYSTEM])
|
||||
tails[SYSTEM]->next = heads[AFTER];
|
||||
else
|
||||
heads[SYSTEM] = heads[AFTER];
|
||||
heads[SYSTEM] = remove_duplicates (pfile, heads[SYSTEM], 0, 0, verbose);
|
||||
|
||||
/* Remove duplicates from BRACKET that are in itself or SYSTEM, and
|
||||
join it to SYSTEM. */
|
||||
heads[BRACKET] = remove_duplicates (pfile, heads[BRACKET], heads[SYSTEM],
|
||||
heads[SYSTEM], verbose);
|
||||
|
||||
/* Remove duplicates from QUOTE that are in itself or SYSTEM, and
|
||||
join it to BRACKET. */
|
||||
heads[QUOTE] = remove_duplicates (pfile, heads[QUOTE], heads[SYSTEM],
|
||||
heads[BRACKET], verbose);
|
||||
|
||||
/* If verbose, print the list of dirs to search. */
|
||||
if (verbose)
|
||||
{
|
||||
struct cpp_dir *p;
|
||||
|
||||
fprintf (stderr, "%s", _("#include \"...\" search starts here:\n"));
|
||||
for (p = heads[QUOTE];; p = p->next)
|
||||
{
|
||||
if (p == heads[BRACKET])
|
||||
fprintf (stderr, "%s", _("#include <...> search starts here:\n"));
|
||||
if (!p)
|
||||
break;
|
||||
fprintf (stderr, " %s\n", p->name);
|
||||
}
|
||||
fprintf (stderr, "%s", _("End of search list.\n"));
|
||||
}
|
||||
}
|
||||
|
||||
/* Use given -I paths for #include "..." but not #include <...>, and
|
||||
don't search the directory of the present file for #include "...".
|
||||
(Note that -I. -I- is not the same as the default setup; -I. uses
|
||||
the compiler's working dir.) */
|
||||
void
|
||||
split_quote_chain (void)
|
||||
{
|
||||
heads[QUOTE] = heads[BRACKET];
|
||||
tails[QUOTE] = tails[BRACKET];
|
||||
heads[BRACKET] = NULL;
|
||||
tails[BRACKET] = NULL;
|
||||
/* This is NOT redundant. */
|
||||
quote_ignores_source_dir = true;
|
||||
}
|
||||
|
||||
/* Add P to the chain specified by CHAIN. */
|
||||
|
||||
void
|
||||
add_cpp_dir_path (cpp_dir *p, int chain)
|
||||
{
|
||||
if (tails[chain])
|
||||
tails[chain]->next = p;
|
||||
else
|
||||
heads[chain] = p;
|
||||
tails[chain] = p;
|
||||
}
|
||||
|
||||
/* Add PATH to the include chain CHAIN. PATH must be malloc-ed and
|
||||
NUL-terminated. */
|
||||
void
|
||||
add_path (char *path, int chain, int cxx_aware, bool user_supplied_p)
|
||||
{
|
||||
cpp_dir *p;
|
||||
|
||||
#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
|
||||
/* Convert all backslashes to slashes. The native CRT stat()
|
||||
function does not recognize a directory that ends in a backslash
|
||||
(unless it is a drive root dir, such "c:\"). Forward slashes,
|
||||
trailing or otherwise, cause no problems for stat(). */
|
||||
char* c;
|
||||
for (c = path; *c; c++)
|
||||
if (*c == '\\') *c = '/';
|
||||
#endif
|
||||
|
||||
p = XNEW (cpp_dir);
|
||||
p->next = NULL;
|
||||
p->name = path;
|
||||
if (chain == SYSTEM || chain == AFTER)
|
||||
p->sysp = 1 + !cxx_aware;
|
||||
else
|
||||
p->sysp = 0;
|
||||
p->construct = 0;
|
||||
p->user_supplied_p = user_supplied_p;
|
||||
|
||||
add_cpp_dir_path (p, chain);
|
||||
}
|
||||
|
||||
/* Exported function to handle include chain merging, duplicate
|
||||
removal, and registration with cpplib. */
|
||||
void
|
||||
register_include_chains (cpp_reader *pfile, const char *sysroot,
|
||||
const char *iprefix, const char *imultilib,
|
||||
int stdinc, int cxx_stdinc, int verbose)
|
||||
{
|
||||
static const char *const lang_env_vars[] =
|
||||
{ "C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH",
|
||||
"OBJC_INCLUDE_PATH", "OBJCPLUS_INCLUDE_PATH" };
|
||||
cpp_options *cpp_opts = cpp_get_options (pfile);
|
||||
size_t idx = (cpp_opts->objc ? 2: 0);
|
||||
|
||||
if (cpp_opts->cplusplus)
|
||||
idx++;
|
||||
else
|
||||
cxx_stdinc = false;
|
||||
|
||||
/* CPATH and language-dependent environment variables may add to the
|
||||
include chain. */
|
||||
add_env_var_paths ("CPATH", BRACKET);
|
||||
add_env_var_paths (lang_env_vars[idx], SYSTEM);
|
||||
|
||||
target_c_incpath.extra_pre_includes (sysroot, iprefix, stdinc);
|
||||
|
||||
/* Finally chain on the standard directories. */
|
||||
if (stdinc)
|
||||
add_standard_paths (sysroot, iprefix, imultilib, cxx_stdinc);
|
||||
|
||||
target_c_incpath.extra_includes (sysroot, iprefix, stdinc);
|
||||
|
||||
merge_include_chains (pfile, verbose);
|
||||
|
||||
cpp_set_include_chains (pfile, heads[QUOTE], heads[BRACKET],
|
||||
quote_ignores_source_dir);
|
||||
}
|
||||
#if !(defined TARGET_EXTRA_INCLUDES) || !(defined TARGET_EXTRA_PRE_INCLUDES)
|
||||
static void hook_void_charptr_charptr_int (const char *sysroot ATTRIBUTE_UNUSED,
|
||||
const char *iprefix ATTRIBUTE_UNUSED,
|
||||
int stdinc ATTRIBUTE_UNUSED)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef TARGET_EXTRA_INCLUDES
|
||||
#define TARGET_EXTRA_INCLUDES hook_void_charptr_charptr_int
|
||||
#endif
|
||||
#ifndef TARGET_EXTRA_PRE_INCLUDES
|
||||
#define TARGET_EXTRA_PRE_INCLUDES hook_void_charptr_charptr_int
|
||||
#endif
|
||||
|
||||
struct target_c_incpath_s target_c_incpath = { TARGET_EXTRA_PRE_INCLUDES, TARGET_EXTRA_INCLUDES };
|
||||
|
@ -1,33 +0,0 @@
|
||||
/* Set up combined include path for the preprocessor.
|
||||
Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
This program 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 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program 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 this program; if not, write to the Free Software
|
||||
Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
extern void split_quote_chain (void);
|
||||
extern void add_path (char *, int, int, bool);
|
||||
extern void register_include_chains (cpp_reader *, const char *,
|
||||
const char *, const char *,
|
||||
int, int, int);
|
||||
extern void add_cpp_dir_path (struct cpp_dir *, int);
|
||||
|
||||
struct target_c_incpath_s {
|
||||
/* Do extra includes processing. STDINC is false iff -nostdinc was given. */
|
||||
void (*extra_pre_includes) (const char *, const char *, int);
|
||||
void (*extra_includes) (const char *, const char *, int);
|
||||
};
|
||||
|
||||
extern struct target_c_incpath_s target_c_incpath;
|
||||
|
||||
enum { QUOTE = 0, BRACKET, SYSTEM, AFTER };
|
@ -1,93 +0,0 @@
|
||||
/* Language-specific hook definitions for C front end.
|
||||
Copyright (C) 1991, 1995, 1997, 1998,
|
||||
1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "tree.h"
|
||||
#include "c-tree.h"
|
||||
#include "c-common.h"
|
||||
#include "ggc.h"
|
||||
#include "langhooks.h"
|
||||
#include "langhooks-def.h"
|
||||
#include "tree-inline.h"
|
||||
#include "diagnostic.h"
|
||||
#include "c-objc-common.h"
|
||||
#include "c-pragma.h"
|
||||
|
||||
enum c_language_kind c_language = clk_c;
|
||||
|
||||
/* Lang hooks common to C and ObjC are declared in c-objc-common.h;
|
||||
consequently, there should be very few hooks below. */
|
||||
|
||||
#undef LANG_HOOKS_NAME
|
||||
#define LANG_HOOKS_NAME "GNU C"
|
||||
#undef LANG_HOOKS_INIT
|
||||
#define LANG_HOOKS_INIT c_objc_common_init
|
||||
|
||||
/* Each front end provides its own lang hook initializer. */
|
||||
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
|
||||
|
||||
/* Tree code classes. */
|
||||
|
||||
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
|
||||
|
||||
const enum tree_code_class tree_code_type[] = {
|
||||
#include "tree.def"
|
||||
tcc_exceptional,
|
||||
#include "c-common.def"
|
||||
};
|
||||
#undef DEFTREECODE
|
||||
|
||||
/* Table indexed by tree code giving number of expression
|
||||
operands beyond the fixed part of the node structure.
|
||||
Not used for types or decls. */
|
||||
|
||||
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
|
||||
|
||||
const unsigned char tree_code_length[] = {
|
||||
#include "tree.def"
|
||||
0,
|
||||
#include "c-common.def"
|
||||
};
|
||||
#undef DEFTREECODE
|
||||
|
||||
/* Names of tree components.
|
||||
Used for printing out the tree and error messages. */
|
||||
#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
|
||||
|
||||
const char *const tree_code_name[] = {
|
||||
#include "tree.def"
|
||||
"@@dummy",
|
||||
#include "c-common.def"
|
||||
};
|
||||
#undef DEFTREECODE
|
||||
|
||||
/* Final processing of file-scope data. The Objective-C version of
|
||||
this function still does something. */
|
||||
void
|
||||
finish_file (void)
|
||||
{
|
||||
}
|
||||
|
||||
#include "gtype-c.h"
|
@ -1,861 +0,0 @@
|
||||
/* Mainly the interface between cpplib and the C front ends.
|
||||
Copyright (C) 1987, 1988, 1989, 1992, 1994, 1995, 1996, 1997
|
||||
1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
|
||||
#include "real.h"
|
||||
#include "rtl.h"
|
||||
#include "tree.h"
|
||||
#include "input.h"
|
||||
#include "output.h"
|
||||
#include "c-tree.h"
|
||||
#include "c-common.h"
|
||||
#include "flags.h"
|
||||
#include "timevar.h"
|
||||
#include "cpplib.h"
|
||||
#include "c-pragma.h"
|
||||
#include "toplev.h"
|
||||
#include "intl.h"
|
||||
#include "tm_p.h"
|
||||
#include "splay-tree.h"
|
||||
#include "debug.h"
|
||||
|
||||
/* We may keep statistics about how long which files took to compile. */
|
||||
static int header_time, body_time;
|
||||
static splay_tree file_info_tree;
|
||||
|
||||
int pending_lang_change; /* If we need to switch languages - C++ only */
|
||||
int c_header_level; /* depth in C headers - C++ only */
|
||||
|
||||
/* If we need to translate characters received. This is tri-state:
|
||||
0 means use only the untranslated string; 1 means use only
|
||||
the translated string; -1 means chain the translated string
|
||||
to the untranslated one. */
|
||||
int c_lex_string_translate = 1;
|
||||
|
||||
/* True if strings should be passed to the caller of c_lex completely
|
||||
unmolested (no concatenation, no translation). */
|
||||
bool c_lex_return_raw_strings = false;
|
||||
|
||||
static tree interpret_integer (const cpp_token *, unsigned int);
|
||||
static tree interpret_float (const cpp_token *, unsigned int);
|
||||
static enum integer_type_kind narrowest_unsigned_type
|
||||
(unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, unsigned int);
|
||||
static enum integer_type_kind narrowest_signed_type
|
||||
(unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, unsigned int);
|
||||
static enum cpp_ttype lex_string (const cpp_token *, tree *, bool);
|
||||
static tree lex_charconst (const cpp_token *);
|
||||
static void update_header_times (const char *);
|
||||
static int dump_one_header (splay_tree_node, void *);
|
||||
static void cb_line_change (cpp_reader *, const cpp_token *, int);
|
||||
static void cb_ident (cpp_reader *, unsigned int, const cpp_string *);
|
||||
static void cb_def_pragma (cpp_reader *, unsigned int);
|
||||
static void cb_define (cpp_reader *, unsigned int, cpp_hashnode *);
|
||||
static void cb_undef (cpp_reader *, unsigned int, cpp_hashnode *);
|
||||
|
||||
void
|
||||
init_c_lex (void)
|
||||
{
|
||||
struct cpp_callbacks *cb;
|
||||
struct c_fileinfo *toplevel;
|
||||
|
||||
/* The get_fileinfo data structure must be initialized before
|
||||
cpp_read_main_file is called. */
|
||||
toplevel = get_fileinfo ("<top level>");
|
||||
if (flag_detailed_statistics)
|
||||
{
|
||||
header_time = 0;
|
||||
body_time = get_run_time ();
|
||||
toplevel->time = body_time;
|
||||
}
|
||||
|
||||
cb = cpp_get_callbacks (parse_in);
|
||||
|
||||
cb->line_change = cb_line_change;
|
||||
cb->ident = cb_ident;
|
||||
cb->def_pragma = cb_def_pragma;
|
||||
cb->valid_pch = c_common_valid_pch;
|
||||
cb->read_pch = c_common_read_pch;
|
||||
|
||||
/* Set the debug callbacks if we can use them. */
|
||||
if (debug_info_level == DINFO_LEVEL_VERBOSE
|
||||
&& (write_symbols == DWARF2_DEBUG
|
||||
|| write_symbols == VMS_AND_DWARF2_DEBUG))
|
||||
{
|
||||
cb->define = cb_define;
|
||||
cb->undef = cb_undef;
|
||||
}
|
||||
}
|
||||
|
||||
struct c_fileinfo *
|
||||
get_fileinfo (const char *name)
|
||||
{
|
||||
splay_tree_node n;
|
||||
struct c_fileinfo *fi;
|
||||
|
||||
if (!file_info_tree)
|
||||
file_info_tree = splay_tree_new ((splay_tree_compare_fn) strcmp,
|
||||
0,
|
||||
(splay_tree_delete_value_fn) free);
|
||||
|
||||
n = splay_tree_lookup (file_info_tree, (splay_tree_key) name);
|
||||
if (n)
|
||||
return (struct c_fileinfo *) n->value;
|
||||
|
||||
fi = XNEW (struct c_fileinfo);
|
||||
fi->time = 0;
|
||||
fi->interface_only = 0;
|
||||
fi->interface_unknown = 1;
|
||||
splay_tree_insert (file_info_tree, (splay_tree_key) name,
|
||||
(splay_tree_value) fi);
|
||||
return fi;
|
||||
}
|
||||
|
||||
static void
|
||||
update_header_times (const char *name)
|
||||
{
|
||||
/* Changing files again. This means currently collected time
|
||||
is charged against header time, and body time starts back at 0. */
|
||||
if (flag_detailed_statistics)
|
||||
{
|
||||
int this_time = get_run_time ();
|
||||
struct c_fileinfo *file = get_fileinfo (name);
|
||||
header_time += this_time - body_time;
|
||||
file->time += this_time - body_time;
|
||||
body_time = this_time;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
dump_one_header (splay_tree_node n, void * ARG_UNUSED (dummy))
|
||||
{
|
||||
print_time ((const char *) n->key,
|
||||
((struct c_fileinfo *) n->value)->time);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
dump_time_statistics (void)
|
||||
{
|
||||
struct c_fileinfo *file = get_fileinfo (input_filename);
|
||||
int this_time = get_run_time ();
|
||||
file->time += this_time - body_time;
|
||||
|
||||
fprintf (stderr, "\n******\n");
|
||||
print_time ("header files (total)", header_time);
|
||||
print_time ("main file (total)", this_time - body_time);
|
||||
fprintf (stderr, "ratio = %g : 1\n",
|
||||
(double) header_time / (double) (this_time - body_time));
|
||||
fprintf (stderr, "\n******\n");
|
||||
|
||||
splay_tree_foreach (file_info_tree, dump_one_header, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
cb_ident (cpp_reader * ARG_UNUSED (pfile),
|
||||
unsigned int ARG_UNUSED (line),
|
||||
const cpp_string * ARG_UNUSED (str))
|
||||
{
|
||||
#ifdef ASM_OUTPUT_IDENT
|
||||
if (!flag_no_ident)
|
||||
{
|
||||
/* Convert escapes in the string. */
|
||||
cpp_string cstr = { 0, 0 };
|
||||
if (cpp_interpret_string (pfile, str, 1, &cstr, false))
|
||||
{
|
||||
ASM_OUTPUT_IDENT (asm_out_file, (const char *) cstr.text);
|
||||
free ((void *) cstr.text);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Called at the start of every non-empty line. TOKEN is the first
|
||||
lexed token on the line. Used for diagnostic line numbers. */
|
||||
static void
|
||||
cb_line_change (cpp_reader * ARG_UNUSED (pfile), const cpp_token *token,
|
||||
int parsing_args)
|
||||
{
|
||||
if (token->type != CPP_EOF && !parsing_args)
|
||||
#ifdef USE_MAPPED_LOCATION
|
||||
input_location = token->src_loc;
|
||||
#else
|
||||
{
|
||||
source_location loc = token->src_loc;
|
||||
const struct line_map *map = linemap_lookup (&line_table, loc);
|
||||
input_line = SOURCE_LINE (map, loc);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
fe_file_change (const struct line_map *new_map)
|
||||
{
|
||||
if (new_map == NULL)
|
||||
return;
|
||||
|
||||
if (new_map->reason == LC_ENTER)
|
||||
{
|
||||
/* Don't stack the main buffer on the input stack;
|
||||
we already did in compile_file. */
|
||||
if (!MAIN_FILE_P (new_map))
|
||||
{
|
||||
#ifdef USE_MAPPED_LOCATION
|
||||
int included_at = LAST_SOURCE_LINE_LOCATION (new_map - 1);
|
||||
|
||||
input_location = included_at;
|
||||
push_srcloc (new_map->start_location);
|
||||
#else
|
||||
int included_at = LAST_SOURCE_LINE (new_map - 1);
|
||||
|
||||
input_line = included_at;
|
||||
push_srcloc (new_map->to_file, 1);
|
||||
#endif
|
||||
(*debug_hooks->start_source_file) (included_at, new_map->to_file);
|
||||
#ifndef NO_IMPLICIT_EXTERN_C
|
||||
if (c_header_level)
|
||||
++c_header_level;
|
||||
else if (new_map->sysp == 2)
|
||||
{
|
||||
c_header_level = 1;
|
||||
++pending_lang_change;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (new_map->reason == LC_LEAVE)
|
||||
{
|
||||
#ifndef NO_IMPLICIT_EXTERN_C
|
||||
if (c_header_level && --c_header_level == 0)
|
||||
{
|
||||
if (new_map->sysp == 2)
|
||||
warning (0, "badly nested C headers from preprocessor");
|
||||
--pending_lang_change;
|
||||
}
|
||||
#endif
|
||||
pop_srcloc ();
|
||||
|
||||
(*debug_hooks->end_source_file) (new_map->to_line);
|
||||
}
|
||||
|
||||
update_header_times (new_map->to_file);
|
||||
in_system_header = new_map->sysp != 0;
|
||||
#ifdef USE_MAPPED_LOCATION
|
||||
input_location = new_map->start_location;
|
||||
#else
|
||||
input_filename = new_map->to_file;
|
||||
input_line = new_map->to_line;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
cb_def_pragma (cpp_reader *pfile, source_location loc)
|
||||
{
|
||||
/* Issue a warning message if we have been asked to do so. Ignore
|
||||
unknown pragmas in system headers unless an explicit
|
||||
-Wunknown-pragmas has been given. */
|
||||
if (warn_unknown_pragmas > in_system_header)
|
||||
{
|
||||
const unsigned char *space, *name;
|
||||
const cpp_token *s;
|
||||
#ifndef USE_MAPPED_LOCATION
|
||||
location_t fe_loc;
|
||||
const struct line_map *map = linemap_lookup (&line_table, loc);
|
||||
fe_loc.file = map->to_file;
|
||||
fe_loc.line = SOURCE_LINE (map, loc);
|
||||
#else
|
||||
location_t fe_loc = loc;
|
||||
#endif
|
||||
|
||||
space = name = (const unsigned char *) "";
|
||||
s = cpp_get_token (pfile);
|
||||
if (s->type != CPP_EOF)
|
||||
{
|
||||
space = cpp_token_as_text (pfile, s);
|
||||
s = cpp_get_token (pfile);
|
||||
if (s->type == CPP_NAME)
|
||||
name = cpp_token_as_text (pfile, s);
|
||||
}
|
||||
|
||||
warning (OPT_Wunknown_pragmas, "%Hignoring #pragma %s %s",
|
||||
&fe_loc, space, name);
|
||||
}
|
||||
}
|
||||
|
||||
/* #define callback for DWARF and DWARF2 debug info. */
|
||||
static void
|
||||
cb_define (cpp_reader *pfile, source_location loc, cpp_hashnode *node)
|
||||
{
|
||||
const struct line_map *map = linemap_lookup (&line_table, loc);
|
||||
(*debug_hooks->define) (SOURCE_LINE (map, loc),
|
||||
(const char *) cpp_macro_definition (pfile, node));
|
||||
}
|
||||
|
||||
/* #undef callback for DWARF and DWARF2 debug info. */
|
||||
static void
|
||||
cb_undef (cpp_reader * ARG_UNUSED (pfile), source_location loc,
|
||||
cpp_hashnode *node)
|
||||
{
|
||||
const struct line_map *map = linemap_lookup (&line_table, loc);
|
||||
(*debug_hooks->undef) (SOURCE_LINE (map, loc),
|
||||
(const char *) NODE_NAME (node));
|
||||
}
|
||||
|
||||
/* Read a token and return its type. Fill *VALUE with its value, if
|
||||
applicable. Fill *CPP_FLAGS with the token's flags, if it is
|
||||
non-NULL. */
|
||||
|
||||
enum cpp_ttype
|
||||
c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags)
|
||||
{
|
||||
static bool no_more_pch;
|
||||
const cpp_token *tok;
|
||||
enum cpp_ttype type;
|
||||
unsigned char add_flags = 0;
|
||||
|
||||
timevar_push (TV_CPP);
|
||||
retry:
|
||||
tok = cpp_get_token (parse_in);
|
||||
type = tok->type;
|
||||
|
||||
retry_after_at:
|
||||
#ifdef USE_MAPPED_LOCATION
|
||||
*loc = tok->src_loc;
|
||||
#else
|
||||
*loc = input_location;
|
||||
#endif
|
||||
switch (type)
|
||||
{
|
||||
case CPP_PADDING:
|
||||
goto retry;
|
||||
|
||||
case CPP_NAME:
|
||||
*value = HT_IDENT_TO_GCC_IDENT (HT_NODE (tok->val.node));
|
||||
break;
|
||||
|
||||
case CPP_NUMBER:
|
||||
{
|
||||
unsigned int flags = cpp_classify_number (parse_in, tok);
|
||||
|
||||
switch (flags & CPP_N_CATEGORY)
|
||||
{
|
||||
case CPP_N_INVALID:
|
||||
/* cpplib has issued an error. */
|
||||
*value = error_mark_node;
|
||||
errorcount++;
|
||||
break;
|
||||
|
||||
case CPP_N_INTEGER:
|
||||
/* C++ uses '0' to mark virtual functions as pure.
|
||||
Set PURE_ZERO to pass this information to the C++ parser. */
|
||||
if (tok->val.str.len == 1 && *tok->val.str.text == '0')
|
||||
add_flags = PURE_ZERO;
|
||||
*value = interpret_integer (tok, flags);
|
||||
break;
|
||||
|
||||
case CPP_N_FLOATING:
|
||||
*value = interpret_float (tok, flags);
|
||||
break;
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case CPP_ATSIGN:
|
||||
/* An @ may give the next token special significance in Objective-C. */
|
||||
if (c_dialect_objc ())
|
||||
{
|
||||
location_t atloc = input_location;
|
||||
|
||||
retry_at:
|
||||
tok = cpp_get_token (parse_in);
|
||||
type = tok->type;
|
||||
switch (type)
|
||||
{
|
||||
case CPP_PADDING:
|
||||
goto retry_at;
|
||||
|
||||
case CPP_STRING:
|
||||
case CPP_WSTRING:
|
||||
type = lex_string (tok, value, true);
|
||||
break;
|
||||
|
||||
case CPP_NAME:
|
||||
*value = HT_IDENT_TO_GCC_IDENT (HT_NODE (tok->val.node));
|
||||
if (objc_is_reserved_word (*value))
|
||||
{
|
||||
type = CPP_AT_NAME;
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
|
||||
default:
|
||||
/* ... or not. */
|
||||
error ("%Hstray %<@%> in program", &atloc);
|
||||
goto retry_after_at;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* FALLTHROUGH */
|
||||
case CPP_HASH:
|
||||
case CPP_PASTE:
|
||||
{
|
||||
unsigned char name[4];
|
||||
|
||||
*cpp_spell_token (parse_in, tok, name, true) = 0;
|
||||
|
||||
error ("stray %qs in program", name);
|
||||
}
|
||||
|
||||
goto retry;
|
||||
|
||||
case CPP_OTHER:
|
||||
{
|
||||
cppchar_t c = tok->val.str.text[0];
|
||||
|
||||
if (c == '"' || c == '\'')
|
||||
error ("missing terminating %c character", (int) c);
|
||||
else if (ISGRAPH (c))
|
||||
error ("stray %qc in program", (int) c);
|
||||
else
|
||||
error ("stray %<\\%o%> in program", (int) c);
|
||||
}
|
||||
goto retry;
|
||||
|
||||
case CPP_CHAR:
|
||||
case CPP_WCHAR:
|
||||
*value = lex_charconst (tok);
|
||||
break;
|
||||
|
||||
case CPP_STRING:
|
||||
case CPP_WSTRING:
|
||||
if (!c_lex_return_raw_strings)
|
||||
{
|
||||
type = lex_string (tok, value, false);
|
||||
break;
|
||||
}
|
||||
*value = build_string (tok->val.str.len, (char *) tok->val.str.text);
|
||||
break;
|
||||
|
||||
case CPP_PRAGMA:
|
||||
*value = build_int_cst (NULL, tok->val.pragma);
|
||||
break;
|
||||
|
||||
/* These tokens should not be visible outside cpplib. */
|
||||
case CPP_HEADER_NAME:
|
||||
case CPP_COMMENT:
|
||||
case CPP_MACRO_ARG:
|
||||
gcc_unreachable ();
|
||||
|
||||
default:
|
||||
*value = NULL_TREE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (cpp_flags)
|
||||
*cpp_flags = tok->flags | add_flags;
|
||||
|
||||
if (!no_more_pch)
|
||||
{
|
||||
no_more_pch = true;
|
||||
c_common_no_more_pch ();
|
||||
}
|
||||
|
||||
timevar_pop (TV_CPP);
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
/* Returns the narrowest C-visible unsigned type, starting with the
|
||||
minimum specified by FLAGS, that can fit HIGH:LOW, or itk_none if
|
||||
there isn't one. */
|
||||
|
||||
static enum integer_type_kind
|
||||
narrowest_unsigned_type (unsigned HOST_WIDE_INT low,
|
||||
unsigned HOST_WIDE_INT high,
|
||||
unsigned int flags)
|
||||
{
|
||||
enum integer_type_kind itk;
|
||||
|
||||
if ((flags & CPP_N_WIDTH) == CPP_N_SMALL)
|
||||
itk = itk_unsigned_int;
|
||||
else if ((flags & CPP_N_WIDTH) == CPP_N_MEDIUM)
|
||||
itk = itk_unsigned_long;
|
||||
else
|
||||
itk = itk_unsigned_long_long;
|
||||
|
||||
for (; itk < itk_none; itk += 2 /* skip unsigned types */)
|
||||
{
|
||||
tree upper = TYPE_MAX_VALUE (integer_types[itk]);
|
||||
|
||||
if ((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (upper) > high
|
||||
|| ((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (upper) == high
|
||||
&& TREE_INT_CST_LOW (upper) >= low))
|
||||
return itk;
|
||||
}
|
||||
|
||||
return itk_none;
|
||||
}
|
||||
|
||||
/* Ditto, but narrowest signed type. */
|
||||
static enum integer_type_kind
|
||||
narrowest_signed_type (unsigned HOST_WIDE_INT low,
|
||||
unsigned HOST_WIDE_INT high, unsigned int flags)
|
||||
{
|
||||
enum integer_type_kind itk;
|
||||
|
||||
if ((flags & CPP_N_WIDTH) == CPP_N_SMALL)
|
||||
itk = itk_int;
|
||||
else if ((flags & CPP_N_WIDTH) == CPP_N_MEDIUM)
|
||||
itk = itk_long;
|
||||
else
|
||||
itk = itk_long_long;
|
||||
|
||||
|
||||
for (; itk < itk_none; itk += 2 /* skip signed types */)
|
||||
{
|
||||
tree upper = TYPE_MAX_VALUE (integer_types[itk]);
|
||||
|
||||
if ((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (upper) > high
|
||||
|| ((unsigned HOST_WIDE_INT) TREE_INT_CST_HIGH (upper) == high
|
||||
&& TREE_INT_CST_LOW (upper) >= low))
|
||||
return itk;
|
||||
}
|
||||
|
||||
return itk_none;
|
||||
}
|
||||
|
||||
/* Interpret TOKEN, an integer with FLAGS as classified by cpplib. */
|
||||
static tree
|
||||
interpret_integer (const cpp_token *token, unsigned int flags)
|
||||
{
|
||||
tree value, type;
|
||||
enum integer_type_kind itk;
|
||||
cpp_num integer;
|
||||
cpp_options *options = cpp_get_options (parse_in);
|
||||
|
||||
integer = cpp_interpret_integer (parse_in, token, flags);
|
||||
integer = cpp_num_sign_extend (integer, options->precision);
|
||||
|
||||
/* The type of a constant with a U suffix is straightforward. */
|
||||
if (flags & CPP_N_UNSIGNED)
|
||||
itk = narrowest_unsigned_type (integer.low, integer.high, flags);
|
||||
else
|
||||
{
|
||||
/* The type of a potentially-signed integer constant varies
|
||||
depending on the base it's in, the standard in use, and the
|
||||
length suffixes. */
|
||||
enum integer_type_kind itk_u
|
||||
= narrowest_unsigned_type (integer.low, integer.high, flags);
|
||||
enum integer_type_kind itk_s
|
||||
= narrowest_signed_type (integer.low, integer.high, flags);
|
||||
|
||||
/* In both C89 and C99, octal and hex constants may be signed or
|
||||
unsigned, whichever fits tighter. We do not warn about this
|
||||
choice differing from the traditional choice, as the constant
|
||||
is probably a bit pattern and either way will work. */
|
||||
if ((flags & CPP_N_RADIX) != CPP_N_DECIMAL)
|
||||
itk = MIN (itk_u, itk_s);
|
||||
else
|
||||
{
|
||||
/* In C99, decimal constants are always signed.
|
||||
In C89, decimal constants that don't fit in long have
|
||||
undefined behavior; we try to make them unsigned long.
|
||||
In GCC's extended C89, that last is true of decimal
|
||||
constants that don't fit in long long, too. */
|
||||
|
||||
itk = itk_s;
|
||||
if (itk_s > itk_u && itk_s > itk_long)
|
||||
{
|
||||
if (!flag_isoc99)
|
||||
{
|
||||
if (itk_u < itk_unsigned_long)
|
||||
itk_u = itk_unsigned_long;
|
||||
itk = itk_u;
|
||||
warning (0, "this decimal constant is unsigned only in ISO C90");
|
||||
}
|
||||
else
|
||||
warning (OPT_Wtraditional,
|
||||
"this decimal constant would be unsigned in ISO C90");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (itk == itk_none)
|
||||
/* cpplib has already issued a warning for overflow. */
|
||||
type = ((flags & CPP_N_UNSIGNED)
|
||||
? widest_unsigned_literal_type_node
|
||||
: widest_integer_literal_type_node);
|
||||
else
|
||||
type = integer_types[itk];
|
||||
|
||||
if (itk > itk_unsigned_long
|
||||
&& (flags & CPP_N_WIDTH) != CPP_N_LARGE
|
||||
&& !in_system_header && !flag_isoc99)
|
||||
pedwarn ("integer constant is too large for %qs type",
|
||||
(flags & CPP_N_UNSIGNED) ? "unsigned long" : "long");
|
||||
|
||||
value = build_int_cst_wide (type, integer.low, integer.high);
|
||||
|
||||
/* Convert imaginary to a complex type. */
|
||||
if (flags & CPP_N_IMAGINARY)
|
||||
value = build_complex (NULL_TREE, build_int_cst (type, 0), value);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/* Interpret TOKEN, a floating point number with FLAGS as classified
|
||||
by cpplib. */
|
||||
static tree
|
||||
interpret_float (const cpp_token *token, unsigned int flags)
|
||||
{
|
||||
tree type;
|
||||
tree value;
|
||||
REAL_VALUE_TYPE real;
|
||||
char *copy;
|
||||
size_t copylen;
|
||||
|
||||
/* Default (no suffix) is double. */
|
||||
if (flags & CPP_N_DEFAULT)
|
||||
{
|
||||
flags ^= CPP_N_DEFAULT;
|
||||
flags |= CPP_N_MEDIUM;
|
||||
}
|
||||
|
||||
/* Decode type based on width and properties. */
|
||||
if (flags & CPP_N_DFLOAT)
|
||||
if ((flags & CPP_N_WIDTH) == CPP_N_LARGE)
|
||||
type = dfloat128_type_node;
|
||||
else if ((flags & CPP_N_WIDTH) == CPP_N_SMALL)
|
||||
type = dfloat32_type_node;
|
||||
else
|
||||
type = dfloat64_type_node;
|
||||
else
|
||||
if ((flags & CPP_N_WIDTH) == CPP_N_LARGE)
|
||||
type = long_double_type_node;
|
||||
else if ((flags & CPP_N_WIDTH) == CPP_N_SMALL
|
||||
|| flag_single_precision_constant)
|
||||
type = float_type_node;
|
||||
else
|
||||
type = double_type_node;
|
||||
|
||||
/* Copy the constant to a nul-terminated buffer. If the constant
|
||||
has any suffixes, cut them off; REAL_VALUE_ATOF/ REAL_VALUE_HTOF
|
||||
can't handle them. */
|
||||
copylen = token->val.str.len;
|
||||
if (flags & CPP_N_DFLOAT)
|
||||
copylen -= 2;
|
||||
else
|
||||
{
|
||||
if ((flags & CPP_N_WIDTH) != CPP_N_MEDIUM)
|
||||
/* Must be an F or L suffix. */
|
||||
copylen--;
|
||||
if (flags & CPP_N_IMAGINARY)
|
||||
/* I or J suffix. */
|
||||
copylen--;
|
||||
}
|
||||
|
||||
copy = (char *) alloca (copylen + 1);
|
||||
memcpy (copy, token->val.str.text, copylen);
|
||||
copy[copylen] = '\0';
|
||||
|
||||
real_from_string3 (&real, copy, TYPE_MODE (type));
|
||||
|
||||
/* Both C and C++ require a diagnostic for a floating constant
|
||||
outside the range of representable values of its type. Since we
|
||||
have __builtin_inf* to produce an infinity, it might now be
|
||||
appropriate for this to be a mandatory pedwarn rather than
|
||||
conditioned on -pedantic. */
|
||||
if (REAL_VALUE_ISINF (real) && pedantic)
|
||||
pedwarn ("floating constant exceeds range of %qT", type);
|
||||
|
||||
/* Create a node with determined type and value. */
|
||||
value = build_real (type, real);
|
||||
if (flags & CPP_N_IMAGINARY)
|
||||
value = build_complex (NULL_TREE, convert (type, integer_zero_node), value);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
/* Convert a series of STRING and/or WSTRING tokens into a tree,
|
||||
performing string constant concatenation. TOK is the first of
|
||||
these. VALP is the location to write the string into. OBJC_STRING
|
||||
indicates whether an '@' token preceded the incoming token.
|
||||
Returns the CPP token type of the result (CPP_STRING, CPP_WSTRING,
|
||||
or CPP_OBJC_STRING).
|
||||
|
||||
This is unfortunately more work than it should be. If any of the
|
||||
strings in the series has an L prefix, the result is a wide string
|
||||
(6.4.5p4). Whether or not the result is a wide string affects the
|
||||
meaning of octal and hexadecimal escapes (6.4.4.4p6,9). But escape
|
||||
sequences do not continue across the boundary between two strings in
|
||||
a series (6.4.5p7), so we must not lose the boundaries. Therefore
|
||||
cpp_interpret_string takes a vector of cpp_string structures, which
|
||||
we must arrange to provide. */
|
||||
|
||||
static enum cpp_ttype
|
||||
lex_string (const cpp_token *tok, tree *valp, bool objc_string)
|
||||
{
|
||||
tree value;
|
||||
bool wide = false;
|
||||
size_t concats = 0;
|
||||
struct obstack str_ob;
|
||||
cpp_string istr;
|
||||
|
||||
/* Try to avoid the overhead of creating and destroying an obstack
|
||||
for the common case of just one string. */
|
||||
cpp_string str = tok->val.str;
|
||||
cpp_string *strs = &str;
|
||||
|
||||
if (tok->type == CPP_WSTRING)
|
||||
wide = true;
|
||||
|
||||
retry:
|
||||
tok = cpp_get_token (parse_in);
|
||||
switch (tok->type)
|
||||
{
|
||||
case CPP_PADDING:
|
||||
goto retry;
|
||||
case CPP_ATSIGN:
|
||||
if (c_dialect_objc ())
|
||||
{
|
||||
objc_string = true;
|
||||
goto retry;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
case CPP_WSTRING:
|
||||
wide = true;
|
||||
/* FALLTHROUGH */
|
||||
|
||||
case CPP_STRING:
|
||||
if (!concats)
|
||||
{
|
||||
gcc_obstack_init (&str_ob);
|
||||
obstack_grow (&str_ob, &str, sizeof (cpp_string));
|
||||
}
|
||||
|
||||
concats++;
|
||||
obstack_grow (&str_ob, &tok->val.str, sizeof (cpp_string));
|
||||
goto retry;
|
||||
}
|
||||
|
||||
/* We have read one more token than we want. */
|
||||
_cpp_backup_tokens (parse_in, 1);
|
||||
if (concats)
|
||||
strs = XOBFINISH (&str_ob, cpp_string *);
|
||||
|
||||
if (concats && !objc_string && !in_system_header)
|
||||
warning (OPT_Wtraditional,
|
||||
"traditional C rejects string constant concatenation");
|
||||
|
||||
if ((c_lex_string_translate
|
||||
? cpp_interpret_string : cpp_interpret_string_notranslate)
|
||||
(parse_in, strs, concats + 1, &istr, wide))
|
||||
{
|
||||
value = build_string (istr.len, (char *) istr.text);
|
||||
free ((void *) istr.text);
|
||||
|
||||
if (c_lex_string_translate == -1)
|
||||
{
|
||||
int xlated = cpp_interpret_string_notranslate (parse_in, strs,
|
||||
concats + 1,
|
||||
&istr, wide);
|
||||
/* Assume that, if we managed to translate the string above,
|
||||
then the untranslated parsing will always succeed. */
|
||||
gcc_assert (xlated);
|
||||
|
||||
if (TREE_STRING_LENGTH (value) != (int) istr.len
|
||||
|| 0 != strncmp (TREE_STRING_POINTER (value), (char *) istr.text,
|
||||
istr.len))
|
||||
{
|
||||
/* Arrange for us to return the untranslated string in
|
||||
*valp, but to set up the C type of the translated
|
||||
one. */
|
||||
*valp = build_string (istr.len, (char *) istr.text);
|
||||
valp = &TREE_CHAIN (*valp);
|
||||
}
|
||||
free ((void *) istr.text);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Callers cannot generally handle error_mark_node in this context,
|
||||
so return the empty string instead. cpp_interpret_string has
|
||||
issued an error. */
|
||||
if (wide)
|
||||
value = build_string (TYPE_PRECISION (wchar_type_node)
|
||||
/ TYPE_PRECISION (char_type_node),
|
||||
"\0\0\0"); /* widest supported wchar_t
|
||||
is 32 bits */
|
||||
else
|
||||
value = build_string (1, "");
|
||||
}
|
||||
|
||||
TREE_TYPE (value) = wide ? wchar_array_type_node : char_array_type_node;
|
||||
*valp = fix_string_type (value);
|
||||
|
||||
if (concats)
|
||||
obstack_free (&str_ob, 0);
|
||||
|
||||
return objc_string ? CPP_OBJC_STRING : wide ? CPP_WSTRING : CPP_STRING;
|
||||
}
|
||||
|
||||
/* Converts a (possibly wide) character constant token into a tree. */
|
||||
static tree
|
||||
lex_charconst (const cpp_token *token)
|
||||
{
|
||||
cppchar_t result;
|
||||
tree type, value;
|
||||
unsigned int chars_seen;
|
||||
int unsignedp;
|
||||
|
||||
result = cpp_interpret_charconst (parse_in, token,
|
||||
&chars_seen, &unsignedp);
|
||||
|
||||
if (token->type == CPP_WCHAR)
|
||||
type = wchar_type_node;
|
||||
/* In C, a character constant has type 'int'.
|
||||
In C++ 'char', but multi-char charconsts have type 'int'. */
|
||||
else if (!c_dialect_cxx () || chars_seen > 1)
|
||||
type = integer_type_node;
|
||||
else
|
||||
type = char_type_node;
|
||||
|
||||
/* Cast to cppchar_signed_t to get correct sign-extension of RESULT
|
||||
before possibly widening to HOST_WIDE_INT for build_int_cst. */
|
||||
if (unsignedp || (cppchar_signed_t) result >= 0)
|
||||
value = build_int_cst_wide (type, result, 0);
|
||||
else
|
||||
value = build_int_cst_wide (type, (cppchar_signed_t) result, -1);
|
||||
|
||||
return value;
|
||||
}
|
@ -1,267 +0,0 @@
|
||||
/* Some code common to C and ObjC front ends.
|
||||
Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "tree.h"
|
||||
#include "rtl.h"
|
||||
#include "insn-config.h"
|
||||
#include "integrate.h"
|
||||
#include "c-tree.h"
|
||||
#include "c-pretty-print.h"
|
||||
#include "function.h"
|
||||
#include "flags.h"
|
||||
#include "toplev.h"
|
||||
#include "diagnostic.h"
|
||||
#include "tree-inline.h"
|
||||
#include "varray.h"
|
||||
#include "ggc.h"
|
||||
#include "langhooks.h"
|
||||
#include "tree-mudflap.h"
|
||||
#include "target.h"
|
||||
#include "c-objc-common.h"
|
||||
|
||||
static bool c_tree_printer (pretty_printer *, text_info *, const char *,
|
||||
int, bool, bool, bool);
|
||||
|
||||
bool
|
||||
c_missing_noreturn_ok_p (tree decl)
|
||||
{
|
||||
/* A missing noreturn is not ok for freestanding implementations and
|
||||
ok for the `main' function in hosted implementations. */
|
||||
return flag_hosted && MAIN_NAME_P (DECL_ASSEMBLER_NAME (decl));
|
||||
}
|
||||
|
||||
/* We want to inline `extern inline' functions even if this would
|
||||
violate inlining limits. Some glibc and linux constructs depend on
|
||||
such functions always being inlined when optimizing. */
|
||||
|
||||
int
|
||||
c_disregard_inline_limits (tree fn)
|
||||
{
|
||||
if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) != NULL)
|
||||
return 1;
|
||||
|
||||
return (!flag_really_no_inline && DECL_DECLARED_INLINE_P (fn)
|
||||
&& DECL_EXTERNAL (fn));
|
||||
}
|
||||
|
||||
int
|
||||
c_cannot_inline_tree_fn (tree *fnp)
|
||||
{
|
||||
tree fn = *fnp;
|
||||
bool do_warning = (warn_inline
|
||||
&& DECL_INLINE (fn)
|
||||
&& DECL_DECLARED_INLINE_P (fn)
|
||||
&& !DECL_IN_SYSTEM_HEADER (fn));
|
||||
|
||||
if (flag_really_no_inline
|
||||
&& lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL)
|
||||
{
|
||||
if (do_warning)
|
||||
warning (OPT_Winline, "function %q+F can never be inlined because it "
|
||||
"is suppressed using -fno-inline", fn);
|
||||
goto cannot_inline;
|
||||
}
|
||||
|
||||
/* Don't auto-inline anything that might not be bound within
|
||||
this unit of translation. */
|
||||
if (!DECL_DECLARED_INLINE_P (fn) && !targetm.binds_local_p (fn))
|
||||
{
|
||||
if (do_warning)
|
||||
warning (OPT_Winline, "function %q+F can never be inlined because it "
|
||||
"might not be bound within this unit of translation", fn);
|
||||
goto cannot_inline;
|
||||
}
|
||||
|
||||
if (!function_attribute_inlinable_p (fn))
|
||||
{
|
||||
if (do_warning)
|
||||
warning (OPT_Winline, "function %q+F can never be inlined because it "
|
||||
"uses attributes conflicting with inlining", fn);
|
||||
goto cannot_inline;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
cannot_inline:
|
||||
DECL_UNINLINABLE (fn) = 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Called from check_global_declarations. */
|
||||
|
||||
bool
|
||||
c_warn_unused_global_decl (tree decl)
|
||||
{
|
||||
if (TREE_CODE (decl) == FUNCTION_DECL && DECL_DECLARED_INLINE_P (decl))
|
||||
return false;
|
||||
if (DECL_IN_SYSTEM_HEADER (decl))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Initialization common to C and Objective-C front ends. */
|
||||
bool
|
||||
c_objc_common_init (void)
|
||||
{
|
||||
c_init_decl_processing ();
|
||||
|
||||
if (c_common_init () == false)
|
||||
return false;
|
||||
|
||||
/* These were not defined in the Objective-C front end, but I'm
|
||||
putting them here anyway. The diagnostic format decoder might
|
||||
want an enhanced ObjC implementation. */
|
||||
diagnostic_format_decoder (global_dc) = &c_tree_printer;
|
||||
|
||||
/* If still unspecified, make it match -std=c99
|
||||
(allowing for -pedantic-errors). */
|
||||
if (mesg_implicit_function_declaration < 0)
|
||||
{
|
||||
if (flag_isoc99)
|
||||
mesg_implicit_function_declaration = flag_pedantic_errors ? 2 : 1;
|
||||
else
|
||||
mesg_implicit_function_declaration = 0;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Called during diagnostic message formatting process to print a
|
||||
source-level entity onto BUFFER. The meaning of the format specifiers
|
||||
is as follows:
|
||||
%D: a general decl,
|
||||
%E: an identifier or expression,
|
||||
%F: a function declaration,
|
||||
%T: a type.
|
||||
|
||||
These format specifiers form a subset of the format specifiers set used
|
||||
by the C++ front-end.
|
||||
Please notice when called, the `%' part was already skipped by the
|
||||
diagnostic machinery. */
|
||||
static bool
|
||||
c_tree_printer (pretty_printer *pp, text_info *text, const char *spec,
|
||||
int precision, bool wide, bool set_locus, bool hash)
|
||||
{
|
||||
tree t = va_arg (*text->args_ptr, tree);
|
||||
tree name;
|
||||
const char *n = "({anonymous})";
|
||||
c_pretty_printer *cpp = (c_pretty_printer *) pp;
|
||||
pp->padding = pp_none;
|
||||
|
||||
if (precision != 0 || wide || hash)
|
||||
return false;
|
||||
|
||||
if (set_locus && text->locus)
|
||||
*text->locus = DECL_SOURCE_LOCATION (t);
|
||||
|
||||
switch (*spec)
|
||||
{
|
||||
case 'D':
|
||||
if (DECL_DEBUG_EXPR_IS_FROM (t) && DECL_DEBUG_EXPR (t))
|
||||
{
|
||||
t = DECL_DEBUG_EXPR (t);
|
||||
if (!DECL_P (t))
|
||||
{
|
||||
pp_c_expression (cpp, t);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/* FALLTHRU */
|
||||
|
||||
case 'F':
|
||||
if (DECL_NAME (t))
|
||||
n = lang_hooks.decl_printable_name (t, 2);
|
||||
break;
|
||||
|
||||
case 'T':
|
||||
gcc_assert (TYPE_P (t));
|
||||
name = TYPE_NAME (t);
|
||||
|
||||
if (name && TREE_CODE (name) == TYPE_DECL)
|
||||
{
|
||||
if (DECL_NAME (name))
|
||||
pp_string (cpp, lang_hooks.decl_printable_name (name, 2));
|
||||
else
|
||||
pp_type_id (cpp, t);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
pp_type_id (cpp, t);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'E':
|
||||
if (TREE_CODE (t) == IDENTIFIER_NODE)
|
||||
n = IDENTIFIER_POINTER (t);
|
||||
else
|
||||
{
|
||||
pp_expression (cpp, t);
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
pp_string (cpp, n);
|
||||
return true;
|
||||
}
|
||||
|
||||
/* In C and ObjC, all decls have "C" linkage. */
|
||||
bool
|
||||
has_c_linkage (tree decl ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
c_initialize_diagnostics (diagnostic_context *context)
|
||||
{
|
||||
pretty_printer *base = context->printer;
|
||||
c_pretty_printer *pp = XNEW (c_pretty_printer);
|
||||
memcpy (pp_base (pp), base, sizeof (pretty_printer));
|
||||
pp_c_pretty_printer_init (pp);
|
||||
context->printer = (pretty_printer *) pp;
|
||||
|
||||
/* It is safe to free this object because it was previously XNEW()'d. */
|
||||
XDELETE (base);
|
||||
}
|
||||
|
||||
int
|
||||
c_types_compatible_p (tree x, tree y)
|
||||
{
|
||||
return comptypes (TYPE_MAIN_VARIANT (x), TYPE_MAIN_VARIANT (y));
|
||||
}
|
||||
|
||||
/* Determine if the type is a vla type for the backend. */
|
||||
|
||||
bool
|
||||
c_vla_unspec_p (tree x, tree fn ATTRIBUTE_UNUSED)
|
||||
{
|
||||
return c_vla_type_p (x);
|
||||
}
|
@ -1,149 +0,0 @@
|
||||
/* Language hooks common to C and ObjC front ends.
|
||||
Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
Contributed by Ziemowit Laski <zlaski@apple.com>
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifndef GCC_C_OBJC_COMMON
|
||||
#define GCC_C_OBJC_COMMON
|
||||
|
||||
/* In c-objc-common.c. */
|
||||
extern void c_initialize_diagnostics (diagnostic_context *);
|
||||
|
||||
/* Lang hooks that are shared between C and ObjC are defined here. Hooks
|
||||
specific to C or ObjC go in c-lang.c and objc/objc-lang.c, respectively. */
|
||||
|
||||
#undef LANG_HOOKS_IDENTIFIER_SIZE
|
||||
#define LANG_HOOKS_IDENTIFIER_SIZE C_SIZEOF_STRUCT_LANG_IDENTIFIER
|
||||
#undef LANG_HOOKS_FINISH
|
||||
#define LANG_HOOKS_FINISH c_common_finish
|
||||
#undef LANG_HOOKS_INIT_OPTIONS
|
||||
#define LANG_HOOKS_INIT_OPTIONS c_common_init_options
|
||||
#undef LANG_HOOKS_INITIALIZE_DIAGNOSTICS
|
||||
#define LANG_HOOKS_INITIALIZE_DIAGNOSTICS c_initialize_diagnostics
|
||||
#undef LANG_HOOKS_HANDLE_OPTION
|
||||
#define LANG_HOOKS_HANDLE_OPTION c_common_handle_option
|
||||
#undef LANG_HOOKS_MISSING_ARGUMENT
|
||||
#define LANG_HOOKS_MISSING_ARGUMENT c_common_missing_argument
|
||||
#undef LANG_HOOKS_POST_OPTIONS
|
||||
#define LANG_HOOKS_POST_OPTIONS c_common_post_options
|
||||
#undef LANG_HOOKS_GET_ALIAS_SET
|
||||
#define LANG_HOOKS_GET_ALIAS_SET c_common_get_alias_set
|
||||
#undef LANG_HOOKS_EXPAND_EXPR
|
||||
#define LANG_HOOKS_EXPAND_EXPR c_expand_expr
|
||||
#undef LANG_HOOKS_EXPAND_DECL
|
||||
#define LANG_HOOKS_EXPAND_DECL c_expand_decl
|
||||
#undef LANG_HOOKS_MARK_ADDRESSABLE
|
||||
#define LANG_HOOKS_MARK_ADDRESSABLE c_mark_addressable
|
||||
#undef LANG_HOOKS_PARSE_FILE
|
||||
#define LANG_HOOKS_PARSE_FILE c_common_parse_file
|
||||
#undef LANG_HOOKS_FINISH_INCOMPLETE_DECL
|
||||
#define LANG_HOOKS_FINISH_INCOMPLETE_DECL c_finish_incomplete_decl
|
||||
#undef LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS
|
||||
#define LANG_HOOKS_REDUCE_BIT_FIELD_OPERATIONS true
|
||||
#undef LANG_HOOKS_STATICP
|
||||
#define LANG_HOOKS_STATICP c_staticp
|
||||
#undef LANG_HOOKS_NO_BODY_BLOCKS
|
||||
#define LANG_HOOKS_NO_BODY_BLOCKS true
|
||||
#undef LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL
|
||||
#define LANG_HOOKS_WARN_UNUSED_GLOBAL_DECL c_warn_unused_global_decl
|
||||
#undef LANG_HOOKS_PRINT_IDENTIFIER
|
||||
#define LANG_HOOKS_PRINT_IDENTIFIER c_print_identifier
|
||||
#undef LANG_HOOKS_TYPES_COMPATIBLE_P
|
||||
#define LANG_HOOKS_TYPES_COMPATIBLE_P c_types_compatible_p
|
||||
#undef LANG_HOOKS_FUNCTION_ENTER_NESTED
|
||||
#define LANG_HOOKS_FUNCTION_ENTER_NESTED c_push_function_context
|
||||
#undef LANG_HOOKS_FUNCTION_LEAVE_NESTED
|
||||
#define LANG_HOOKS_FUNCTION_LEAVE_NESTED c_pop_function_context
|
||||
#undef LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P
|
||||
#define LANG_HOOKS_FUNCTION_MISSING_NORETURN_OK_P c_missing_noreturn_ok_p
|
||||
#undef LANG_HOOKS_DUP_LANG_SPECIFIC_DECL
|
||||
#define LANG_HOOKS_DUP_LANG_SPECIFIC_DECL c_dup_lang_specific_decl
|
||||
|
||||
/* Attribute hooks. */
|
||||
#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE
|
||||
#define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE c_common_attribute_table
|
||||
#undef LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE
|
||||
#define LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE c_common_format_attribute_table
|
||||
|
||||
#undef LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN
|
||||
#define LANG_HOOKS_TREE_INLINING_CANNOT_INLINE_TREE_FN \
|
||||
c_cannot_inline_tree_fn
|
||||
#undef LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS
|
||||
#define LANG_HOOKS_TREE_INLINING_DISREGARD_INLINE_LIMITS \
|
||||
c_disregard_inline_limits
|
||||
#undef LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P
|
||||
#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P \
|
||||
anon_aggr_type_p
|
||||
#undef LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING
|
||||
#define LANG_HOOKS_TREE_INLINING_CONVERT_PARM_FOR_INLINING \
|
||||
c_convert_parm_for_inlining
|
||||
#undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN
|
||||
#define LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN c_dump_tree
|
||||
|
||||
#undef LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION
|
||||
#define LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION c_expand_body
|
||||
|
||||
#undef LANG_HOOKS_TYPE_FOR_MODE
|
||||
#define LANG_HOOKS_TYPE_FOR_MODE c_common_type_for_mode
|
||||
#undef LANG_HOOKS_TYPE_FOR_SIZE
|
||||
#define LANG_HOOKS_TYPE_FOR_SIZE c_common_type_for_size
|
||||
#undef LANG_HOOKS_SIGNED_TYPE
|
||||
#define LANG_HOOKS_SIGNED_TYPE c_common_signed_type
|
||||
#undef LANG_HOOKS_UNSIGNED_TYPE
|
||||
#define LANG_HOOKS_UNSIGNED_TYPE c_common_unsigned_type
|
||||
#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE
|
||||
#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE c_common_signed_or_unsigned_type
|
||||
#undef LANG_HOOKS_INCOMPLETE_TYPE_ERROR
|
||||
#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR c_incomplete_type_error
|
||||
#undef LANG_HOOKS_TYPE_PROMOTES_TO
|
||||
#define LANG_HOOKS_TYPE_PROMOTES_TO c_type_promotes_to
|
||||
#undef LANG_HOOKS_REGISTER_BUILTIN_TYPE
|
||||
#define LANG_HOOKS_REGISTER_BUILTIN_TYPE c_register_builtin_type
|
||||
#undef LANG_HOOKS_TO_TARGET_CHARSET
|
||||
#define LANG_HOOKS_TO_TARGET_CHARSET c_common_to_target_charset
|
||||
#undef LANG_HOOKS_EXPR_TO_DECL
|
||||
#define LANG_HOOKS_EXPR_TO_DECL c_expr_to_decl
|
||||
|
||||
/* The C front end's scoping structure is very different from
|
||||
that expected by the language-independent code; it is best
|
||||
to disable getdecls.
|
||||
This means it must also provide its own write_globals. */
|
||||
|
||||
#undef LANG_HOOKS_GETDECLS
|
||||
#define LANG_HOOKS_GETDECLS lhd_return_null_tree_v
|
||||
#undef LANG_HOOKS_WRITE_GLOBALS
|
||||
#define LANG_HOOKS_WRITE_GLOBALS c_write_global_declarations
|
||||
|
||||
/* Hooks for tree gimplification. */
|
||||
#undef LANG_HOOKS_GIMPLIFY_EXPR
|
||||
#define LANG_HOOKS_GIMPLIFY_EXPR c_gimplify_expr
|
||||
|
||||
#undef LANG_HOOKS_OMP_PREDETERMINED_SHARING
|
||||
#define LANG_HOOKS_OMP_PREDETERMINED_SHARING c_omp_predetermined_sharing
|
||||
|
||||
#undef LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P
|
||||
#define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P c_vla_unspec_p
|
||||
|
||||
/* APPLE LOCAL begin radar 6353006 */
|
||||
#undef LANG_HOOKS_BUILD_GENERIC_BLOCK_STRUCT_TYPE
|
||||
#define LANG_HOOKS_BUILD_GENERIC_BLOCK_STRUCT_TYPE \
|
||||
c_build_generic_block_struct_type
|
||||
/* APPLE LOCAL end radar 6353006 */
|
||||
|
||||
#endif /* GCC_C_OBJC_COMMON */
|
@ -1,441 +0,0 @@
|
||||
/* This file contains routines to construct GNU OpenMP constructs,
|
||||
called from parsing in the C and C++ front ends.
|
||||
|
||||
Copyright (C) 2005 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson <rth@redhat.com>,
|
||||
Diego Novillo <dnovillo@redhat.com>.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "tree.h"
|
||||
#include "function.h"
|
||||
#include "c-common.h"
|
||||
#include "toplev.h"
|
||||
#include "tree-gimple.h"
|
||||
#include "bitmap.h"
|
||||
#include "langhooks.h"
|
||||
|
||||
|
||||
/* Complete a #pragma omp master construct. STMT is the structured-block
|
||||
that follows the pragma. */
|
||||
|
||||
tree
|
||||
c_finish_omp_master (tree stmt)
|
||||
{
|
||||
return add_stmt (build1 (OMP_MASTER, void_type_node, stmt));
|
||||
}
|
||||
|
||||
/* Complete a #pragma omp critical construct. STMT is the structured-block
|
||||
that follows the pragma, NAME is the identifier in the pragma, or null
|
||||
if it was omitted. */
|
||||
|
||||
tree
|
||||
c_finish_omp_critical (tree body, tree name)
|
||||
{
|
||||
tree stmt = make_node (OMP_CRITICAL);
|
||||
TREE_TYPE (stmt) = void_type_node;
|
||||
OMP_CRITICAL_BODY (stmt) = body;
|
||||
OMP_CRITICAL_NAME (stmt) = name;
|
||||
return add_stmt (stmt);
|
||||
}
|
||||
|
||||
/* Complete a #pragma omp ordered construct. STMT is the structured-block
|
||||
that follows the pragma. */
|
||||
|
||||
tree
|
||||
c_finish_omp_ordered (tree stmt)
|
||||
{
|
||||
return add_stmt (build1 (OMP_ORDERED, void_type_node, stmt));
|
||||
}
|
||||
|
||||
|
||||
/* Complete a #pragma omp barrier construct. */
|
||||
|
||||
void
|
||||
c_finish_omp_barrier (void)
|
||||
{
|
||||
tree x;
|
||||
|
||||
x = built_in_decls[BUILT_IN_GOMP_BARRIER];
|
||||
x = build_function_call_expr (x, NULL);
|
||||
add_stmt (x);
|
||||
}
|
||||
|
||||
|
||||
/* Complete a #pragma omp atomic construct. The expression to be
|
||||
implemented atomically is LHS code= RHS. The value returned is
|
||||
either error_mark_node (if the construct was erroneous) or an
|
||||
OMP_ATOMIC node which should be added to the current statement tree
|
||||
with add_stmt. */
|
||||
|
||||
tree
|
||||
c_finish_omp_atomic (enum tree_code code, tree lhs, tree rhs)
|
||||
{
|
||||
tree x, type, addr;
|
||||
|
||||
if (lhs == error_mark_node || rhs == error_mark_node)
|
||||
return error_mark_node;
|
||||
|
||||
/* ??? According to one reading of the OpenMP spec, complex type are
|
||||
supported, but there are no atomic stores for any architecture.
|
||||
But at least icc 9.0 doesn't support complex types here either.
|
||||
And lets not even talk about vector types... */
|
||||
type = TREE_TYPE (lhs);
|
||||
if (!INTEGRAL_TYPE_P (type)
|
||||
&& !POINTER_TYPE_P (type)
|
||||
&& !SCALAR_FLOAT_TYPE_P (type))
|
||||
{
|
||||
error ("invalid expression type for %<#pragma omp atomic%>");
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
/* ??? Validate that rhs does not overlap lhs. */
|
||||
|
||||
/* Take and save the address of the lhs. From then on we'll reference it
|
||||
via indirection. */
|
||||
addr = build_unary_op (ADDR_EXPR, lhs, 0);
|
||||
if (addr == error_mark_node)
|
||||
return error_mark_node;
|
||||
addr = save_expr (addr);
|
||||
if (TREE_CODE (addr) != SAVE_EXPR
|
||||
&& (TREE_CODE (addr) != ADDR_EXPR
|
||||
|| TREE_CODE (TREE_OPERAND (addr, 0)) != VAR_DECL))
|
||||
{
|
||||
/* Make sure LHS is simple enough so that goa_lhs_expr_p can recognize
|
||||
it even after unsharing function body. */
|
||||
tree var = create_tmp_var_raw (TREE_TYPE (addr), NULL);
|
||||
addr = build4 (TARGET_EXPR, TREE_TYPE (addr), var, addr, NULL, NULL);
|
||||
}
|
||||
lhs = build_indirect_ref (addr, NULL);
|
||||
|
||||
/* There are lots of warnings, errors, and conversions that need to happen
|
||||
in the course of interpreting a statement. Use the normal mechanisms
|
||||
to do this, and then take it apart again. */
|
||||
x = build_modify_expr (lhs, code, rhs);
|
||||
if (x == error_mark_node)
|
||||
return error_mark_node;
|
||||
gcc_assert (TREE_CODE (x) == MODIFY_EXPR);
|
||||
rhs = TREE_OPERAND (x, 1);
|
||||
|
||||
/* Punt the actual generation of atomic operations to common code. */
|
||||
return build2 (OMP_ATOMIC, void_type_node, addr, rhs);
|
||||
}
|
||||
|
||||
|
||||
/* Complete a #pragma omp flush construct. We don't do anything with the
|
||||
variable list that the syntax allows. */
|
||||
|
||||
void
|
||||
c_finish_omp_flush (void)
|
||||
{
|
||||
tree x;
|
||||
|
||||
x = built_in_decls[BUILT_IN_SYNCHRONIZE];
|
||||
x = build_function_call_expr (x, NULL);
|
||||
add_stmt (x);
|
||||
}
|
||||
|
||||
|
||||
/* Check and canonicalize #pragma omp for increment expression.
|
||||
Helper function for c_finish_omp_for. */
|
||||
|
||||
static tree
|
||||
check_omp_for_incr_expr (tree exp, tree decl)
|
||||
{
|
||||
tree t;
|
||||
|
||||
if (!INTEGRAL_TYPE_P (TREE_TYPE (exp))
|
||||
|| TYPE_PRECISION (TREE_TYPE (exp)) < TYPE_PRECISION (TREE_TYPE (decl)))
|
||||
return error_mark_node;
|
||||
|
||||
if (exp == decl)
|
||||
return build_int_cst (TREE_TYPE (exp), 0);
|
||||
|
||||
switch (TREE_CODE (exp))
|
||||
{
|
||||
case NOP_EXPR:
|
||||
t = check_omp_for_incr_expr (TREE_OPERAND (exp, 0), decl);
|
||||
if (t != error_mark_node)
|
||||
return fold_convert (TREE_TYPE (exp), t);
|
||||
break;
|
||||
case MINUS_EXPR:
|
||||
t = check_omp_for_incr_expr (TREE_OPERAND (exp, 0), decl);
|
||||
if (t != error_mark_node)
|
||||
return fold_build2 (MINUS_EXPR, TREE_TYPE (exp), t, TREE_OPERAND (exp, 1));
|
||||
break;
|
||||
case PLUS_EXPR:
|
||||
t = check_omp_for_incr_expr (TREE_OPERAND (exp, 0), decl);
|
||||
if (t != error_mark_node)
|
||||
return fold_build2 (PLUS_EXPR, TREE_TYPE (exp), t, TREE_OPERAND (exp, 1));
|
||||
t = check_omp_for_incr_expr (TREE_OPERAND (exp, 1), decl);
|
||||
if (t != error_mark_node)
|
||||
return fold_build2 (PLUS_EXPR, TREE_TYPE (exp), TREE_OPERAND (exp, 0), t);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
/* Validate and emit code for the OpenMP directive #pragma omp for.
|
||||
INIT, COND, INCR, BODY and PRE_BODY are the five basic elements
|
||||
of the loop (initialization expression, controlling predicate, increment
|
||||
expression, body of the loop and statements to go before the loop).
|
||||
DECL is the iteration variable. */
|
||||
|
||||
tree
|
||||
c_finish_omp_for (location_t locus, tree decl, tree init, tree cond,
|
||||
tree incr, tree body, tree pre_body)
|
||||
{
|
||||
location_t elocus = locus;
|
||||
bool fail = false;
|
||||
|
||||
if (EXPR_HAS_LOCATION (init))
|
||||
elocus = EXPR_LOCATION (init);
|
||||
|
||||
/* Validate the iteration variable. */
|
||||
if (!INTEGRAL_TYPE_P (TREE_TYPE (decl)))
|
||||
{
|
||||
error ("%Hinvalid type for iteration variable %qE", &elocus, decl);
|
||||
fail = true;
|
||||
}
|
||||
if (TYPE_UNSIGNED (TREE_TYPE (decl)))
|
||||
warning (0, "%Hiteration variable %qE is unsigned", &elocus, decl);
|
||||
|
||||
/* In the case of "for (int i = 0...)", init will be a decl. It should
|
||||
have a DECL_INITIAL that we can turn into an assignment. */
|
||||
if (init == decl)
|
||||
{
|
||||
elocus = DECL_SOURCE_LOCATION (decl);
|
||||
|
||||
init = DECL_INITIAL (decl);
|
||||
if (init == NULL)
|
||||
{
|
||||
error ("%H%qE is not initialized", &elocus, decl);
|
||||
init = integer_zero_node;
|
||||
fail = true;
|
||||
}
|
||||
|
||||
init = build_modify_expr (decl, NOP_EXPR, init);
|
||||
SET_EXPR_LOCATION (init, elocus);
|
||||
}
|
||||
gcc_assert (TREE_CODE (init) == MODIFY_EXPR);
|
||||
gcc_assert (TREE_OPERAND (init, 0) == decl);
|
||||
|
||||
if (cond == NULL_TREE)
|
||||
{
|
||||
error ("%Hmissing controlling predicate", &elocus);
|
||||
fail = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
bool cond_ok = false;
|
||||
|
||||
if (EXPR_HAS_LOCATION (cond))
|
||||
elocus = EXPR_LOCATION (cond);
|
||||
|
||||
if (TREE_CODE (cond) == LT_EXPR
|
||||
|| TREE_CODE (cond) == LE_EXPR
|
||||
|| TREE_CODE (cond) == GT_EXPR
|
||||
|| TREE_CODE (cond) == GE_EXPR)
|
||||
{
|
||||
tree op0 = TREE_OPERAND (cond, 0);
|
||||
tree op1 = TREE_OPERAND (cond, 1);
|
||||
|
||||
/* 2.5.1. The comparison in the condition is computed in the type
|
||||
of DECL, otherwise the behavior is undefined.
|
||||
|
||||
For example:
|
||||
long n; int i;
|
||||
i < n;
|
||||
|
||||
according to ISO will be evaluated as:
|
||||
(long)i < n;
|
||||
|
||||
We want to force:
|
||||
i < (int)n; */
|
||||
if (TREE_CODE (op0) == NOP_EXPR
|
||||
&& decl == TREE_OPERAND (op0, 0))
|
||||
{
|
||||
TREE_OPERAND (cond, 0) = TREE_OPERAND (op0, 0);
|
||||
TREE_OPERAND (cond, 1) = fold_build1 (NOP_EXPR, TREE_TYPE (decl),
|
||||
TREE_OPERAND (cond, 1));
|
||||
}
|
||||
else if (TREE_CODE (op1) == NOP_EXPR
|
||||
&& decl == TREE_OPERAND (op1, 0))
|
||||
{
|
||||
TREE_OPERAND (cond, 1) = TREE_OPERAND (op1, 0);
|
||||
TREE_OPERAND (cond, 0) = fold_build1 (NOP_EXPR, TREE_TYPE (decl),
|
||||
TREE_OPERAND (cond, 0));
|
||||
}
|
||||
|
||||
if (decl == TREE_OPERAND (cond, 0))
|
||||
cond_ok = true;
|
||||
else if (decl == TREE_OPERAND (cond, 1))
|
||||
{
|
||||
TREE_SET_CODE (cond, swap_tree_comparison (TREE_CODE (cond)));
|
||||
TREE_OPERAND (cond, 1) = TREE_OPERAND (cond, 0);
|
||||
TREE_OPERAND (cond, 0) = decl;
|
||||
cond_ok = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!cond_ok)
|
||||
{
|
||||
error ("%Hinvalid controlling predicate", &elocus);
|
||||
fail = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (incr == NULL_TREE)
|
||||
{
|
||||
error ("%Hmissing increment expression", &elocus);
|
||||
fail = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
bool incr_ok = false;
|
||||
|
||||
if (EXPR_HAS_LOCATION (incr))
|
||||
elocus = EXPR_LOCATION (incr);
|
||||
|
||||
/* Check all the valid increment expressions: v++, v--, ++v, --v,
|
||||
v = v + incr, v = incr + v and v = v - incr. */
|
||||
switch (TREE_CODE (incr))
|
||||
{
|
||||
case POSTINCREMENT_EXPR:
|
||||
case PREINCREMENT_EXPR:
|
||||
case POSTDECREMENT_EXPR:
|
||||
case PREDECREMENT_EXPR:
|
||||
incr_ok = (TREE_OPERAND (incr, 0) == decl);
|
||||
break;
|
||||
|
||||
case MODIFY_EXPR:
|
||||
if (TREE_OPERAND (incr, 0) != decl)
|
||||
break;
|
||||
if (TREE_OPERAND (incr, 1) == decl)
|
||||
break;
|
||||
if (TREE_CODE (TREE_OPERAND (incr, 1)) == PLUS_EXPR
|
||||
&& (TREE_OPERAND (TREE_OPERAND (incr, 1), 0) == decl
|
||||
|| TREE_OPERAND (TREE_OPERAND (incr, 1), 1) == decl))
|
||||
incr_ok = true;
|
||||
else if (TREE_CODE (TREE_OPERAND (incr, 1)) == MINUS_EXPR
|
||||
&& TREE_OPERAND (TREE_OPERAND (incr, 1), 0) == decl)
|
||||
incr_ok = true;
|
||||
else
|
||||
{
|
||||
tree t = check_omp_for_incr_expr (TREE_OPERAND (incr, 1), decl);
|
||||
if (t != error_mark_node)
|
||||
{
|
||||
incr_ok = true;
|
||||
t = build2 (PLUS_EXPR, TREE_TYPE (decl), decl, t);
|
||||
incr = build2 (MODIFY_EXPR, void_type_node, decl, t);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (!incr_ok)
|
||||
{
|
||||
error ("%Hinvalid increment expression", &elocus);
|
||||
fail = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (fail)
|
||||
return NULL;
|
||||
else
|
||||
{
|
||||
tree t = make_node (OMP_FOR);
|
||||
|
||||
TREE_TYPE (t) = void_type_node;
|
||||
OMP_FOR_INIT (t) = init;
|
||||
OMP_FOR_COND (t) = cond;
|
||||
OMP_FOR_INCR (t) = incr;
|
||||
OMP_FOR_BODY (t) = body;
|
||||
OMP_FOR_PRE_BODY (t) = pre_body;
|
||||
|
||||
SET_EXPR_LOCATION (t, locus);
|
||||
return add_stmt (t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Divide CLAUSES into two lists: those that apply to a parallel construct,
|
||||
and those that apply to a work-sharing construct. Place the results in
|
||||
*PAR_CLAUSES and *WS_CLAUSES respectively. In addition, add a nowait
|
||||
clause to the work-sharing list. */
|
||||
|
||||
void
|
||||
c_split_parallel_clauses (tree clauses, tree *par_clauses, tree *ws_clauses)
|
||||
{
|
||||
tree next;
|
||||
|
||||
*par_clauses = NULL;
|
||||
*ws_clauses = build_omp_clause (OMP_CLAUSE_NOWAIT);
|
||||
|
||||
for (; clauses ; clauses = next)
|
||||
{
|
||||
next = OMP_CLAUSE_CHAIN (clauses);
|
||||
|
||||
switch (OMP_CLAUSE_CODE (clauses))
|
||||
{
|
||||
case OMP_CLAUSE_PRIVATE:
|
||||
case OMP_CLAUSE_SHARED:
|
||||
case OMP_CLAUSE_FIRSTPRIVATE:
|
||||
case OMP_CLAUSE_LASTPRIVATE:
|
||||
case OMP_CLAUSE_REDUCTION:
|
||||
case OMP_CLAUSE_COPYIN:
|
||||
case OMP_CLAUSE_IF:
|
||||
case OMP_CLAUSE_NUM_THREADS:
|
||||
case OMP_CLAUSE_DEFAULT:
|
||||
OMP_CLAUSE_CHAIN (clauses) = *par_clauses;
|
||||
*par_clauses = clauses;
|
||||
break;
|
||||
|
||||
case OMP_CLAUSE_SCHEDULE:
|
||||
case OMP_CLAUSE_ORDERED:
|
||||
OMP_CLAUSE_CHAIN (clauses) = *ws_clauses;
|
||||
*ws_clauses = clauses;
|
||||
break;
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* True if OpenMP sharing attribute of DECL is predetermined. */
|
||||
|
||||
enum omp_clause_default_kind
|
||||
c_omp_predetermined_sharing (tree decl)
|
||||
{
|
||||
/* Variables with const-qualified type having no mutable member
|
||||
are predetermined shared. */
|
||||
if (TREE_READONLY (decl))
|
||||
return OMP_CLAUSE_DEFAULT_SHARED;
|
||||
|
||||
return OMP_CLAUSE_DEFAULT_UNSPECIFIED;
|
||||
}
|
1611
contrib/gcc/c-opts.c
1611
contrib/gcc/c-opts.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,481 +0,0 @@
|
||||
/* Precompiled header implementation for the C languages.
|
||||
Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "version.h"
|
||||
#include "cpplib.h"
|
||||
#include "tree.h"
|
||||
#include "flags.h"
|
||||
#include "c-common.h"
|
||||
#include "output.h"
|
||||
#include "toplev.h"
|
||||
#include "debug.h"
|
||||
#include "c-pragma.h"
|
||||
#include "ggc.h"
|
||||
#include "langhooks.h"
|
||||
#include "hosthooks.h"
|
||||
#include "target.h"
|
||||
|
||||
/* This is a list of flag variables that must match exactly, and their
|
||||
names for the error message. The possible values for *flag_var must
|
||||
fit in a 'signed char'. */
|
||||
|
||||
static const struct c_pch_matching
|
||||
{
|
||||
int *flag_var;
|
||||
const char *flag_name;
|
||||
} pch_matching[] = {
|
||||
{ &flag_exceptions, "-fexceptions" },
|
||||
{ &flag_unit_at_a_time, "-funit-at-a-time" }
|
||||
};
|
||||
|
||||
enum {
|
||||
MATCH_SIZE = ARRAY_SIZE (pch_matching)
|
||||
};
|
||||
|
||||
/* The value of the checksum in the dummy compiler that is actually
|
||||
checksummed. That compiler should never be run. */
|
||||
static const char no_checksum[16] = { 0 };
|
||||
|
||||
/* Information about flags and suchlike that affect PCH validity.
|
||||
|
||||
Before this structure is read, both an initial 8-character identification
|
||||
string, and a 16-byte checksum, have been read and validated. */
|
||||
|
||||
struct c_pch_validity
|
||||
{
|
||||
unsigned char debug_info_type;
|
||||
signed char match[MATCH_SIZE];
|
||||
void (*pch_init) (void);
|
||||
size_t target_data_length;
|
||||
};
|
||||
|
||||
struct c_pch_header
|
||||
{
|
||||
unsigned long asm_size;
|
||||
};
|
||||
|
||||
#define IDENT_LENGTH 8
|
||||
|
||||
/* The file we'll be writing the PCH to. */
|
||||
static FILE *pch_outfile;
|
||||
|
||||
/* The position in the assembler output file when pch_init was called. */
|
||||
static long asm_file_startpos;
|
||||
|
||||
static const char *get_ident (void);
|
||||
|
||||
/* Compute an appropriate 8-byte magic number for the PCH file, so that
|
||||
utilities like file(1) can identify it, and so that GCC can quickly
|
||||
ignore non-PCH files and PCH files that are of a completely different
|
||||
format. */
|
||||
|
||||
static const char *
|
||||
get_ident (void)
|
||||
{
|
||||
static char result[IDENT_LENGTH];
|
||||
static const char template[IDENT_LENGTH] = "gpch.013";
|
||||
static const char c_language_chars[] = "Co+O";
|
||||
|
||||
memcpy (result, template, IDENT_LENGTH);
|
||||
result[4] = c_language_chars[c_language];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Prepare to write a PCH file, if one is being written. This is
|
||||
called at the start of compilation.
|
||||
|
||||
Also, print out the executable checksum if -fverbose-asm is in effect. */
|
||||
|
||||
void
|
||||
pch_init (void)
|
||||
{
|
||||
FILE *f;
|
||||
struct c_pch_validity v;
|
||||
void *target_validity;
|
||||
static const char partial_pch[IDENT_LENGTH] = "gpcWrite";
|
||||
|
||||
#ifdef ASM_COMMENT_START
|
||||
if (flag_verbose_asm)
|
||||
{
|
||||
fprintf (asm_out_file, "%s ", ASM_COMMENT_START);
|
||||
c_common_print_pch_checksum (asm_out_file);
|
||||
fputc ('\n', asm_out_file);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!pch_file)
|
||||
return;
|
||||
|
||||
f = fopen (pch_file, "w+b");
|
||||
if (f == NULL)
|
||||
fatal_error ("can%'t create precompiled header %s: %m", pch_file);
|
||||
pch_outfile = f;
|
||||
|
||||
gcc_assert (memcmp (executable_checksum, no_checksum, 16) != 0);
|
||||
|
||||
v.debug_info_type = write_symbols;
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < MATCH_SIZE; i++)
|
||||
{
|
||||
v.match[i] = *pch_matching[i].flag_var;
|
||||
gcc_assert (v.match[i] == *pch_matching[i].flag_var);
|
||||
}
|
||||
}
|
||||
v.pch_init = &pch_init;
|
||||
target_validity = targetm.get_pch_validity (&v.target_data_length);
|
||||
|
||||
if (fwrite (partial_pch, IDENT_LENGTH, 1, f) != 1
|
||||
|| fwrite (executable_checksum, 16, 1, f) != 1
|
||||
|| fwrite (&v, sizeof (v), 1, f) != 1
|
||||
|| fwrite (target_validity, v.target_data_length, 1, f) != 1)
|
||||
fatal_error ("can%'t write to %s: %m", pch_file);
|
||||
|
||||
/* We need to be able to re-read the output. */
|
||||
/* The driver always provides a valid -o option. */
|
||||
if (asm_file_name == NULL
|
||||
|| strcmp (asm_file_name, "-") == 0)
|
||||
fatal_error ("%qs is not a valid output file", asm_file_name);
|
||||
|
||||
asm_file_startpos = ftell (asm_out_file);
|
||||
|
||||
/* Let the debugging format deal with the PCHness. */
|
||||
(*debug_hooks->handle_pch) (0);
|
||||
|
||||
cpp_save_state (parse_in, f);
|
||||
}
|
||||
|
||||
/* Write the PCH file. This is called at the end of a compilation which
|
||||
will produce a PCH file. */
|
||||
|
||||
void
|
||||
c_common_write_pch (void)
|
||||
{
|
||||
char *buf;
|
||||
long asm_file_end;
|
||||
long written;
|
||||
struct c_pch_header h;
|
||||
|
||||
(*debug_hooks->handle_pch) (1);
|
||||
|
||||
cpp_write_pch_deps (parse_in, pch_outfile);
|
||||
|
||||
asm_file_end = ftell (asm_out_file);
|
||||
h.asm_size = asm_file_end - asm_file_startpos;
|
||||
|
||||
if (fwrite (&h, sizeof (h), 1, pch_outfile) != 1)
|
||||
fatal_error ("can%'t write %s: %m", pch_file);
|
||||
|
||||
buf = XNEWVEC (char, 16384);
|
||||
|
||||
if (fseek (asm_out_file, asm_file_startpos, SEEK_SET) != 0)
|
||||
fatal_error ("can%'t seek in %s: %m", asm_file_name);
|
||||
|
||||
for (written = asm_file_startpos; written < asm_file_end; )
|
||||
{
|
||||
long size = asm_file_end - written;
|
||||
if (size > 16384)
|
||||
size = 16384;
|
||||
if (fread (buf, size, 1, asm_out_file) != 1)
|
||||
fatal_error ("can%'t read %s: %m", asm_file_name);
|
||||
if (fwrite (buf, size, 1, pch_outfile) != 1)
|
||||
fatal_error ("can%'t write %s: %m", pch_file);
|
||||
written += size;
|
||||
}
|
||||
free (buf);
|
||||
/* asm_out_file can be written afterwards, so fseek to clear
|
||||
_IOREAD flag. */
|
||||
if (fseek (asm_out_file, 0, SEEK_END) != 0)
|
||||
fatal_error ("can%'t seek in %s: %m", asm_file_name);
|
||||
|
||||
gt_pch_save (pch_outfile);
|
||||
cpp_write_pch_state (parse_in, pch_outfile);
|
||||
|
||||
if (fseek (pch_outfile, 0, SEEK_SET) != 0
|
||||
|| fwrite (get_ident (), IDENT_LENGTH, 1, pch_outfile) != 1)
|
||||
fatal_error ("can%'t write %s: %m", pch_file);
|
||||
|
||||
fclose (pch_outfile);
|
||||
}
|
||||
|
||||
/* Check the PCH file called NAME, open on FD, to see if it can be
|
||||
used in this compilation. Return 1 if valid, 0 if the file can't
|
||||
be used now but might be if it's seen later in the compilation, and
|
||||
2 if this file could never be used in the compilation. */
|
||||
|
||||
int
|
||||
c_common_valid_pch (cpp_reader *pfile, const char *name, int fd)
|
||||
{
|
||||
int sizeread;
|
||||
int result;
|
||||
char ident[IDENT_LENGTH + 16];
|
||||
const char *pch_ident;
|
||||
struct c_pch_validity v;
|
||||
|
||||
/* Perform a quick test of whether this is a valid
|
||||
precompiled header for the current language. */
|
||||
|
||||
gcc_assert (memcmp (executable_checksum, no_checksum, 16) != 0);
|
||||
|
||||
sizeread = read (fd, ident, IDENT_LENGTH + 16);
|
||||
if (sizeread == -1)
|
||||
fatal_error ("can%'t read %s: %m", name);
|
||||
else if (sizeread != IDENT_LENGTH + 16)
|
||||
{
|
||||
cpp_error (pfile, CPP_DL_WARNING, "%s: too short to be a PCH file",
|
||||
name);
|
||||
return 2;
|
||||
}
|
||||
|
||||
pch_ident = get_ident();
|
||||
if (memcmp (ident, pch_ident, IDENT_LENGTH) != 0)
|
||||
{
|
||||
if (cpp_get_options (pfile)->warn_invalid_pch)
|
||||
{
|
||||
if (memcmp (ident, pch_ident, 5) == 0)
|
||||
/* It's a PCH, for the right language, but has the wrong version.
|
||||
*/
|
||||
cpp_error (pfile, CPP_DL_WARNING,
|
||||
"%s: not compatible with this GCC version", name);
|
||||
else if (memcmp (ident, pch_ident, 4) == 0)
|
||||
/* It's a PCH for the wrong language. */
|
||||
cpp_error (pfile, CPP_DL_WARNING, "%s: not for %s", name,
|
||||
lang_hooks.name);
|
||||
else
|
||||
/* Not any kind of PCH. */
|
||||
cpp_error (pfile, CPP_DL_WARNING, "%s: not a PCH file", name);
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
if (memcmp (ident + IDENT_LENGTH, executable_checksum, 16) != 0)
|
||||
{
|
||||
if (cpp_get_options (pfile)->warn_invalid_pch)
|
||||
cpp_error (pfile, CPP_DL_WARNING,
|
||||
"%s: created by a different GCC executable", name);
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* At this point, we know it's a PCH file created by this
|
||||
executable, so it ought to be long enough that we can read a
|
||||
c_pch_validity structure. */
|
||||
if (read (fd, &v, sizeof (v)) != sizeof (v))
|
||||
fatal_error ("can%'t read %s: %m", name);
|
||||
|
||||
/* The allowable debug info combinations are that either the PCH file
|
||||
was built with the same as is being used now, or the PCH file was
|
||||
built for some kind of debug info but now none is in use. */
|
||||
if (v.debug_info_type != write_symbols
|
||||
&& write_symbols != NO_DEBUG)
|
||||
{
|
||||
if (cpp_get_options (pfile)->warn_invalid_pch)
|
||||
cpp_error (pfile, CPP_DL_WARNING,
|
||||
"%s: created with -g%s, but used with -g%s", name,
|
||||
debug_type_names[v.debug_info_type],
|
||||
debug_type_names[write_symbols]);
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* Check flags that must match exactly. */
|
||||
{
|
||||
size_t i;
|
||||
for (i = 0; i < MATCH_SIZE; i++)
|
||||
if (*pch_matching[i].flag_var != v.match[i])
|
||||
{
|
||||
if (cpp_get_options (pfile)->warn_invalid_pch)
|
||||
cpp_error (pfile, CPP_DL_WARNING,
|
||||
"%s: settings for %s do not match", name,
|
||||
pch_matching[i].flag_name);
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
/* If the text segment was not loaded at the same address as it was
|
||||
when the PCH file was created, function pointers loaded from the
|
||||
PCH will not be valid. We could in theory remap all the function
|
||||
pointers, but no support for that exists at present.
|
||||
Since we have the same executable, it should only be necessary to
|
||||
check one function. */
|
||||
if (v.pch_init != &pch_init)
|
||||
{
|
||||
if (cpp_get_options (pfile)->warn_invalid_pch)
|
||||
cpp_error (pfile, CPP_DL_WARNING,
|
||||
"%s: had text segment at different address", name);
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* Check the target-specific validity data. */
|
||||
{
|
||||
void *this_file_data = xmalloc (v.target_data_length);
|
||||
const char *msg;
|
||||
|
||||
if ((size_t) read (fd, this_file_data, v.target_data_length)
|
||||
!= v.target_data_length)
|
||||
fatal_error ("can%'t read %s: %m", name);
|
||||
msg = targetm.pch_valid_p (this_file_data, v.target_data_length);
|
||||
free (this_file_data);
|
||||
if (msg != NULL)
|
||||
{
|
||||
if (cpp_get_options (pfile)->warn_invalid_pch)
|
||||
cpp_error (pfile, CPP_DL_WARNING, "%s: %s", name, msg);
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
/* Check the preprocessor macros are the same as when the PCH was
|
||||
generated. */
|
||||
|
||||
result = cpp_valid_state (pfile, name, fd);
|
||||
if (result == -1)
|
||||
return 2;
|
||||
else
|
||||
return result == 0;
|
||||
}
|
||||
|
||||
/* If non-NULL, this function is called after a precompile header file
|
||||
is loaded. */
|
||||
void (*lang_post_pch_load) (void);
|
||||
|
||||
/* Load in the PCH file NAME, open on FD. It was originally searched for
|
||||
by ORIG_NAME. */
|
||||
|
||||
void
|
||||
c_common_read_pch (cpp_reader *pfile, const char *name,
|
||||
int fd, const char *orig_name ATTRIBUTE_UNUSED)
|
||||
{
|
||||
FILE *f;
|
||||
struct c_pch_header h;
|
||||
struct save_macro_data *smd;
|
||||
|
||||
f = fdopen (fd, "rb");
|
||||
if (f == NULL)
|
||||
{
|
||||
cpp_errno (pfile, CPP_DL_ERROR, "calling fdopen");
|
||||
return;
|
||||
}
|
||||
|
||||
cpp_get_callbacks (parse_in)->valid_pch = NULL;
|
||||
|
||||
if (fread (&h, sizeof (h), 1, f) != 1)
|
||||
{
|
||||
cpp_errno (pfile, CPP_DL_ERROR, "reading");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!flag_preprocess_only)
|
||||
{
|
||||
unsigned long written;
|
||||
char * buf = XNEWVEC (char, 16384);
|
||||
|
||||
for (written = 0; written < h.asm_size; )
|
||||
{
|
||||
long size = h.asm_size - written;
|
||||
if (size > 16384)
|
||||
size = 16384;
|
||||
if (fread (buf, size, 1, f) != 1
|
||||
|| fwrite (buf, size, 1, asm_out_file) != 1)
|
||||
cpp_errno (pfile, CPP_DL_ERROR, "reading");
|
||||
written += size;
|
||||
}
|
||||
free (buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If we're preprocessing, don't write to a NULL
|
||||
asm_out_file. */
|
||||
if (fseek (f, h.asm_size, SEEK_CUR) != 0)
|
||||
cpp_errno (pfile, CPP_DL_ERROR, "seeking");
|
||||
}
|
||||
|
||||
cpp_prepare_state (pfile, &smd);
|
||||
|
||||
gt_pch_restore (f);
|
||||
|
||||
if (cpp_read_state (pfile, name, f, smd) != 0)
|
||||
return;
|
||||
|
||||
fclose (f);
|
||||
|
||||
/* Give the front end a chance to take action after a PCH file has
|
||||
been loaded. */
|
||||
if (lang_post_pch_load)
|
||||
(*lang_post_pch_load) ();
|
||||
}
|
||||
|
||||
/* Indicate that no more PCH files should be read. */
|
||||
|
||||
void
|
||||
c_common_no_more_pch (void)
|
||||
{
|
||||
if (cpp_get_callbacks (parse_in)->valid_pch)
|
||||
{
|
||||
cpp_get_callbacks (parse_in)->valid_pch = NULL;
|
||||
host_hooks.gt_pch_use_address (NULL, 0, -1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Handle #pragma GCC pch_preprocess, to load in the PCH file. */
|
||||
|
||||
#ifndef O_BINARY
|
||||
# define O_BINARY 0
|
||||
#endif
|
||||
|
||||
void
|
||||
c_common_pch_pragma (cpp_reader *pfile, const char *name)
|
||||
{
|
||||
int fd;
|
||||
|
||||
if (!cpp_get_options (pfile)->preprocessed)
|
||||
{
|
||||
error ("pch_preprocess pragma should only be used with -fpreprocessed");
|
||||
inform ("use #include instead");
|
||||
return;
|
||||
}
|
||||
|
||||
fd = open (name, O_RDONLY | O_BINARY, 0666);
|
||||
if (fd == -1)
|
||||
fatal_error ("%s: couldn%'t open PCH file: %m", name);
|
||||
|
||||
if (c_common_valid_pch (pfile, name, fd) != 1)
|
||||
{
|
||||
if (!cpp_get_options (pfile)->warn_invalid_pch)
|
||||
inform ("use -Winvalid-pch for more information");
|
||||
fatal_error ("%s: PCH file was invalid", name);
|
||||
}
|
||||
|
||||
c_common_read_pch (pfile, name, fd, name);
|
||||
|
||||
close (fd);
|
||||
}
|
||||
|
||||
/* Print out executable_checksum[]. */
|
||||
|
||||
void
|
||||
c_common_print_pch_checksum (FILE *f)
|
||||
{
|
||||
int i;
|
||||
fputs ("Compiler executable checksum: ", f);
|
||||
for (i = 0; i < 16; i++)
|
||||
fprintf (f, "%02x", executable_checksum[i]);
|
||||
putc ('\n', f);
|
||||
}
|
@ -1,483 +0,0 @@
|
||||
/* Preprocess only, using cpplib.
|
||||
Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
|
||||
Free Software Foundation, Inc.
|
||||
Written by Per Bothner, 1994-95.
|
||||
|
||||
This program 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 2, or (at your option) any
|
||||
later version.
|
||||
|
||||
This program 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 this program; if not, write to the Free Software
|
||||
Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "cpplib.h"
|
||||
#include "../libcpp/internal.h"
|
||||
#include "tree.h"
|
||||
#include "c-common.h" /* For flags. */
|
||||
#include "c-pragma.h" /* For parse_in. */
|
||||
|
||||
/* Encapsulates state used to convert a stream of tokens into a text
|
||||
file. */
|
||||
static struct
|
||||
{
|
||||
FILE *outf; /* Stream to write to. */
|
||||
const cpp_token *prev; /* Previous token. */
|
||||
const cpp_token *source; /* Source token for spacing. */
|
||||
int src_line; /* Line number currently being written. */
|
||||
unsigned char printed; /* Nonzero if something output at line. */
|
||||
bool first_time; /* pp_file_change hasn't been called yet. */
|
||||
} print;
|
||||
|
||||
/* General output routines. */
|
||||
static void scan_translation_unit (cpp_reader *);
|
||||
static void print_lines_directives_only (int, const void *, size_t);
|
||||
static void scan_translation_unit_directives_only (cpp_reader *);
|
||||
static void scan_translation_unit_trad (cpp_reader *);
|
||||
static void account_for_newlines (const unsigned char *, size_t);
|
||||
static int dump_macro (cpp_reader *, cpp_hashnode *, void *);
|
||||
|
||||
static void print_line (source_location, const char *);
|
||||
static void maybe_print_line (source_location);
|
||||
|
||||
/* Callback routines for the parser. Most of these are active only
|
||||
in specific modes. */
|
||||
static void cb_line_change (cpp_reader *, const cpp_token *, int);
|
||||
static void cb_define (cpp_reader *, source_location, cpp_hashnode *);
|
||||
static void cb_undef (cpp_reader *, source_location, cpp_hashnode *);
|
||||
static void cb_include (cpp_reader *, source_location, const unsigned char *,
|
||||
const char *, int, const cpp_token **);
|
||||
static void cb_ident (cpp_reader *, source_location, const cpp_string *);
|
||||
static void cb_def_pragma (cpp_reader *, source_location);
|
||||
static void cb_read_pch (cpp_reader *pfile, const char *name,
|
||||
int fd, const char *orig_name);
|
||||
|
||||
/* Preprocess and output. */
|
||||
void
|
||||
preprocess_file (cpp_reader *pfile)
|
||||
{
|
||||
/* A successful cpp_read_main_file guarantees that we can call
|
||||
cpp_scan_nooutput or cpp_get_token next. */
|
||||
if (flag_no_output)
|
||||
{
|
||||
/* Scan -included buffers, then the main file. */
|
||||
while (pfile->buffer->prev)
|
||||
cpp_scan_nooutput (pfile);
|
||||
cpp_scan_nooutput (pfile);
|
||||
}
|
||||
else if (cpp_get_options (pfile)->traditional)
|
||||
scan_translation_unit_trad (pfile);
|
||||
else if (cpp_get_options (pfile)->directives_only
|
||||
&& !cpp_get_options (pfile)->preprocessed)
|
||||
scan_translation_unit_directives_only (pfile);
|
||||
else
|
||||
scan_translation_unit (pfile);
|
||||
|
||||
/* -dM command line option. Should this be elsewhere? */
|
||||
if (flag_dump_macros == 'M')
|
||||
cpp_forall_identifiers (pfile, dump_macro, NULL);
|
||||
|
||||
/* Flush any pending output. */
|
||||
if (print.printed)
|
||||
putc ('\n', print.outf);
|
||||
}
|
||||
|
||||
/* Set up the callbacks as appropriate. */
|
||||
void
|
||||
init_pp_output (FILE *out_stream)
|
||||
{
|
||||
cpp_callbacks *cb = cpp_get_callbacks (parse_in);
|
||||
|
||||
if (!flag_no_output)
|
||||
{
|
||||
cb->line_change = cb_line_change;
|
||||
/* Don't emit #pragma or #ident directives if we are processing
|
||||
assembly language; the assembler may choke on them. */
|
||||
if (cpp_get_options (parse_in)->lang != CLK_ASM)
|
||||
{
|
||||
cb->ident = cb_ident;
|
||||
cb->def_pragma = cb_def_pragma;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag_dump_includes)
|
||||
cb->include = cb_include;
|
||||
|
||||
if (flag_pch_preprocess)
|
||||
{
|
||||
cb->valid_pch = c_common_valid_pch;
|
||||
cb->read_pch = cb_read_pch;
|
||||
}
|
||||
|
||||
if (flag_dump_macros == 'N' || flag_dump_macros == 'D')
|
||||
{
|
||||
cb->define = cb_define;
|
||||
cb->undef = cb_undef;
|
||||
}
|
||||
|
||||
/* Initialize the print structure. Setting print.src_line to -1 here is
|
||||
a trick to guarantee that the first token of the file will cause
|
||||
a linemarker to be output by maybe_print_line. */
|
||||
print.src_line = -1;
|
||||
print.printed = 0;
|
||||
print.prev = 0;
|
||||
print.outf = out_stream;
|
||||
print.first_time = 1;
|
||||
}
|
||||
|
||||
/* Writes out the preprocessed file, handling spacing and paste
|
||||
avoidance issues. */
|
||||
static void
|
||||
scan_translation_unit (cpp_reader *pfile)
|
||||
{
|
||||
bool avoid_paste = false;
|
||||
|
||||
print.source = NULL;
|
||||
for (;;)
|
||||
{
|
||||
const cpp_token *token = cpp_get_token (pfile);
|
||||
|
||||
if (token->type == CPP_PADDING)
|
||||
{
|
||||
avoid_paste = true;
|
||||
if (print.source == NULL
|
||||
|| (!(print.source->flags & PREV_WHITE)
|
||||
&& token->val.source == NULL))
|
||||
print.source = token->val.source;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (token->type == CPP_EOF)
|
||||
break;
|
||||
|
||||
/* Subtle logic to output a space if and only if necessary. */
|
||||
if (avoid_paste)
|
||||
{
|
||||
if (print.source == NULL)
|
||||
print.source = token;
|
||||
if (print.source->flags & PREV_WHITE
|
||||
|| (print.prev
|
||||
&& cpp_avoid_paste (pfile, print.prev, token))
|
||||
|| (print.prev == NULL && token->type == CPP_HASH))
|
||||
putc (' ', print.outf);
|
||||
}
|
||||
else if (token->flags & PREV_WHITE)
|
||||
putc (' ', print.outf);
|
||||
|
||||
avoid_paste = false;
|
||||
print.source = NULL;
|
||||
print.prev = token;
|
||||
cpp_output_token (token, print.outf);
|
||||
|
||||
if (token->type == CPP_COMMENT)
|
||||
account_for_newlines (token->val.str.text, token->val.str.len);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_lines_directives_only (int lines, const void *buf, size_t size)
|
||||
{
|
||||
print.src_line += lines;
|
||||
fwrite (buf, 1, size, print.outf);
|
||||
}
|
||||
|
||||
/* Writes out the preprocessed file, handling spacing and paste
|
||||
avoidance issues. */
|
||||
static void
|
||||
scan_translation_unit_directives_only (cpp_reader *pfile)
|
||||
{
|
||||
struct _cpp_dir_only_callbacks cb;
|
||||
|
||||
cb.print_lines = print_lines_directives_only;
|
||||
cb.maybe_print_line = maybe_print_line;
|
||||
|
||||
_cpp_preprocess_dir_only (pfile, &cb);
|
||||
}
|
||||
|
||||
/* Adjust print.src_line for newlines embedded in output. */
|
||||
static void
|
||||
account_for_newlines (const unsigned char *str, size_t len)
|
||||
{
|
||||
while (len--)
|
||||
if (*str++ == '\n')
|
||||
print.src_line++;
|
||||
}
|
||||
|
||||
/* Writes out a traditionally preprocessed file. */
|
||||
static void
|
||||
scan_translation_unit_trad (cpp_reader *pfile)
|
||||
{
|
||||
while (_cpp_read_logical_line_trad (pfile))
|
||||
{
|
||||
size_t len = pfile->out.cur - pfile->out.base;
|
||||
maybe_print_line (pfile->out.first_line);
|
||||
fwrite (pfile->out.base, 1, len, print.outf);
|
||||
print.printed = 1;
|
||||
if (!CPP_OPTION (pfile, discard_comments))
|
||||
account_for_newlines (pfile->out.base, len);
|
||||
}
|
||||
}
|
||||
|
||||
/* If the token read on logical line LINE needs to be output on a
|
||||
different line to the current one, output the required newlines or
|
||||
a line marker, and return 1. Otherwise return 0. */
|
||||
static void
|
||||
maybe_print_line (source_location src_loc)
|
||||
{
|
||||
const struct line_map *map = linemap_lookup (&line_table, src_loc);
|
||||
int src_line = SOURCE_LINE (map, src_loc);
|
||||
/* End the previous line of text. */
|
||||
if (print.printed)
|
||||
{
|
||||
putc ('\n', print.outf);
|
||||
print.src_line++;
|
||||
print.printed = 0;
|
||||
}
|
||||
|
||||
if (src_line >= print.src_line && src_line < print.src_line + 8)
|
||||
{
|
||||
while (src_line > print.src_line)
|
||||
{
|
||||
putc ('\n', print.outf);
|
||||
print.src_line++;
|
||||
}
|
||||
}
|
||||
else
|
||||
print_line (src_loc, "");
|
||||
}
|
||||
|
||||
/* Output a line marker for logical line LINE. Special flags are "1"
|
||||
or "2" indicating entering or leaving a file. */
|
||||
static void
|
||||
print_line (source_location src_loc, const char *special_flags)
|
||||
{
|
||||
/* End any previous line of text. */
|
||||
if (print.printed)
|
||||
putc ('\n', print.outf);
|
||||
print.printed = 0;
|
||||
|
||||
if (!flag_no_line_commands)
|
||||
{
|
||||
const struct line_map *map = linemap_lookup (&line_table, src_loc);
|
||||
|
||||
size_t to_file_len = strlen (map->to_file);
|
||||
unsigned char *to_file_quoted =
|
||||
(unsigned char *) alloca (to_file_len * 4 + 1);
|
||||
unsigned char *p;
|
||||
|
||||
print.src_line = SOURCE_LINE (map, src_loc);
|
||||
|
||||
/* cpp_quote_string does not nul-terminate, so we have to do it
|
||||
ourselves. */
|
||||
p = cpp_quote_string (to_file_quoted,
|
||||
(unsigned char *) map->to_file, to_file_len);
|
||||
*p = '\0';
|
||||
fprintf (print.outf, "# %u \"%s\"%s",
|
||||
print.src_line == 0 ? 1 : print.src_line,
|
||||
to_file_quoted, special_flags);
|
||||
|
||||
if (map->sysp == 2)
|
||||
fputs (" 3 4", print.outf);
|
||||
else if (map->sysp == 1)
|
||||
fputs (" 3", print.outf);
|
||||
|
||||
putc ('\n', print.outf);
|
||||
}
|
||||
}
|
||||
|
||||
/* Called when a line of output is started. TOKEN is the first token
|
||||
of the line, and at end of file will be CPP_EOF. */
|
||||
static void
|
||||
cb_line_change (cpp_reader *pfile, const cpp_token *token,
|
||||
int parsing_args)
|
||||
{
|
||||
source_location src_loc = token->src_loc;
|
||||
|
||||
if (token->type == CPP_EOF || parsing_args)
|
||||
return;
|
||||
|
||||
maybe_print_line (src_loc);
|
||||
print.prev = 0;
|
||||
print.source = 0;
|
||||
|
||||
/* Supply enough spaces to put this token in its original column,
|
||||
one space per column greater than 2, since scan_translation_unit
|
||||
will provide a space if PREV_WHITE. Don't bother trying to
|
||||
reconstruct tabs; we can't get it right in general, and nothing
|
||||
ought to care. Some things do care; the fault lies with them. */
|
||||
if (!CPP_OPTION (pfile, traditional))
|
||||
{
|
||||
const struct line_map *map = linemap_lookup (&line_table, src_loc);
|
||||
int spaces = SOURCE_COLUMN (map, src_loc) - 2;
|
||||
print.printed = 1;
|
||||
|
||||
while (-- spaces >= 0)
|
||||
putc (' ', print.outf);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
cb_ident (cpp_reader *pfile ATTRIBUTE_UNUSED, source_location line,
|
||||
const cpp_string *str)
|
||||
{
|
||||
maybe_print_line (line);
|
||||
fprintf (print.outf, "#ident %s\n", str->text);
|
||||
print.src_line++;
|
||||
}
|
||||
|
||||
static void
|
||||
cb_define (cpp_reader *pfile, source_location line, cpp_hashnode *node)
|
||||
{
|
||||
maybe_print_line (line);
|
||||
fputs ("#define ", print.outf);
|
||||
|
||||
/* 'D' is whole definition; 'N' is name only. */
|
||||
if (flag_dump_macros == 'D')
|
||||
fputs ((const char *) cpp_macro_definition (pfile, node),
|
||||
print.outf);
|
||||
else
|
||||
fputs ((const char *) NODE_NAME (node), print.outf);
|
||||
|
||||
putc ('\n', print.outf);
|
||||
if (linemap_lookup (&line_table, line)->to_line != 0)
|
||||
print.src_line++;
|
||||
}
|
||||
|
||||
static void
|
||||
cb_undef (cpp_reader *pfile ATTRIBUTE_UNUSED, source_location line,
|
||||
cpp_hashnode *node)
|
||||
{
|
||||
maybe_print_line (line);
|
||||
fprintf (print.outf, "#undef %s\n", NODE_NAME (node));
|
||||
print.src_line++;
|
||||
}
|
||||
|
||||
static void
|
||||
cb_include (cpp_reader *pfile ATTRIBUTE_UNUSED, source_location line,
|
||||
const unsigned char *dir, const char *header, int angle_brackets,
|
||||
const cpp_token **comments)
|
||||
{
|
||||
maybe_print_line (line);
|
||||
if (angle_brackets)
|
||||
fprintf (print.outf, "#%s <%s>", dir, header);
|
||||
else
|
||||
fprintf (print.outf, "#%s \"%s\"", dir, header);
|
||||
|
||||
if (comments != NULL)
|
||||
{
|
||||
while (*comments != NULL)
|
||||
{
|
||||
if ((*comments)->flags & PREV_WHITE)
|
||||
putc (' ', print.outf);
|
||||
cpp_output_token (*comments, print.outf);
|
||||
++comments;
|
||||
}
|
||||
}
|
||||
|
||||
putc ('\n', print.outf);
|
||||
print.src_line++;
|
||||
}
|
||||
|
||||
/* Callback called when -fworking-director and -E to emit working
|
||||
directory in cpp output file. */
|
||||
|
||||
void
|
||||
pp_dir_change (cpp_reader *pfile ATTRIBUTE_UNUSED, const char *dir)
|
||||
{
|
||||
size_t to_file_len = strlen (dir);
|
||||
unsigned char *to_file_quoted =
|
||||
(unsigned char *) alloca (to_file_len * 4 + 1);
|
||||
unsigned char *p;
|
||||
|
||||
/* cpp_quote_string does not nul-terminate, so we have to do it ourselves. */
|
||||
p = cpp_quote_string (to_file_quoted, (unsigned char *) dir, to_file_len);
|
||||
*p = '\0';
|
||||
fprintf (print.outf, "# 1 \"%s//\"\n", to_file_quoted);
|
||||
}
|
||||
|
||||
/* The file name, line number or system header flags have changed, as
|
||||
described in MAP. */
|
||||
|
||||
void
|
||||
pp_file_change (const struct line_map *map)
|
||||
{
|
||||
const char *flags = "";
|
||||
|
||||
if (flag_no_line_commands)
|
||||
return;
|
||||
|
||||
if (map != NULL)
|
||||
{
|
||||
if (print.first_time)
|
||||
{
|
||||
/* Avoid printing foo.i when the main file is foo.c. */
|
||||
if (!cpp_get_options (parse_in)->preprocessed)
|
||||
print_line (map->start_location, flags);
|
||||
print.first_time = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Bring current file to correct line when entering a new file. */
|
||||
if (map->reason == LC_ENTER)
|
||||
{
|
||||
const struct line_map *from = INCLUDED_FROM (&line_table, map);
|
||||
maybe_print_line (LAST_SOURCE_LINE_LOCATION (from));
|
||||
}
|
||||
if (map->reason == LC_ENTER)
|
||||
flags = " 1";
|
||||
else if (map->reason == LC_LEAVE)
|
||||
flags = " 2";
|
||||
print_line (map->start_location, flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Copy a #pragma directive to the preprocessed output. */
|
||||
static void
|
||||
cb_def_pragma (cpp_reader *pfile, source_location line)
|
||||
{
|
||||
maybe_print_line (line);
|
||||
fputs ("#pragma ", print.outf);
|
||||
cpp_output_line (pfile, print.outf);
|
||||
print.src_line++;
|
||||
}
|
||||
|
||||
/* Dump out the hash table. */
|
||||
static int
|
||||
dump_macro (cpp_reader *pfile, cpp_hashnode *node, void *v ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (node->type == NT_MACRO && !(node->flags & NODE_BUILTIN))
|
||||
{
|
||||
fputs ("#define ", print.outf);
|
||||
fputs ((const char *) cpp_macro_definition (pfile, node),
|
||||
print.outf);
|
||||
putc ('\n', print.outf);
|
||||
print.src_line++;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Load in the PCH file NAME, open on FD. It was originally searched for
|
||||
by ORIG_NAME. Also, print out a #include command so that the PCH
|
||||
file can be loaded when the preprocessed output is compiled. */
|
||||
|
||||
static void
|
||||
cb_read_pch (cpp_reader *pfile, const char *name,
|
||||
int fd, const char *orig_name ATTRIBUTE_UNUSED)
|
||||
{
|
||||
c_common_read_pch (pfile, name, fd, orig_name);
|
||||
|
||||
fprintf (print.outf, "#pragma GCC pch_preprocess \"%s\"\n", name);
|
||||
print.src_line++;
|
||||
}
|
@ -1,839 +0,0 @@
|
||||
/* Handle #pragma, system V.4 style. Supports #pragma weak and #pragma pack.
|
||||
Copyright (C) 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
||||
2006 Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "rtl.h"
|
||||
#include "tree.h"
|
||||
#include "function.h"
|
||||
#include "cpplib.h"
|
||||
#include "c-pragma.h"
|
||||
#include "flags.h"
|
||||
#include "toplev.h"
|
||||
#include "ggc.h"
|
||||
#include "c-common.h"
|
||||
#include "output.h"
|
||||
#include "tm_p.h"
|
||||
#include "vec.h"
|
||||
#include "target.h"
|
||||
#include "diagnostic.h"
|
||||
#include "opts.h"
|
||||
|
||||
#define GCC_BAD(gmsgid) \
|
||||
do { warning (OPT_Wpragmas, gmsgid); return; } while (0)
|
||||
#define GCC_BAD2(gmsgid, arg) \
|
||||
do { warning (OPT_Wpragmas, gmsgid, arg); return; } while (0)
|
||||
|
||||
typedef struct align_stack GTY(())
|
||||
{
|
||||
int alignment;
|
||||
tree id;
|
||||
struct align_stack * prev;
|
||||
} align_stack;
|
||||
|
||||
static GTY(()) struct align_stack * alignment_stack;
|
||||
|
||||
#ifdef HANDLE_PRAGMA_PACK
|
||||
static void handle_pragma_pack (cpp_reader *);
|
||||
|
||||
#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
|
||||
/* If we have a "global" #pragma pack(<n>) in effect when the first
|
||||
#pragma pack(push,<n>) is encountered, this stores the value of
|
||||
maximum_field_alignment in effect. When the final pop_alignment()
|
||||
happens, we restore the value to this, not to a value of 0 for
|
||||
maximum_field_alignment. Value is in bits. */
|
||||
static int default_alignment;
|
||||
#define SET_GLOBAL_ALIGNMENT(ALIGN) (maximum_field_alignment = *(alignment_stack == NULL \
|
||||
? &default_alignment \
|
||||
: &alignment_stack->alignment) = (ALIGN))
|
||||
|
||||
static void push_alignment (int, tree);
|
||||
static void pop_alignment (tree);
|
||||
|
||||
/* Push an alignment value onto the stack. */
|
||||
static void
|
||||
push_alignment (int alignment, tree id)
|
||||
{
|
||||
align_stack * entry;
|
||||
|
||||
entry = GGC_NEW (align_stack);
|
||||
|
||||
entry->alignment = alignment;
|
||||
entry->id = id;
|
||||
entry->prev = alignment_stack;
|
||||
|
||||
/* The current value of maximum_field_alignment is not necessarily
|
||||
0 since there may be a #pragma pack(<n>) in effect; remember it
|
||||
so that we can restore it after the final #pragma pop(). */
|
||||
if (alignment_stack == NULL)
|
||||
default_alignment = maximum_field_alignment;
|
||||
|
||||
alignment_stack = entry;
|
||||
|
||||
maximum_field_alignment = alignment;
|
||||
}
|
||||
|
||||
/* Undo a push of an alignment onto the stack. */
|
||||
static void
|
||||
pop_alignment (tree id)
|
||||
{
|
||||
align_stack * entry;
|
||||
|
||||
if (alignment_stack == NULL)
|
||||
GCC_BAD ("#pragma pack (pop) encountered without matching #pragma pack (push)");
|
||||
|
||||
/* If we got an identifier, strip away everything above the target
|
||||
entry so that the next step will restore the state just below it. */
|
||||
if (id)
|
||||
{
|
||||
for (entry = alignment_stack; entry; entry = entry->prev)
|
||||
if (entry->id == id)
|
||||
{
|
||||
alignment_stack = entry;
|
||||
break;
|
||||
}
|
||||
if (entry == NULL)
|
||||
warning (OPT_Wpragmas, "\
|
||||
#pragma pack(pop, %s) encountered without matching #pragma pack(push, %s)"
|
||||
, IDENTIFIER_POINTER (id), IDENTIFIER_POINTER (id));
|
||||
}
|
||||
|
||||
entry = alignment_stack->prev;
|
||||
|
||||
maximum_field_alignment = entry ? entry->alignment : default_alignment;
|
||||
|
||||
alignment_stack = entry;
|
||||
}
|
||||
#else /* not HANDLE_PRAGMA_PACK_PUSH_POP */
|
||||
#define SET_GLOBAL_ALIGNMENT(ALIGN) (maximum_field_alignment = (ALIGN))
|
||||
#define push_alignment(ID, N) \
|
||||
GCC_BAD ("#pragma pack(push[, id], <n>) is not supported on this target")
|
||||
#define pop_alignment(ID) \
|
||||
GCC_BAD ("#pragma pack(pop[, id], <n>) is not supported on this target")
|
||||
#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
|
||||
|
||||
/* #pragma pack ()
|
||||
#pragma pack (N)
|
||||
|
||||
#pragma pack (push)
|
||||
#pragma pack (push, N)
|
||||
#pragma pack (push, ID)
|
||||
#pragma pack (push, ID, N)
|
||||
#pragma pack (pop)
|
||||
#pragma pack (pop, ID) */
|
||||
static void
|
||||
handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
|
||||
{
|
||||
tree x, id = 0;
|
||||
int align = -1;
|
||||
enum cpp_ttype token;
|
||||
enum { set, push, pop } action;
|
||||
|
||||
if (pragma_lex (&x) != CPP_OPEN_PAREN)
|
||||
GCC_BAD ("missing %<(%> after %<#pragma pack%> - ignored");
|
||||
|
||||
token = pragma_lex (&x);
|
||||
if (token == CPP_CLOSE_PAREN)
|
||||
{
|
||||
action = set;
|
||||
align = initial_max_fld_align;
|
||||
}
|
||||
else if (token == CPP_NUMBER)
|
||||
{
|
||||
if (TREE_CODE (x) != INTEGER_CST)
|
||||
GCC_BAD ("invalid constant in %<#pragma pack%> - ignored");
|
||||
align = TREE_INT_CST_LOW (x);
|
||||
action = set;
|
||||
if (pragma_lex (&x) != CPP_CLOSE_PAREN)
|
||||
GCC_BAD ("malformed %<#pragma pack%> - ignored");
|
||||
}
|
||||
else if (token == CPP_NAME)
|
||||
{
|
||||
#define GCC_BAD_ACTION do { if (action != pop) \
|
||||
GCC_BAD ("malformed %<#pragma pack(push[, id][, <n>])%> - ignored"); \
|
||||
else \
|
||||
GCC_BAD ("malformed %<#pragma pack(pop[, id])%> - ignored"); \
|
||||
} while (0)
|
||||
|
||||
const char *op = IDENTIFIER_POINTER (x);
|
||||
if (!strcmp (op, "push"))
|
||||
action = push;
|
||||
else if (!strcmp (op, "pop"))
|
||||
action = pop;
|
||||
else
|
||||
GCC_BAD2 ("unknown action %qs for %<#pragma pack%> - ignored", op);
|
||||
|
||||
while ((token = pragma_lex (&x)) == CPP_COMMA)
|
||||
{
|
||||
token = pragma_lex (&x);
|
||||
if (token == CPP_NAME && id == 0)
|
||||
{
|
||||
id = x;
|
||||
}
|
||||
else if (token == CPP_NUMBER && action == push && align == -1)
|
||||
{
|
||||
if (TREE_CODE (x) != INTEGER_CST)
|
||||
GCC_BAD ("invalid constant in %<#pragma pack%> - ignored");
|
||||
align = TREE_INT_CST_LOW (x);
|
||||
if (align == -1)
|
||||
action = set;
|
||||
}
|
||||
else
|
||||
GCC_BAD_ACTION;
|
||||
}
|
||||
|
||||
if (token != CPP_CLOSE_PAREN)
|
||||
GCC_BAD_ACTION;
|
||||
#undef GCC_BAD_ACTION
|
||||
}
|
||||
else
|
||||
GCC_BAD ("malformed %<#pragma pack%> - ignored");
|
||||
|
||||
if (pragma_lex (&x) != CPP_EOF)
|
||||
warning (OPT_Wpragmas, "junk at end of %<#pragma pack%>");
|
||||
|
||||
if (flag_pack_struct)
|
||||
GCC_BAD ("#pragma pack has no effect with -fpack-struct - ignored");
|
||||
|
||||
if (action != pop)
|
||||
switch (align)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 4:
|
||||
case 8:
|
||||
case 16:
|
||||
align *= BITS_PER_UNIT;
|
||||
break;
|
||||
case -1:
|
||||
if (action == push)
|
||||
{
|
||||
align = maximum_field_alignment;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
GCC_BAD2 ("alignment must be a small power of two, not %d", align);
|
||||
}
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case set: SET_GLOBAL_ALIGNMENT (align); break;
|
||||
case push: push_alignment (align, id); break;
|
||||
case pop: pop_alignment (id); break;
|
||||
}
|
||||
}
|
||||
#endif /* HANDLE_PRAGMA_PACK */
|
||||
|
||||
static GTY(()) tree pending_weaks;
|
||||
|
||||
#ifdef HANDLE_PRAGMA_WEAK
|
||||
static void apply_pragma_weak (tree, tree);
|
||||
static void handle_pragma_weak (cpp_reader *);
|
||||
|
||||
static void
|
||||
apply_pragma_weak (tree decl, tree value)
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
value = build_string (IDENTIFIER_LENGTH (value),
|
||||
IDENTIFIER_POINTER (value));
|
||||
decl_attributes (&decl, build_tree_list (get_identifier ("alias"),
|
||||
build_tree_list (NULL, value)),
|
||||
0);
|
||||
}
|
||||
|
||||
if (SUPPORTS_WEAK && DECL_EXTERNAL (decl) && TREE_USED (decl)
|
||||
&& !DECL_WEAK (decl) /* Don't complain about a redundant #pragma. */
|
||||
&& TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
|
||||
warning (OPT_Wpragmas, "applying #pragma weak %q+D after first use "
|
||||
"results in unspecified behavior", decl);
|
||||
|
||||
declare_weak (decl);
|
||||
}
|
||||
|
||||
void
|
||||
maybe_apply_pragma_weak (tree decl)
|
||||
{
|
||||
tree *p, t, id;
|
||||
|
||||
/* Avoid asking for DECL_ASSEMBLER_NAME when it's not needed. */
|
||||
|
||||
/* No weak symbols pending, take the short-cut. */
|
||||
if (!pending_weaks)
|
||||
return;
|
||||
/* If it's not visible outside this file, it doesn't matter whether
|
||||
it's weak. */
|
||||
if (!DECL_EXTERNAL (decl) && !TREE_PUBLIC (decl))
|
||||
return;
|
||||
/* If it's not a function or a variable, it can't be weak.
|
||||
FIXME: what kinds of things are visible outside this file but
|
||||
aren't functions or variables? Should this be an assert instead? */
|
||||
if (TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL)
|
||||
return;
|
||||
|
||||
id = DECL_ASSEMBLER_NAME (decl);
|
||||
|
||||
for (p = &pending_weaks; (t = *p) ; p = &TREE_CHAIN (t))
|
||||
if (id == TREE_PURPOSE (t))
|
||||
{
|
||||
apply_pragma_weak (decl, TREE_VALUE (t));
|
||||
*p = TREE_CHAIN (t);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Process all "#pragma weak A = B" directives where we have not seen
|
||||
a decl for A. */
|
||||
void
|
||||
maybe_apply_pending_pragma_weaks (void)
|
||||
{
|
||||
tree *p, t, alias_id, id, decl, *next;
|
||||
|
||||
for (p = &pending_weaks; (t = *p) ; p = next)
|
||||
{
|
||||
next = &TREE_CHAIN (t);
|
||||
alias_id = TREE_PURPOSE (t);
|
||||
id = TREE_VALUE (t);
|
||||
|
||||
if (TREE_VALUE (t) == NULL)
|
||||
continue;
|
||||
|
||||
decl = build_decl (FUNCTION_DECL, alias_id, default_function_type);
|
||||
|
||||
DECL_ARTIFICIAL (decl) = 1;
|
||||
TREE_PUBLIC (decl) = 1;
|
||||
DECL_EXTERNAL (decl) = 1;
|
||||
DECL_WEAK (decl) = 1;
|
||||
|
||||
assemble_alias (decl, id);
|
||||
}
|
||||
}
|
||||
|
||||
/* #pragma weak name [= value] */
|
||||
static void
|
||||
handle_pragma_weak (cpp_reader * ARG_UNUSED (dummy))
|
||||
{
|
||||
tree name, value, x, decl;
|
||||
enum cpp_ttype t;
|
||||
|
||||
value = 0;
|
||||
|
||||
if (pragma_lex (&name) != CPP_NAME)
|
||||
GCC_BAD ("malformed #pragma weak, ignored");
|
||||
t = pragma_lex (&x);
|
||||
if (t == CPP_EQ)
|
||||
{
|
||||
if (pragma_lex (&value) != CPP_NAME)
|
||||
GCC_BAD ("malformed #pragma weak, ignored");
|
||||
t = pragma_lex (&x);
|
||||
}
|
||||
if (t != CPP_EOF)
|
||||
warning (OPT_Wpragmas, "junk at end of %<#pragma weak%>");
|
||||
|
||||
decl = identifier_global_value (name);
|
||||
if (decl && DECL_P (decl))
|
||||
{
|
||||
apply_pragma_weak (decl, value);
|
||||
if (value)
|
||||
assemble_alias (decl, value);
|
||||
}
|
||||
else
|
||||
pending_weaks = tree_cons (name, value, pending_weaks);
|
||||
}
|
||||
#else
|
||||
void
|
||||
maybe_apply_pragma_weak (tree ARG_UNUSED (decl))
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
maybe_apply_pending_pragma_weaks (void)
|
||||
{
|
||||
}
|
||||
#endif /* HANDLE_PRAGMA_WEAK */
|
||||
|
||||
/* GCC supports two #pragma directives for renaming the external
|
||||
symbol associated with a declaration (DECL_ASSEMBLER_NAME), for
|
||||
compatibility with the Solaris and Tru64 system headers. GCC also
|
||||
has its own notation for this, __asm__("name") annotations.
|
||||
|
||||
Corner cases of these features and their interaction:
|
||||
|
||||
1) Both pragmas silently apply only to declarations with external
|
||||
linkage (that is, TREE_PUBLIC || DECL_EXTERNAL). Asm labels
|
||||
do not have this restriction.
|
||||
|
||||
2) In C++, both #pragmas silently apply only to extern "C" declarations.
|
||||
Asm labels do not have this restriction.
|
||||
|
||||
3) If any of the three ways of changing DECL_ASSEMBLER_NAME is
|
||||
applied to a decl whose DECL_ASSEMBLER_NAME is already set, and the
|
||||
new name is different, a warning issues and the name does not change.
|
||||
|
||||
4) The "source name" for #pragma redefine_extname is the DECL_NAME,
|
||||
*not* the DECL_ASSEMBLER_NAME.
|
||||
|
||||
5) If #pragma extern_prefix is in effect and a declaration occurs
|
||||
with an __asm__ name, the #pragma extern_prefix is silently
|
||||
ignored for that declaration.
|
||||
|
||||
6) If #pragma extern_prefix and #pragma redefine_extname apply to
|
||||
the same declaration, whichever triggered first wins, and a warning
|
||||
is issued. (We would like to have #pragma redefine_extname always
|
||||
win, but it can appear either before or after the declaration, and
|
||||
if it appears afterward, we have no way of knowing whether a modified
|
||||
DECL_ASSEMBLER_NAME is due to #pragma extern_prefix.) */
|
||||
|
||||
static GTY(()) tree pending_redefine_extname;
|
||||
|
||||
static void handle_pragma_redefine_extname (cpp_reader *);
|
||||
|
||||
/* #pragma redefine_extname oldname newname */
|
||||
static void
|
||||
handle_pragma_redefine_extname (cpp_reader * ARG_UNUSED (dummy))
|
||||
{
|
||||
tree oldname, newname, decl, x;
|
||||
enum cpp_ttype t;
|
||||
|
||||
if (pragma_lex (&oldname) != CPP_NAME)
|
||||
GCC_BAD ("malformed #pragma redefine_extname, ignored");
|
||||
if (pragma_lex (&newname) != CPP_NAME)
|
||||
GCC_BAD ("malformed #pragma redefine_extname, ignored");
|
||||
t = pragma_lex (&x);
|
||||
if (t != CPP_EOF)
|
||||
warning (OPT_Wpragmas, "junk at end of %<#pragma redefine_extname%>");
|
||||
|
||||
if (!flag_mudflap && !targetm.handle_pragma_redefine_extname)
|
||||
{
|
||||
if (warn_unknown_pragmas > in_system_header)
|
||||
warning (OPT_Wunknown_pragmas,
|
||||
"#pragma redefine_extname not supported on this target");
|
||||
return;
|
||||
}
|
||||
|
||||
decl = identifier_global_value (oldname);
|
||||
if (decl
|
||||
&& (TREE_PUBLIC (decl) || DECL_EXTERNAL (decl))
|
||||
&& (TREE_CODE (decl) == FUNCTION_DECL
|
||||
|| TREE_CODE (decl) == VAR_DECL)
|
||||
&& has_c_linkage (decl))
|
||||
{
|
||||
if (DECL_ASSEMBLER_NAME_SET_P (decl))
|
||||
{
|
||||
const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
|
||||
name = targetm.strip_name_encoding (name);
|
||||
|
||||
if (strcmp (name, IDENTIFIER_POINTER (newname)))
|
||||
warning (OPT_Wpragmas, "#pragma redefine_extname ignored due to "
|
||||
"conflict with previous rename");
|
||||
}
|
||||
else
|
||||
change_decl_assembler_name (decl, newname);
|
||||
}
|
||||
else
|
||||
/* We have to add this to the rename list even if there's already
|
||||
a global value that doesn't meet the above criteria, because in
|
||||
C++ "struct foo {...};" puts "foo" in the current namespace but
|
||||
does *not* conflict with a subsequent declaration of a function
|
||||
or variable foo. See g++.dg/other/pragma-re-2.C. */
|
||||
add_to_renaming_pragma_list (oldname, newname);
|
||||
}
|
||||
|
||||
/* This is called from here and from ia64.c. */
|
||||
void
|
||||
add_to_renaming_pragma_list (tree oldname, tree newname)
|
||||
{
|
||||
tree previous = purpose_member (oldname, pending_redefine_extname);
|
||||
if (previous)
|
||||
{
|
||||
if (TREE_VALUE (previous) != newname)
|
||||
warning (OPT_Wpragmas, "#pragma redefine_extname ignored due to "
|
||||
"conflict with previous #pragma redefine_extname");
|
||||
return;
|
||||
}
|
||||
|
||||
pending_redefine_extname
|
||||
= tree_cons (oldname, newname, pending_redefine_extname);
|
||||
}
|
||||
|
||||
static GTY(()) tree pragma_extern_prefix;
|
||||
|
||||
/* #pragma extern_prefix "prefix" */
|
||||
static void
|
||||
handle_pragma_extern_prefix (cpp_reader * ARG_UNUSED (dummy))
|
||||
{
|
||||
tree prefix, x;
|
||||
enum cpp_ttype t;
|
||||
|
||||
if (pragma_lex (&prefix) != CPP_STRING)
|
||||
GCC_BAD ("malformed #pragma extern_prefix, ignored");
|
||||
t = pragma_lex (&x);
|
||||
if (t != CPP_EOF)
|
||||
warning (OPT_Wpragmas, "junk at end of %<#pragma extern_prefix%>");
|
||||
|
||||
if (targetm.handle_pragma_extern_prefix)
|
||||
/* Note that the length includes the null terminator. */
|
||||
pragma_extern_prefix = (TREE_STRING_LENGTH (prefix) > 1 ? prefix : NULL);
|
||||
else if (warn_unknown_pragmas > in_system_header)
|
||||
warning (OPT_Wunknown_pragmas,
|
||||
"#pragma extern_prefix not supported on this target");
|
||||
}
|
||||
|
||||
/* Hook from the front ends to apply the results of one of the preceding
|
||||
pragmas that rename variables. */
|
||||
|
||||
tree
|
||||
maybe_apply_renaming_pragma (tree decl, tree asmname)
|
||||
{
|
||||
tree *p, t;
|
||||
|
||||
/* The renaming pragmas are only applied to declarations with
|
||||
external linkage. */
|
||||
if ((TREE_CODE (decl) != FUNCTION_DECL && TREE_CODE (decl) != VAR_DECL)
|
||||
|| (!TREE_PUBLIC (decl) && !DECL_EXTERNAL (decl))
|
||||
|| !has_c_linkage (decl))
|
||||
return asmname;
|
||||
|
||||
/* If the DECL_ASSEMBLER_NAME is already set, it does not change,
|
||||
but we may warn about a rename that conflicts. */
|
||||
if (DECL_ASSEMBLER_NAME_SET_P (decl))
|
||||
{
|
||||
const char *oldname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
|
||||
oldname = targetm.strip_name_encoding (oldname);
|
||||
|
||||
if (asmname && strcmp (TREE_STRING_POINTER (asmname), oldname))
|
||||
warning (OPT_Wpragmas, "asm declaration ignored due to "
|
||||
"conflict with previous rename");
|
||||
|
||||
/* Take any pending redefine_extname off the list. */
|
||||
for (p = &pending_redefine_extname; (t = *p); p = &TREE_CHAIN (t))
|
||||
if (DECL_NAME (decl) == TREE_PURPOSE (t))
|
||||
{
|
||||
/* Only warn if there is a conflict. */
|
||||
if (strcmp (IDENTIFIER_POINTER (TREE_VALUE (t)), oldname))
|
||||
warning (OPT_Wpragmas, "#pragma redefine_extname ignored due to "
|
||||
"conflict with previous rename");
|
||||
|
||||
*p = TREE_CHAIN (t);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Find out if we have a pending #pragma redefine_extname. */
|
||||
for (p = &pending_redefine_extname; (t = *p); p = &TREE_CHAIN (t))
|
||||
if (DECL_NAME (decl) == TREE_PURPOSE (t))
|
||||
{
|
||||
tree newname = TREE_VALUE (t);
|
||||
*p = TREE_CHAIN (t);
|
||||
|
||||
/* If we already have an asmname, #pragma redefine_extname is
|
||||
ignored (with a warning if it conflicts). */
|
||||
if (asmname)
|
||||
{
|
||||
if (strcmp (TREE_STRING_POINTER (asmname),
|
||||
IDENTIFIER_POINTER (newname)) != 0)
|
||||
warning (OPT_Wpragmas, "#pragma redefine_extname ignored due to "
|
||||
"conflict with __asm__ declaration");
|
||||
return asmname;
|
||||
}
|
||||
|
||||
/* Otherwise we use what we've got; #pragma extern_prefix is
|
||||
silently ignored. */
|
||||
return build_string (IDENTIFIER_LENGTH (newname),
|
||||
IDENTIFIER_POINTER (newname));
|
||||
}
|
||||
|
||||
/* If we've got an asmname, #pragma extern_prefix is silently ignored. */
|
||||
if (asmname)
|
||||
return asmname;
|
||||
|
||||
/* If #pragma extern_prefix is in effect, apply it. */
|
||||
if (pragma_extern_prefix)
|
||||
{
|
||||
const char *prefix = TREE_STRING_POINTER (pragma_extern_prefix);
|
||||
size_t plen = TREE_STRING_LENGTH (pragma_extern_prefix) - 1;
|
||||
|
||||
const char *id = IDENTIFIER_POINTER (DECL_NAME (decl));
|
||||
size_t ilen = IDENTIFIER_LENGTH (DECL_NAME (decl));
|
||||
|
||||
char *newname = (char *) alloca (plen + ilen + 1);
|
||||
|
||||
memcpy (newname, prefix, plen);
|
||||
memcpy (newname + plen, id, ilen + 1);
|
||||
|
||||
return build_string (plen + ilen, newname);
|
||||
}
|
||||
|
||||
/* Nada. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#ifdef HANDLE_PRAGMA_VISIBILITY
|
||||
static void handle_pragma_visibility (cpp_reader *);
|
||||
|
||||
typedef enum symbol_visibility visibility;
|
||||
DEF_VEC_I (visibility);
|
||||
DEF_VEC_ALLOC_I (visibility, heap);
|
||||
static VEC (visibility, heap) *visstack;
|
||||
|
||||
/* Push the visibility indicated by STR onto the top of the #pragma
|
||||
visibility stack. */
|
||||
|
||||
void
|
||||
push_visibility (const char *str)
|
||||
{
|
||||
VEC_safe_push (visibility, heap, visstack,
|
||||
default_visibility);
|
||||
if (!strcmp (str, "default"))
|
||||
default_visibility = VISIBILITY_DEFAULT;
|
||||
else if (!strcmp (str, "internal"))
|
||||
default_visibility = VISIBILITY_INTERNAL;
|
||||
else if (!strcmp (str, "hidden"))
|
||||
default_visibility = VISIBILITY_HIDDEN;
|
||||
else if (!strcmp (str, "protected"))
|
||||
default_visibility = VISIBILITY_PROTECTED;
|
||||
else
|
||||
GCC_BAD ("#pragma GCC visibility push() must specify default, internal, hidden or protected");
|
||||
visibility_options.inpragma = 1;
|
||||
}
|
||||
|
||||
/* Pop a level of the #pragma visibility stack. */
|
||||
|
||||
void
|
||||
pop_visibility (void)
|
||||
{
|
||||
default_visibility = VEC_pop (visibility, visstack);
|
||||
visibility_options.inpragma
|
||||
= VEC_length (visibility, visstack) != 0;
|
||||
}
|
||||
|
||||
/* Sets the default visibility for symbols to something other than that
|
||||
specified on the command line. */
|
||||
|
||||
static void
|
||||
handle_pragma_visibility (cpp_reader *dummy ATTRIBUTE_UNUSED)
|
||||
{
|
||||
/* Form is #pragma GCC visibility push(hidden)|pop */
|
||||
tree x;
|
||||
enum cpp_ttype token;
|
||||
enum { bad, push, pop } action = bad;
|
||||
|
||||
token = pragma_lex (&x);
|
||||
if (token == CPP_NAME)
|
||||
{
|
||||
const char *op = IDENTIFIER_POINTER (x);
|
||||
if (!strcmp (op, "push"))
|
||||
action = push;
|
||||
else if (!strcmp (op, "pop"))
|
||||
action = pop;
|
||||
}
|
||||
if (bad == action)
|
||||
GCC_BAD ("#pragma GCC visibility must be followed by push or pop");
|
||||
else
|
||||
{
|
||||
if (pop == action)
|
||||
{
|
||||
if (!VEC_length (visibility, visstack))
|
||||
GCC_BAD ("no matching push for %<#pragma GCC visibility pop%>");
|
||||
else
|
||||
pop_visibility ();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pragma_lex (&x) != CPP_OPEN_PAREN)
|
||||
GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored");
|
||||
token = pragma_lex (&x);
|
||||
if (token != CPP_NAME)
|
||||
GCC_BAD ("malformed #pragma GCC visibility push");
|
||||
else
|
||||
push_visibility (IDENTIFIER_POINTER (x));
|
||||
if (pragma_lex (&x) != CPP_CLOSE_PAREN)
|
||||
GCC_BAD ("missing %<(%> after %<#pragma GCC visibility push%> - ignored");
|
||||
}
|
||||
}
|
||||
if (pragma_lex (&x) != CPP_EOF)
|
||||
warning (OPT_Wpragmas, "junk at end of %<#pragma GCC visibility%>");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
handle_pragma_diagnostic(cpp_reader *ARG_UNUSED(dummy))
|
||||
{
|
||||
const char *kind_string, *option_string;
|
||||
unsigned int option_index;
|
||||
enum cpp_ttype token;
|
||||
diagnostic_t kind;
|
||||
tree x;
|
||||
|
||||
if (cfun)
|
||||
{
|
||||
error ("#pragma GCC diagnostic not allowed inside functions");
|
||||
return;
|
||||
}
|
||||
|
||||
token = pragma_lex (&x);
|
||||
if (token != CPP_NAME)
|
||||
GCC_BAD ("missing [error|warning|ignored] after %<#pragma GCC diagnostic%>");
|
||||
kind_string = IDENTIFIER_POINTER (x);
|
||||
if (strcmp (kind_string, "error") == 0)
|
||||
kind = DK_ERROR;
|
||||
else if (strcmp (kind_string, "warning") == 0)
|
||||
kind = DK_WARNING;
|
||||
else if (strcmp (kind_string, "ignored") == 0)
|
||||
kind = DK_IGNORED;
|
||||
else
|
||||
GCC_BAD ("expected [error|warning|ignored] after %<#pragma GCC diagnostic%>");
|
||||
|
||||
token = pragma_lex (&x);
|
||||
if (token != CPP_STRING)
|
||||
GCC_BAD ("missing option after %<#pragma GCC diagnostic%> kind");
|
||||
option_string = TREE_STRING_POINTER (x);
|
||||
for (option_index = 0; option_index < cl_options_count; option_index++)
|
||||
if (strcmp (cl_options[option_index].opt_text, option_string) == 0)
|
||||
{
|
||||
/* This overrides -Werror, for example. */
|
||||
diagnostic_classify_diagnostic (global_dc, option_index, kind);
|
||||
/* This makes sure the option is enabled, like -Wfoo would do. */
|
||||
if (cl_options[option_index].var_type == CLVC_BOOLEAN
|
||||
&& cl_options[option_index].flag_var
|
||||
&& kind != DK_IGNORED)
|
||||
*(int *) cl_options[option_index].flag_var = 1;
|
||||
return;
|
||||
}
|
||||
GCC_BAD ("unknown option after %<#pragma GCC diagnostic%> kind");
|
||||
}
|
||||
|
||||
/* A vector of registered pragma callbacks. */
|
||||
|
||||
DEF_VEC_O (pragma_handler);
|
||||
DEF_VEC_ALLOC_O (pragma_handler, heap);
|
||||
|
||||
static VEC(pragma_handler, heap) *registered_pragmas;
|
||||
|
||||
/* Front-end wrappers for pragma registration to avoid dragging
|
||||
cpplib.h in almost everywhere. */
|
||||
|
||||
static void
|
||||
c_register_pragma_1 (const char *space, const char *name,
|
||||
pragma_handler handler, bool allow_expansion)
|
||||
{
|
||||
unsigned id;
|
||||
|
||||
VEC_safe_push (pragma_handler, heap, registered_pragmas, &handler);
|
||||
id = VEC_length (pragma_handler, registered_pragmas);
|
||||
id += PRAGMA_FIRST_EXTERNAL - 1;
|
||||
|
||||
/* The C++ front end allocates 6 bits in cp_token; the C front end
|
||||
allocates 7 bits in c_token. At present this is sufficient. */
|
||||
gcc_assert (id < 64);
|
||||
|
||||
cpp_register_deferred_pragma (parse_in, space, name, id,
|
||||
allow_expansion, false);
|
||||
}
|
||||
|
||||
void
|
||||
c_register_pragma (const char *space, const char *name, pragma_handler handler)
|
||||
{
|
||||
c_register_pragma_1 (space, name, handler, false);
|
||||
}
|
||||
|
||||
void
|
||||
c_register_pragma_with_expansion (const char *space, const char *name,
|
||||
pragma_handler handler)
|
||||
{
|
||||
c_register_pragma_1 (space, name, handler, true);
|
||||
}
|
||||
|
||||
void
|
||||
c_invoke_pragma_handler (unsigned int id)
|
||||
{
|
||||
pragma_handler handler;
|
||||
|
||||
id -= PRAGMA_FIRST_EXTERNAL;
|
||||
handler = *VEC_index (pragma_handler, registered_pragmas, id);
|
||||
|
||||
handler (parse_in);
|
||||
}
|
||||
|
||||
/* Set up front-end pragmas. */
|
||||
void
|
||||
init_pragma (void)
|
||||
{
|
||||
if (flag_openmp && !flag_preprocess_only)
|
||||
{
|
||||
struct omp_pragma_def { const char *name; unsigned int id; };
|
||||
static const struct omp_pragma_def omp_pragmas[] = {
|
||||
{ "atomic", PRAGMA_OMP_ATOMIC },
|
||||
{ "barrier", PRAGMA_OMP_BARRIER },
|
||||
{ "critical", PRAGMA_OMP_CRITICAL },
|
||||
{ "flush", PRAGMA_OMP_FLUSH },
|
||||
{ "for", PRAGMA_OMP_FOR },
|
||||
{ "master", PRAGMA_OMP_MASTER },
|
||||
{ "ordered", PRAGMA_OMP_ORDERED },
|
||||
{ "parallel", PRAGMA_OMP_PARALLEL },
|
||||
{ "section", PRAGMA_OMP_SECTION },
|
||||
{ "sections", PRAGMA_OMP_SECTIONS },
|
||||
{ "single", PRAGMA_OMP_SINGLE },
|
||||
{ "threadprivate", PRAGMA_OMP_THREADPRIVATE }
|
||||
};
|
||||
|
||||
const int n_omp_pragmas = sizeof (omp_pragmas) / sizeof (*omp_pragmas);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n_omp_pragmas; ++i)
|
||||
cpp_register_deferred_pragma (parse_in, "omp", omp_pragmas[i].name,
|
||||
omp_pragmas[i].id, true, true);
|
||||
}
|
||||
|
||||
cpp_register_deferred_pragma (parse_in, "GCC", "pch_preprocess",
|
||||
PRAGMA_GCC_PCH_PREPROCESS, false, false);
|
||||
|
||||
#ifdef HANDLE_PRAGMA_PACK
|
||||
#ifdef HANDLE_PRAGMA_PACK_WITH_EXPANSION
|
||||
c_register_pragma_with_expansion (0, "pack", handle_pragma_pack);
|
||||
#else
|
||||
c_register_pragma (0, "pack", handle_pragma_pack);
|
||||
#endif
|
||||
#endif
|
||||
#ifdef HANDLE_PRAGMA_WEAK
|
||||
c_register_pragma (0, "weak", handle_pragma_weak);
|
||||
#endif
|
||||
#ifdef HANDLE_PRAGMA_VISIBILITY
|
||||
c_register_pragma ("GCC", "visibility", handle_pragma_visibility);
|
||||
#endif
|
||||
|
||||
c_register_pragma ("GCC", "diagnostic", handle_pragma_diagnostic);
|
||||
|
||||
c_register_pragma_with_expansion (0, "redefine_extname", handle_pragma_redefine_extname);
|
||||
c_register_pragma (0, "extern_prefix", handle_pragma_extern_prefix);
|
||||
|
||||
#ifdef REGISTER_TARGET_PRAGMAS
|
||||
REGISTER_TARGET_PRAGMAS ();
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "gt-c-pragma.h"
|
@ -1,112 +0,0 @@
|
||||
/* Pragma related interfaces.
|
||||
Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifndef GCC_C_PRAGMA_H
|
||||
#define GCC_C_PRAGMA_H
|
||||
|
||||
#include <cpplib.h> /* For enum cpp_ttype. */
|
||||
|
||||
/* Pragma identifiers built in to the front end parsers. Identifiers
|
||||
for ancillary handlers will follow these. */
|
||||
typedef enum pragma_kind {
|
||||
PRAGMA_NONE = 0,
|
||||
|
||||
PRAGMA_OMP_ATOMIC,
|
||||
PRAGMA_OMP_BARRIER,
|
||||
PRAGMA_OMP_CRITICAL,
|
||||
PRAGMA_OMP_FLUSH,
|
||||
PRAGMA_OMP_FOR,
|
||||
PRAGMA_OMP_MASTER,
|
||||
PRAGMA_OMP_ORDERED,
|
||||
PRAGMA_OMP_PARALLEL,
|
||||
PRAGMA_OMP_PARALLEL_FOR,
|
||||
PRAGMA_OMP_PARALLEL_SECTIONS,
|
||||
PRAGMA_OMP_SECTION,
|
||||
PRAGMA_OMP_SECTIONS,
|
||||
PRAGMA_OMP_SINGLE,
|
||||
PRAGMA_OMP_THREADPRIVATE,
|
||||
|
||||
PRAGMA_GCC_PCH_PREPROCESS,
|
||||
|
||||
PRAGMA_FIRST_EXTERNAL
|
||||
} pragma_kind;
|
||||
|
||||
/* Cause the `yydebug' variable to be defined. */
|
||||
#define YYDEBUG 1
|
||||
extern int yydebug;
|
||||
|
||||
extern struct cpp_reader* parse_in;
|
||||
|
||||
#define HANDLE_PRAGMA_WEAK SUPPORTS_WEAK
|
||||
|
||||
#ifdef HANDLE_SYSV_PRAGMA
|
||||
/* We always support #pragma pack for SYSV pragmas. */
|
||||
#ifndef HANDLE_PRAGMA_PACK
|
||||
#define HANDLE_PRAGMA_PACK 1
|
||||
#endif
|
||||
#endif /* HANDLE_SYSV_PRAGMA */
|
||||
|
||||
|
||||
#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
|
||||
/* If we are supporting #pragma pack(push... then we automatically
|
||||
support #pragma pack(<n>) */
|
||||
#define HANDLE_PRAGMA_PACK 1
|
||||
#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
|
||||
|
||||
/* It's safe to always leave visibility pragma enabled as if
|
||||
visibility is not supported on the host OS platform the
|
||||
statements are ignored. */
|
||||
#define HANDLE_PRAGMA_VISIBILITY 1
|
||||
extern void push_visibility (const char *);
|
||||
extern void pop_visibility (void);
|
||||
|
||||
extern void init_pragma (void);
|
||||
|
||||
/* Front-end wrappers for pragma registration. */
|
||||
typedef void (*pragma_handler)(struct cpp_reader *);
|
||||
extern void c_register_pragma (const char *, const char *, pragma_handler);
|
||||
extern void c_register_pragma_with_expansion (const char *, const char *,
|
||||
pragma_handler);
|
||||
extern void c_invoke_pragma_handler (unsigned int);
|
||||
|
||||
extern void maybe_apply_pragma_weak (tree);
|
||||
extern void maybe_apply_pending_pragma_weaks (void);
|
||||
extern tree maybe_apply_renaming_pragma (tree, tree);
|
||||
extern void add_to_renaming_pragma_list (tree, tree);
|
||||
|
||||
extern enum cpp_ttype pragma_lex (tree *);
|
||||
|
||||
/* This is not actually available to pragma parsers. It's merely a
|
||||
convenient location to declare this function for c-lex, after
|
||||
having enum cpp_ttype declared. */
|
||||
extern enum cpp_ttype c_lex_with_flags (tree *, location_t *, unsigned char *);
|
||||
|
||||
/* If 1, then lex strings into the execution character set.
|
||||
If 0, lex strings into the host character set.
|
||||
If -1, lex both, and chain them together, such that the former
|
||||
is the TREE_CHAIN of the latter. */
|
||||
extern int c_lex_string_translate;
|
||||
|
||||
/* If true, strings should be passed to the caller of c_lex completely
|
||||
unmolested (no concatenation, no translation). */
|
||||
extern bool c_lex_return_raw_strings;
|
||||
|
||||
#endif /* GCC_C_PRAGMA_H */
|
File diff suppressed because it is too large
Load Diff
@ -1,214 +0,0 @@
|
||||
/* Various declarations for the C and C++ pretty-printers.
|
||||
Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifndef GCC_C_PRETTY_PRINTER
|
||||
#define GCC_C_PRETTY_PRINTER
|
||||
|
||||
#include "tree.h"
|
||||
#include "c-common.h"
|
||||
#include "pretty-print.h"
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
pp_c_flag_abstract = 1 << 1,
|
||||
pp_c_flag_last_bit = 2
|
||||
} pp_c_pretty_print_flags;
|
||||
|
||||
|
||||
/* The data type used to bundle information necessary for pretty-printing
|
||||
a C or C++ entity. */
|
||||
typedef struct c_pretty_print_info c_pretty_printer;
|
||||
|
||||
/* The type of a C pretty-printer 'member' function. */
|
||||
typedef void (*c_pretty_print_fn) (c_pretty_printer *, tree);
|
||||
|
||||
/* The datatype that contains information necessary for pretty-printing
|
||||
a tree that represents a C construct. Any pretty-printer for a
|
||||
language using C/c++ syntax can derive from this datatype and reuse
|
||||
facilities provided here. It can do so by having a subobject of type
|
||||
c_pretty_printer and override the macro pp_c_base to return a pointer
|
||||
to that subobject. Such a pretty-printer has the responsibility to
|
||||
initialize the pp_base() part, then call pp_c_pretty_printer_init
|
||||
to set up the components that are specific to the C pretty-printer.
|
||||
A derived pretty-printer can override any function listed in the
|
||||
vtable below. See cp/cxx-pretty-print.h and cp/cxx-pretty-print.c
|
||||
for an example of derivation. */
|
||||
struct c_pretty_print_info
|
||||
{
|
||||
pretty_printer base;
|
||||
/* Points to the first element of an array of offset-list.
|
||||
Not used yet. */
|
||||
int *offset_list;
|
||||
|
||||
pp_flags flags;
|
||||
|
||||
/* These must be overridden by each of the C and C++ front-end to
|
||||
reflect their understanding of syntactic productions when they differ. */
|
||||
c_pretty_print_fn declaration;
|
||||
c_pretty_print_fn declaration_specifiers;
|
||||
c_pretty_print_fn declarator;
|
||||
c_pretty_print_fn abstract_declarator;
|
||||
c_pretty_print_fn direct_abstract_declarator;
|
||||
c_pretty_print_fn type_specifier_seq;
|
||||
c_pretty_print_fn direct_declarator;
|
||||
c_pretty_print_fn ptr_operator;
|
||||
c_pretty_print_fn parameter_list;
|
||||
c_pretty_print_fn type_id;
|
||||
c_pretty_print_fn simple_type_specifier;
|
||||
c_pretty_print_fn function_specifier;
|
||||
c_pretty_print_fn storage_class_specifier;
|
||||
c_pretty_print_fn initializer;
|
||||
|
||||
c_pretty_print_fn statement;
|
||||
|
||||
c_pretty_print_fn constant;
|
||||
c_pretty_print_fn id_expression;
|
||||
c_pretty_print_fn primary_expression;
|
||||
c_pretty_print_fn postfix_expression;
|
||||
c_pretty_print_fn unary_expression;
|
||||
c_pretty_print_fn multiplicative_expression;
|
||||
c_pretty_print_fn conditional_expression;
|
||||
c_pretty_print_fn assignment_expression;
|
||||
c_pretty_print_fn expression;
|
||||
};
|
||||
|
||||
/* Override the pp_base macro. Derived pretty-printers should not
|
||||
touch this macro. Instead they should override pp_c_base instead. */
|
||||
#undef pp_base
|
||||
#define pp_base(PP) (&pp_c_base (PP)->base)
|
||||
|
||||
|
||||
#define pp_c_tree_identifier(PPI, ID) \
|
||||
pp_c_identifier (PPI, IDENTIFIER_POINTER (ID))
|
||||
|
||||
#define pp_declaration(PPI, T) \
|
||||
pp_c_base (PPI)->declaration (pp_c_base (PPI), T)
|
||||
#define pp_declaration_specifiers(PPI, D) \
|
||||
pp_c_base (PPI)->declaration_specifiers (pp_c_base (PPI), D)
|
||||
#define pp_abstract_declarator(PP, D) \
|
||||
pp_c_base (PP)->abstract_declarator (pp_c_base (PP), D)
|
||||
#define pp_type_specifier_seq(PPI, D) \
|
||||
pp_c_base (PPI)->type_specifier_seq (pp_c_base (PPI), D)
|
||||
#define pp_declarator(PPI, D) \
|
||||
pp_c_base (PPI)->declarator (pp_c_base (PPI), D)
|
||||
#define pp_direct_declarator(PPI, D) \
|
||||
pp_c_base (PPI)->direct_declarator (pp_c_base (PPI), D)
|
||||
#define pp_direct_abstract_declarator(PP, D) \
|
||||
pp_c_base (PP)->direct_abstract_declarator (pp_c_base (PP), D)
|
||||
#define pp_ptr_operator(PP, D) \
|
||||
pp_c_base (PP)->ptr_operator (pp_c_base (PP), D)
|
||||
#define pp_parameter_list(PPI, T) \
|
||||
pp_c_base (PPI)->parameter_list (pp_c_base (PPI), T)
|
||||
#define pp_type_id(PPI, D) \
|
||||
pp_c_base (PPI)->type_id (pp_c_base (PPI), D)
|
||||
#define pp_simple_type_specifier(PP, T) \
|
||||
pp_c_base (PP)->simple_type_specifier (pp_c_base (PP), T)
|
||||
#define pp_function_specifier(PP, D) \
|
||||
pp_c_base (PP)->function_specifier (pp_c_base (PP), D)
|
||||
#define pp_storage_class_specifier(PP, D) \
|
||||
pp_c_base (PP)->storage_class_specifier (pp_c_base (PP), D);
|
||||
|
||||
#define pp_statement(PPI, S) \
|
||||
pp_c_base (PPI)->statement (pp_c_base (PPI), S)
|
||||
|
||||
#define pp_constant(PP, E) \
|
||||
pp_c_base (PP)->constant (pp_c_base (PP), E)
|
||||
#define pp_id_expression(PP, E) \
|
||||
pp_c_base (PP)->id_expression (pp_c_base (PP), E)
|
||||
#define pp_primary_expression(PPI, E) \
|
||||
pp_c_base (PPI)->primary_expression (pp_c_base (PPI), E)
|
||||
#define pp_postfix_expression(PPI, E) \
|
||||
pp_c_base (PPI)->postfix_expression (pp_c_base (PPI), E)
|
||||
#define pp_unary_expression(PPI, E) \
|
||||
pp_c_base (PPI)->unary_expression (pp_c_base (PPI), E)
|
||||
#define pp_initializer(PPI, E) \
|
||||
pp_c_base (PPI)->initializer (pp_c_base (PPI), E)
|
||||
#define pp_multiplicative_expression(PPI, E) \
|
||||
pp_c_base (PPI)->multiplicative_expression (pp_c_base (PPI), E)
|
||||
#define pp_conditional_expression(PPI, E) \
|
||||
pp_c_base (PPI)->conditional_expression (pp_c_base (PPI), E)
|
||||
#define pp_assignment_expression(PPI, E) \
|
||||
pp_c_base (PPI)->assignment_expression (pp_c_base (PPI), E)
|
||||
#define pp_expression(PP, E) \
|
||||
pp_c_base (PP)->expression (pp_c_base (PP), E)
|
||||
|
||||
|
||||
/* Returns the c_pretty_printer base object of PRETTY-PRINTER. This
|
||||
macro must be overridden by any subclass of c_pretty_print_info. */
|
||||
#define pp_c_base(PP) (PP)
|
||||
|
||||
extern void pp_c_pretty_printer_init (c_pretty_printer *);
|
||||
void pp_c_whitespace (c_pretty_printer *);
|
||||
void pp_c_left_paren (c_pretty_printer *);
|
||||
void pp_c_right_paren (c_pretty_printer *);
|
||||
void pp_c_left_brace (c_pretty_printer *);
|
||||
void pp_c_right_brace (c_pretty_printer *);
|
||||
void pp_c_left_bracket (c_pretty_printer *);
|
||||
void pp_c_right_bracket (c_pretty_printer *);
|
||||
void pp_c_dot (c_pretty_printer *);
|
||||
void pp_c_ampersand (c_pretty_printer *);
|
||||
void pp_c_star (c_pretty_printer *);
|
||||
/* APPLE LOCAL blocks */
|
||||
void pp_c_caret (c_pretty_printer *);
|
||||
void pp_c_arrow (c_pretty_printer *);
|
||||
void pp_c_semicolon (c_pretty_printer *);
|
||||
void pp_c_complement (c_pretty_printer *);
|
||||
void pp_c_exclamation (c_pretty_printer *);
|
||||
void pp_c_space_for_pointer_operator (c_pretty_printer *, tree);
|
||||
|
||||
/* Declarations. */
|
||||
void pp_c_tree_decl_identifier (c_pretty_printer *, tree);
|
||||
void pp_c_function_definition (c_pretty_printer *, tree);
|
||||
void pp_c_attributes (c_pretty_printer *, tree);
|
||||
void pp_c_type_qualifier_list (c_pretty_printer *, tree);
|
||||
void pp_c_parameter_type_list (c_pretty_printer *, tree);
|
||||
void pp_c_declaration (c_pretty_printer *, tree);
|
||||
void pp_c_declaration_specifiers (c_pretty_printer *, tree);
|
||||
void pp_c_declarator (c_pretty_printer *, tree);
|
||||
void pp_c_direct_declarator (c_pretty_printer *, tree);
|
||||
void pp_c_specifier_qualifier_list (c_pretty_printer *, tree);
|
||||
void pp_c_function_specifier (c_pretty_printer *, tree);
|
||||
void pp_c_type_id (c_pretty_printer *, tree);
|
||||
void pp_c_direct_abstract_declarator (c_pretty_printer *, tree);
|
||||
void pp_c_type_specifier (c_pretty_printer *, tree);
|
||||
void pp_c_storage_class_specifier (c_pretty_printer *, tree);
|
||||
/* Statements. */
|
||||
void pp_c_statement (c_pretty_printer *, tree);
|
||||
/* Expressions. */
|
||||
void pp_c_expression (c_pretty_printer *, tree);
|
||||
void pp_c_logical_or_expression (c_pretty_printer *, tree);
|
||||
void pp_c_expression_list (c_pretty_printer *, tree);
|
||||
void pp_c_constructor_elts (c_pretty_printer *, VEC(constructor_elt,gc) *);
|
||||
void pp_c_call_argument_list (c_pretty_printer *, tree);
|
||||
void pp_c_unary_expression (c_pretty_printer *, tree);
|
||||
void pp_c_cast_expression (c_pretty_printer *, tree);
|
||||
void pp_c_postfix_expression (c_pretty_printer *, tree);
|
||||
void pp_c_primary_expression (c_pretty_printer *, tree);
|
||||
void pp_c_init_declarator (c_pretty_printer *, tree);
|
||||
void pp_c_constant (c_pretty_printer *, tree);
|
||||
void pp_c_id_expression (c_pretty_printer *, tree);
|
||||
void pp_c_identifier (c_pretty_printer *, const char *);
|
||||
void pp_c_string_literal (c_pretty_printer *, tree);
|
||||
|
||||
void print_c_tree (FILE *file, tree t);
|
||||
|
||||
#endif /* GCC_C_PRETTY_PRINTER */
|
@ -1,168 +0,0 @@
|
||||
/* This file contains the definitions and documentation for the common
|
||||
tree codes used in the GNU C and C++ compilers (see c-common.def
|
||||
for the standard codes).
|
||||
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
Written by Benjamin Chelf (chelf@codesourcery.com).
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "tree.h"
|
||||
#include "function.h"
|
||||
#include "splay-tree.h"
|
||||
#include "varray.h"
|
||||
#include "c-common.h"
|
||||
#include "except.h"
|
||||
/* In order for the format checking to accept the C frontend
|
||||
diagnostic framework extensions, you must define this token before
|
||||
including toplev.h. */
|
||||
#define GCC_DIAG_STYLE __gcc_cdiag__
|
||||
#include "toplev.h"
|
||||
#include "flags.h"
|
||||
#include "ggc.h"
|
||||
#include "rtl.h"
|
||||
#include "output.h"
|
||||
#include "timevar.h"
|
||||
#include "predict.h"
|
||||
#include "tree-inline.h"
|
||||
#include "tree-gimple.h"
|
||||
#include "langhooks.h"
|
||||
|
||||
/* Create an empty statement tree rooted at T. */
|
||||
|
||||
tree
|
||||
push_stmt_list (void)
|
||||
{
|
||||
tree t;
|
||||
t = alloc_stmt_list ();
|
||||
TREE_CHAIN (t) = cur_stmt_list;
|
||||
cur_stmt_list = t;
|
||||
return t;
|
||||
}
|
||||
|
||||
/* Finish the statement tree rooted at T. */
|
||||
|
||||
tree
|
||||
pop_stmt_list (tree t)
|
||||
{
|
||||
tree u = cur_stmt_list, chain;
|
||||
|
||||
/* Pop statement lists until we reach the target level. The extra
|
||||
nestings will be due to outstanding cleanups. */
|
||||
while (1)
|
||||
{
|
||||
chain = TREE_CHAIN (u);
|
||||
TREE_CHAIN (u) = NULL_TREE;
|
||||
if (t == u)
|
||||
break;
|
||||
u = chain;
|
||||
}
|
||||
cur_stmt_list = chain;
|
||||
|
||||
/* If the statement list is completely empty, just return it. This is
|
||||
just as good small as build_empty_stmt, with the advantage that
|
||||
statement lists are merged when they appended to one another. So
|
||||
using the STATEMENT_LIST avoids pathological buildup of EMPTY_STMT_P
|
||||
statements. */
|
||||
if (TREE_SIDE_EFFECTS (t))
|
||||
{
|
||||
tree_stmt_iterator i = tsi_start (t);
|
||||
|
||||
/* If the statement list contained exactly one statement, then
|
||||
extract it immediately. */
|
||||
if (tsi_one_before_end_p (i))
|
||||
{
|
||||
u = tsi_stmt (i);
|
||||
tsi_delink (&i);
|
||||
free_stmt_list (t);
|
||||
t = u;
|
||||
}
|
||||
}
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
/* Build a generic statement based on the given type of node and
|
||||
arguments. Similar to `build_nt', except that we set
|
||||
EXPR_LOCATION to be the current source location. */
|
||||
/* ??? This should be obsolete with the lineno_stmt productions
|
||||
in the grammar. */
|
||||
|
||||
tree
|
||||
build_stmt (enum tree_code code, ...)
|
||||
{
|
||||
tree ret;
|
||||
int length, i;
|
||||
va_list p;
|
||||
bool side_effects;
|
||||
|
||||
va_start (p, code);
|
||||
|
||||
ret = make_node (code);
|
||||
TREE_TYPE (ret) = void_type_node;
|
||||
length = TREE_CODE_LENGTH (code);
|
||||
SET_EXPR_LOCATION (ret, input_location);
|
||||
|
||||
/* TREE_SIDE_EFFECTS will already be set for statements with
|
||||
implicit side effects. Here we make sure it is set for other
|
||||
expressions by checking whether the parameters have side
|
||||
effects. */
|
||||
|
||||
side_effects = false;
|
||||
for (i = 0; i < length; i++)
|
||||
{
|
||||
tree t = va_arg (p, tree);
|
||||
if (t && !TYPE_P (t))
|
||||
side_effects |= TREE_SIDE_EFFECTS (t);
|
||||
TREE_OPERAND (ret, i) = t;
|
||||
}
|
||||
|
||||
TREE_SIDE_EFFECTS (ret) |= side_effects;
|
||||
|
||||
va_end (p);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Let the back-end know about DECL. */
|
||||
|
||||
void
|
||||
emit_local_var (tree decl)
|
||||
{
|
||||
/* Create RTL for this variable. */
|
||||
if (!DECL_RTL_SET_P (decl))
|
||||
{
|
||||
if (DECL_HARD_REGISTER (decl))
|
||||
/* The user specified an assembler name for this variable.
|
||||
Set that up now. */
|
||||
rest_of_decl_compilation (decl, 0, 0);
|
||||
else
|
||||
expand_decl (decl);
|
||||
}
|
||||
}
|
||||
|
||||
/* Create a CASE_LABEL_EXPR tree node and return it. */
|
||||
|
||||
tree
|
||||
build_case_label (tree low_value, tree high_value, tree label_decl)
|
||||
{
|
||||
return build_stmt (CASE_LABEL_EXPR, low_value, high_value, label_decl);
|
||||
}
|
@ -1,652 +0,0 @@
|
||||
/* Definitions for C parsing and type checking.
|
||||
Copyright (C) 1987, 1993, 1994, 1995, 1997, 1998,
|
||||
1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifndef GCC_C_TREE_H
|
||||
#define GCC_C_TREE_H
|
||||
|
||||
#include "c-common.h"
|
||||
#include "toplev.h"
|
||||
#include "diagnostic.h"
|
||||
|
||||
/* struct lang_identifier is private to c-decl.c, but langhooks.c needs to
|
||||
know how big it is. This is sanity-checked in c-decl.c. */
|
||||
#define C_SIZEOF_STRUCT_LANG_IDENTIFIER \
|
||||
(sizeof (struct c_common_identifier) + 3 * sizeof (void *))
|
||||
|
||||
/* Language-specific declaration information. */
|
||||
|
||||
struct lang_decl GTY(())
|
||||
{
|
||||
char dummy;
|
||||
};
|
||||
|
||||
/* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only. */
|
||||
#define C_TYPE_FIELDS_READONLY(TYPE) TREE_LANG_FLAG_1 (TYPE)
|
||||
|
||||
/* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is volatile. */
|
||||
#define C_TYPE_FIELDS_VOLATILE(TYPE) TREE_LANG_FLAG_2 (TYPE)
|
||||
|
||||
/* In a RECORD_TYPE or UNION_TYPE or ENUMERAL_TYPE
|
||||
nonzero if the definition of the type has already started. */
|
||||
#define C_TYPE_BEING_DEFINED(TYPE) TYPE_LANG_FLAG_0 (TYPE)
|
||||
|
||||
/* In an incomplete RECORD_TYPE or UNION_TYPE, a list of variable
|
||||
declarations whose type would be completed by completing that type. */
|
||||
#define C_TYPE_INCOMPLETE_VARS(TYPE) TYPE_VFIELD (TYPE)
|
||||
|
||||
/* In an IDENTIFIER_NODE, nonzero if this identifier is actually a
|
||||
keyword. C_RID_CODE (node) is then the RID_* value of the keyword,
|
||||
and C_RID_YYCODE is the token number wanted by Yacc. */
|
||||
#define C_IS_RESERVED_WORD(ID) TREE_LANG_FLAG_0 (ID)
|
||||
|
||||
struct lang_type GTY(())
|
||||
{
|
||||
/* In a RECORD_TYPE, a sorted array of the fields of the type. */
|
||||
struct sorted_fields_type * GTY ((reorder ("resort_sorted_fields"))) s;
|
||||
/* In an ENUMERAL_TYPE, the min and max values. */
|
||||
tree enum_min;
|
||||
tree enum_max;
|
||||
/* In a RECORD_TYPE, information specific to Objective-C, such
|
||||
as a list of adopted protocols or a pointer to a corresponding
|
||||
@interface. See objc/objc-act.h for details. */
|
||||
tree objc_info;
|
||||
};
|
||||
|
||||
/* Record whether a type or decl was written with nonconstant size.
|
||||
Note that TYPE_SIZE may have simplified to a constant. */
|
||||
#define C_TYPE_VARIABLE_SIZE(TYPE) TYPE_LANG_FLAG_1 (TYPE)
|
||||
#define C_DECL_VARIABLE_SIZE(TYPE) DECL_LANG_FLAG_0 (TYPE)
|
||||
|
||||
/* Record whether a typedef for type `int' was actually `signed int'. */
|
||||
#define C_TYPEDEF_EXPLICITLY_SIGNED(EXP) DECL_LANG_FLAG_1 (EXP)
|
||||
|
||||
/* For a FUNCTION_DECL, nonzero if it was defined without an explicit
|
||||
return type. */
|
||||
#define C_FUNCTION_IMPLICIT_INT(EXP) DECL_LANG_FLAG_1 (EXP)
|
||||
|
||||
/* For a FUNCTION_DECL, nonzero if it was an implicit declaration. */
|
||||
#define C_DECL_IMPLICIT(EXP) DECL_LANG_FLAG_2 (EXP)
|
||||
|
||||
/* For FUNCTION_DECLs, evaluates true if the decl is built-in but has
|
||||
been declared. */
|
||||
#define C_DECL_DECLARED_BUILTIN(EXP) \
|
||||
DECL_LANG_FLAG_3 (FUNCTION_DECL_CHECK (EXP))
|
||||
|
||||
/* For FUNCTION_DECLs, evaluates true if the decl is built-in, has a
|
||||
built-in prototype and does not have a non-built-in prototype. */
|
||||
#define C_DECL_BUILTIN_PROTOTYPE(EXP) \
|
||||
DECL_LANG_FLAG_6 (FUNCTION_DECL_CHECK (EXP))
|
||||
|
||||
/* Record whether a decl was declared register. This is strictly a
|
||||
front-end flag, whereas DECL_REGISTER is used for code generation;
|
||||
they may differ for structures with volatile fields. */
|
||||
#define C_DECL_REGISTER(EXP) DECL_LANG_FLAG_4 (EXP)
|
||||
|
||||
/* Record whether a decl was used in an expression anywhere except an
|
||||
unevaluated operand of sizeof / typeof / alignof. This is only
|
||||
used for functions declared static but not defined, though outside
|
||||
sizeof and typeof it is set for other function decls as well. */
|
||||
#define C_DECL_USED(EXP) DECL_LANG_FLAG_5 (FUNCTION_DECL_CHECK (EXP))
|
||||
|
||||
/* Record whether a label was defined in a statement expression which
|
||||
has finished and so can no longer be jumped to. */
|
||||
#define C_DECL_UNJUMPABLE_STMT_EXPR(EXP) \
|
||||
DECL_LANG_FLAG_6 (LABEL_DECL_CHECK (EXP))
|
||||
|
||||
/* Record whether a label was the subject of a goto from outside the
|
||||
current level of statement expression nesting and so cannot be
|
||||
defined right now. */
|
||||
#define C_DECL_UNDEFINABLE_STMT_EXPR(EXP) \
|
||||
DECL_LANG_FLAG_7 (LABEL_DECL_CHECK (EXP))
|
||||
|
||||
/* Record whether a label was defined in the scope of an identifier
|
||||
with variably modified type which has finished and so can no longer
|
||||
be jumped to. */
|
||||
#define C_DECL_UNJUMPABLE_VM(EXP) \
|
||||
DECL_LANG_FLAG_3 (LABEL_DECL_CHECK (EXP))
|
||||
|
||||
/* Record whether a label was the subject of a goto from outside the
|
||||
current level of scopes of identifiers with variably modified type
|
||||
and so cannot be defined right now. */
|
||||
#define C_DECL_UNDEFINABLE_VM(EXP) \
|
||||
DECL_LANG_FLAG_5 (LABEL_DECL_CHECK (EXP))
|
||||
|
||||
/* Record whether a variable has been declared threadprivate by
|
||||
#pragma omp threadprivate. */
|
||||
#define C_DECL_THREADPRIVATE_P(DECL) DECL_LANG_FLAG_3 (VAR_DECL_CHECK (DECL))
|
||||
|
||||
/* Nonzero for a decl which either doesn't exist or isn't a prototype.
|
||||
N.B. Could be simplified if all built-in decls had complete prototypes
|
||||
(but this is presently difficult because some of them need FILE*). */
|
||||
#define C_DECL_ISNT_PROTOTYPE(EXP) \
|
||||
(EXP == 0 \
|
||||
|| (TYPE_ARG_TYPES (TREE_TYPE (EXP)) == 0 \
|
||||
&& !DECL_BUILT_IN (EXP)))
|
||||
|
||||
/* For FUNCTION_TYPE, a hidden list of types of arguments. The same as
|
||||
TYPE_ARG_TYPES for functions with prototypes, but created for functions
|
||||
without prototypes. */
|
||||
#define TYPE_ACTUAL_ARG_TYPES(NODE) TYPE_LANG_SLOT_1 (NODE)
|
||||
|
||||
/* Record parser information about an expression that is irrelevant
|
||||
for code generation alongside a tree representing its value. */
|
||||
struct c_expr
|
||||
{
|
||||
/* The value of the expression. */
|
||||
tree value;
|
||||
/* Record the original binary operator of an expression, which may
|
||||
have been changed by fold, STRING_CST for unparenthesized string
|
||||
constants, or ERROR_MARK for other expressions (including
|
||||
parenthesized expressions). */
|
||||
enum tree_code original_code;
|
||||
};
|
||||
|
||||
/* A kind of type specifier. Note that this information is currently
|
||||
only used to distinguish tag definitions, tag references and typeof
|
||||
uses. */
|
||||
enum c_typespec_kind {
|
||||
/* A reserved keyword type specifier. */
|
||||
ctsk_resword,
|
||||
/* A reference to a tag, previously declared, such as "struct foo".
|
||||
This includes where the previous declaration was as a different
|
||||
kind of tag, in which case this is only valid if shadowing that
|
||||
tag in an inner scope. */
|
||||
ctsk_tagref,
|
||||
/* A reference to a tag, not previously declared in a visible
|
||||
scope. */
|
||||
ctsk_tagfirstref,
|
||||
/* A definition of a tag such as "struct foo { int a; }". */
|
||||
ctsk_tagdef,
|
||||
/* A typedef name. */
|
||||
ctsk_typedef,
|
||||
/* An ObjC-specific kind of type specifier. */
|
||||
ctsk_objc,
|
||||
/* A typeof specifier. */
|
||||
ctsk_typeof
|
||||
};
|
||||
|
||||
/* A type specifier: this structure is created in the parser and
|
||||
passed to declspecs_add_type only. */
|
||||
struct c_typespec {
|
||||
/* What kind of type specifier this is. */
|
||||
enum c_typespec_kind kind;
|
||||
/* The specifier itself. */
|
||||
tree spec;
|
||||
};
|
||||
|
||||
/* A storage class specifier. */
|
||||
enum c_storage_class {
|
||||
csc_none,
|
||||
csc_auto,
|
||||
csc_extern,
|
||||
csc_register,
|
||||
csc_static,
|
||||
csc_typedef
|
||||
};
|
||||
|
||||
/* A type specifier keyword "void", "_Bool", "char", "int", "float",
|
||||
"double", or none of these. */
|
||||
enum c_typespec_keyword {
|
||||
cts_none,
|
||||
cts_void,
|
||||
cts_bool,
|
||||
cts_char,
|
||||
cts_int,
|
||||
cts_float,
|
||||
cts_double,
|
||||
cts_dfloat32,
|
||||
cts_dfloat64,
|
||||
cts_dfloat128
|
||||
};
|
||||
|
||||
/* A sequence of declaration specifiers in C. */
|
||||
struct c_declspecs {
|
||||
/* The type specified, if a single type specifier such as a struct,
|
||||
union or enum specifier, typedef name or typeof specifies the
|
||||
whole type, or NULL_TREE if none or a keyword such as "void" or
|
||||
"char" is used. Does not include qualifiers. */
|
||||
tree type;
|
||||
/* The attributes from a typedef decl. */
|
||||
tree decl_attr;
|
||||
/* When parsing, the attributes. Outside the parser, this will be
|
||||
NULL; attributes (possibly from multiple lists) will be passed
|
||||
separately. */
|
||||
tree attrs;
|
||||
/* Any type specifier keyword used such as "int", not reflecting
|
||||
modifiers such as "short", or cts_none if none. */
|
||||
enum c_typespec_keyword typespec_word;
|
||||
/* The storage class specifier, or csc_none if none. */
|
||||
enum c_storage_class storage_class;
|
||||
/* Whether any declaration specifiers have been seen at all. */
|
||||
BOOL_BITFIELD declspecs_seen_p : 1;
|
||||
/* Whether a type specifier has been seen. */
|
||||
BOOL_BITFIELD type_seen_p : 1;
|
||||
/* Whether something other than a storage class specifier or
|
||||
attribute has been seen. This is used to warn for the
|
||||
obsolescent usage of storage class specifiers other than at the
|
||||
start of the list. (Doing this properly would require function
|
||||
specifiers to be handled separately from storage class
|
||||
specifiers.) */
|
||||
BOOL_BITFIELD non_sc_seen_p : 1;
|
||||
/* Whether the type is specified by a typedef or typeof name. */
|
||||
BOOL_BITFIELD typedef_p : 1;
|
||||
/* Whether a struct, union or enum type either had its content
|
||||
defined by a type specifier in the list or was the first visible
|
||||
declaration of its tag. */
|
||||
BOOL_BITFIELD tag_defined_p : 1;
|
||||
/* Whether the type is explicitly "signed" or specified by a typedef
|
||||
whose type is explicitly "signed". */
|
||||
BOOL_BITFIELD explicit_signed_p : 1;
|
||||
/* Whether the specifiers include a deprecated typedef. */
|
||||
BOOL_BITFIELD deprecated_p : 1;
|
||||
/* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */
|
||||
/* Whether the specifiers include a unavailable typedef. */
|
||||
BOOL_BITFIELD unavailable_p : 1;
|
||||
/* APPLE LOCAL end "unavailable" attribute (radar 2809697) */
|
||||
/* Whether the type defaulted to "int" because there were no type
|
||||
specifiers. */
|
||||
BOOL_BITFIELD default_int_p;
|
||||
/* Whether "long" was specified. */
|
||||
BOOL_BITFIELD long_p : 1;
|
||||
/* Whether "long" was specified more than once. */
|
||||
BOOL_BITFIELD long_long_p : 1;
|
||||
/* Whether "short" was specified. */
|
||||
BOOL_BITFIELD short_p : 1;
|
||||
/* Whether "signed" was specified. */
|
||||
BOOL_BITFIELD signed_p : 1;
|
||||
/* Whether "unsigned" was specified. */
|
||||
BOOL_BITFIELD unsigned_p : 1;
|
||||
/* Whether "complex" was specified. */
|
||||
BOOL_BITFIELD complex_p : 1;
|
||||
/* Whether "inline" was specified. */
|
||||
BOOL_BITFIELD inline_p : 1;
|
||||
/* Whether "__thread" was specified. */
|
||||
BOOL_BITFIELD thread_p : 1;
|
||||
/* Whether "const" was specified. */
|
||||
BOOL_BITFIELD const_p : 1;
|
||||
/* Whether "volatile" was specified. */
|
||||
BOOL_BITFIELD volatile_p : 1;
|
||||
/* Whether "restrict" was specified. */
|
||||
BOOL_BITFIELD restrict_p : 1;
|
||||
};
|
||||
|
||||
/* The various kinds of declarators in C. */
|
||||
enum c_declarator_kind {
|
||||
/* An identifier. */
|
||||
cdk_id,
|
||||
/* A function. */
|
||||
cdk_function,
|
||||
/* An array. */
|
||||
cdk_array,
|
||||
/* A pointer. */
|
||||
cdk_pointer,
|
||||
/* APPLE LOCAL blocks (C++ ch) */
|
||||
cdk_block_pointer,
|
||||
/* Parenthesized declarator with nested attributes. */
|
||||
cdk_attrs
|
||||
};
|
||||
|
||||
/* Information about the parameters in a function declarator. */
|
||||
struct c_arg_info {
|
||||
/* A list of parameter decls. */
|
||||
tree parms;
|
||||
/* A list of structure, union and enum tags defined. */
|
||||
tree tags;
|
||||
/* A list of argument types to go in the FUNCTION_TYPE. */
|
||||
tree types;
|
||||
/* A list of non-parameter decls (notably enumeration constants)
|
||||
defined with the parameters. */
|
||||
tree others;
|
||||
/* A list of VLA sizes from the parameters. In a function
|
||||
definition, these are used to ensure that side-effects in sizes
|
||||
of arrays converted to pointers (such as a parameter int i[n++])
|
||||
take place; otherwise, they are ignored. */
|
||||
tree pending_sizes;
|
||||
/* True when these arguments had [*]. */
|
||||
BOOL_BITFIELD had_vla_unspec : 1;
|
||||
};
|
||||
|
||||
/* A declarator. */
|
||||
struct c_declarator {
|
||||
/* The kind of declarator. */
|
||||
enum c_declarator_kind kind;
|
||||
/* Except for cdk_id, the contained declarator. For cdk_id, NULL. */
|
||||
struct c_declarator *declarator;
|
||||
location_t id_loc; /* Currently only set for cdk_id. */
|
||||
union {
|
||||
/* For identifiers, an IDENTIFIER_NODE or NULL_TREE if an abstract
|
||||
declarator. */
|
||||
tree id;
|
||||
/* For functions. */
|
||||
struct c_arg_info *arg_info;
|
||||
/* For arrays. */
|
||||
struct {
|
||||
/* The array dimension, or NULL for [] and [*]. */
|
||||
tree dimen;
|
||||
/* The qualifiers inside []. */
|
||||
int quals;
|
||||
/* The attributes (currently ignored) inside []. */
|
||||
tree attrs;
|
||||
/* Whether [static] was used. */
|
||||
BOOL_BITFIELD static_p : 1;
|
||||
/* Whether [*] was used. */
|
||||
BOOL_BITFIELD vla_unspec_p : 1;
|
||||
} array;
|
||||
/* For pointers, the qualifiers on the pointer type. */
|
||||
int pointer_quals;
|
||||
/* For attributes. */
|
||||
tree attrs;
|
||||
} u;
|
||||
};
|
||||
|
||||
/* A type name. */
|
||||
struct c_type_name {
|
||||
/* The declaration specifiers. */
|
||||
struct c_declspecs *specs;
|
||||
/* The declarator. */
|
||||
struct c_declarator *declarator;
|
||||
};
|
||||
|
||||
/* A parameter. */
|
||||
struct c_parm {
|
||||
/* The declaration specifiers, minus any prefix attributes. */
|
||||
struct c_declspecs *specs;
|
||||
/* The attributes. */
|
||||
tree attrs;
|
||||
/* The declarator. */
|
||||
struct c_declarator *declarator;
|
||||
};
|
||||
|
||||
/* Save and restore the variables in this file and elsewhere
|
||||
that keep track of the progress of compilation of the current function.
|
||||
Used for nested functions. */
|
||||
|
||||
struct language_function GTY(())
|
||||
{
|
||||
struct c_language_function base;
|
||||
tree x_break_label;
|
||||
tree x_cont_label;
|
||||
struct c_switch * GTY((skip)) x_switch_stack;
|
||||
struct c_arg_info * GTY((skip)) arg_info;
|
||||
int returns_value;
|
||||
int returns_null;
|
||||
int returns_abnormally;
|
||||
int warn_about_return_type;
|
||||
};
|
||||
|
||||
/* Save lists of labels used or defined in particular contexts.
|
||||
Allocated on the parser obstack. */
|
||||
|
||||
struct c_label_list
|
||||
{
|
||||
/* The label at the head of the list. */
|
||||
tree label;
|
||||
/* The rest of the list. */
|
||||
struct c_label_list *next;
|
||||
};
|
||||
|
||||
/* Statement expression context. */
|
||||
|
||||
struct c_label_context_se
|
||||
{
|
||||
/* The labels defined at this level of nesting. */
|
||||
struct c_label_list *labels_def;
|
||||
/* The labels used at this level of nesting. */
|
||||
struct c_label_list *labels_used;
|
||||
/* The next outermost context. */
|
||||
struct c_label_context_se *next;
|
||||
};
|
||||
|
||||
/* Context of variably modified declarations. */
|
||||
|
||||
struct c_label_context_vm
|
||||
{
|
||||
/* The labels defined at this level of nesting. */
|
||||
struct c_label_list *labels_def;
|
||||
/* The labels used at this level of nesting. */
|
||||
struct c_label_list *labels_used;
|
||||
/* The scope of this context. Multiple contexts may be at the same
|
||||
numbered scope, since each variably modified declaration starts a
|
||||
new context. */
|
||||
unsigned scope;
|
||||
/* The next outermost context. */
|
||||
struct c_label_context_vm *next;
|
||||
};
|
||||
|
||||
|
||||
/* in c-parser.c */
|
||||
extern void c_parse_init (void);
|
||||
|
||||
/* in c-aux-info.c */
|
||||
extern void gen_aux_info_record (tree, int, int, int);
|
||||
|
||||
/* in c-decl.c */
|
||||
extern struct obstack parser_obstack;
|
||||
extern tree c_break_label;
|
||||
extern tree c_cont_label;
|
||||
|
||||
extern int global_bindings_p (void);
|
||||
extern void push_scope (void);
|
||||
extern tree pop_scope (void);
|
||||
extern void insert_block (tree);
|
||||
extern void c_expand_body (tree);
|
||||
|
||||
extern void c_init_decl_processing (void);
|
||||
extern void c_dup_lang_specific_decl (tree);
|
||||
extern void c_print_identifier (FILE *, tree, int);
|
||||
extern int quals_from_declspecs (const struct c_declspecs *);
|
||||
extern struct c_declarator *build_array_declarator (tree, struct c_declspecs *,
|
||||
bool, bool);
|
||||
extern tree build_enumerator (tree, tree);
|
||||
extern tree check_for_loop_decls (void);
|
||||
extern void mark_forward_parm_decls (void);
|
||||
extern void declare_parm_level (void);
|
||||
extern void undeclared_variable (tree, location_t);
|
||||
extern tree declare_label (tree);
|
||||
extern tree define_label (location_t, tree);
|
||||
extern void c_maybe_initialize_eh (void);
|
||||
extern void finish_decl (tree, tree, tree);
|
||||
extern tree finish_enum (tree, tree, tree);
|
||||
extern void finish_function (void);
|
||||
extern tree finish_struct (tree, tree, tree);
|
||||
extern struct c_arg_info *get_parm_info (bool);
|
||||
extern tree grokfield (struct c_declarator *, struct c_declspecs *, tree);
|
||||
extern tree groktypename (struct c_type_name *);
|
||||
/* APPLE LOCAL blocks 6339747 */
|
||||
extern tree grokblockdecl (struct c_declspecs *, struct c_declarator *);
|
||||
extern tree grokparm (const struct c_parm *);
|
||||
extern tree implicitly_declare (tree);
|
||||
extern void keep_next_level (void);
|
||||
extern void pending_xref_error (void);
|
||||
extern void c_push_function_context (struct function *);
|
||||
extern void c_pop_function_context (struct function *);
|
||||
extern void push_parm_decl (const struct c_parm *);
|
||||
extern struct c_declarator *set_array_declarator_inner (struct c_declarator *,
|
||||
struct c_declarator *,
|
||||
bool);
|
||||
extern tree builtin_function (const char *, tree, int, enum built_in_class,
|
||||
const char *, tree);
|
||||
extern void shadow_tag (const struct c_declspecs *);
|
||||
extern void shadow_tag_warned (const struct c_declspecs *, int);
|
||||
extern tree start_enum (tree);
|
||||
extern int start_function (struct c_declspecs *, struct c_declarator *, tree);
|
||||
extern tree start_decl (struct c_declarator *, struct c_declspecs *, bool,
|
||||
tree);
|
||||
extern tree start_struct (enum tree_code, tree);
|
||||
extern void store_parm_decls (void);
|
||||
extern void store_parm_decls_from (struct c_arg_info *);
|
||||
extern tree xref_tag (enum tree_code, tree);
|
||||
extern struct c_typespec parser_xref_tag (enum tree_code, tree);
|
||||
extern int c_expand_decl (tree);
|
||||
extern struct c_parm *build_c_parm (struct c_declspecs *, tree,
|
||||
struct c_declarator *);
|
||||
extern struct c_declarator *build_attrs_declarator (tree,
|
||||
struct c_declarator *);
|
||||
extern struct c_declarator *build_function_declarator (struct c_arg_info *,
|
||||
struct c_declarator *);
|
||||
extern struct c_declarator *build_id_declarator (tree);
|
||||
extern struct c_declarator *make_pointer_declarator (struct c_declspecs *,
|
||||
struct c_declarator *);
|
||||
/* APPLE LOCAL begin radar 5814025 - blocks (C++ cg) */
|
||||
extern struct c_declarator *make_block_pointer_declarator (struct c_declspecs *,
|
||||
struct c_declarator *);
|
||||
/* APPLE LOCAL end radar 5814025 - blocks (C++ cg) */
|
||||
extern struct c_declspecs *build_null_declspecs (void);
|
||||
extern struct c_declspecs *declspecs_add_qual (struct c_declspecs *, tree);
|
||||
extern struct c_declspecs *declspecs_add_type (struct c_declspecs *,
|
||||
struct c_typespec);
|
||||
extern struct c_declspecs *declspecs_add_scspec (struct c_declspecs *, tree);
|
||||
extern struct c_declspecs *declspecs_add_attrs (struct c_declspecs *, tree);
|
||||
extern struct c_declspecs *finish_declspecs (struct c_declspecs *);
|
||||
|
||||
/* in c-objc-common.c */
|
||||
extern int c_disregard_inline_limits (tree);
|
||||
extern int c_cannot_inline_tree_fn (tree *);
|
||||
extern bool c_objc_common_init (void);
|
||||
extern bool c_missing_noreturn_ok_p (tree);
|
||||
extern tree c_objc_common_truthvalue_conversion (tree expr);
|
||||
extern bool c_warn_unused_global_decl (tree);
|
||||
extern void c_initialize_diagnostics (diagnostic_context *);
|
||||
extern bool c_vla_unspec_p (tree x, tree fn);
|
||||
|
||||
#define c_build_type_variant(TYPE, CONST_P, VOLATILE_P) \
|
||||
c_build_qualified_type ((TYPE), \
|
||||
((CONST_P) ? TYPE_QUAL_CONST : 0) | \
|
||||
((VOLATILE_P) ? TYPE_QUAL_VOLATILE : 0))
|
||||
|
||||
/* in c-typeck.c */
|
||||
extern int in_alignof;
|
||||
extern int in_sizeof;
|
||||
extern int in_typeof;
|
||||
|
||||
extern struct c_switch *c_switch_stack;
|
||||
extern struct c_label_context_se *label_context_stack_se;
|
||||
extern struct c_label_context_vm *label_context_stack_vm;
|
||||
|
||||
extern tree require_complete_type (tree);
|
||||
extern int same_translation_unit_p (tree, tree);
|
||||
extern int comptypes (tree, tree);
|
||||
extern bool c_vla_type_p (tree);
|
||||
extern bool c_mark_addressable (tree);
|
||||
extern void c_incomplete_type_error (tree, tree);
|
||||
extern tree c_type_promotes_to (tree);
|
||||
extern struct c_expr default_function_array_conversion (struct c_expr);
|
||||
extern tree composite_type (tree, tree);
|
||||
extern tree build_component_ref (tree, tree);
|
||||
extern tree build_array_ref (tree, tree);
|
||||
extern tree build_external_ref (tree, int, location_t);
|
||||
extern void pop_maybe_used (bool);
|
||||
extern struct c_expr c_expr_sizeof_expr (struct c_expr);
|
||||
extern struct c_expr c_expr_sizeof_type (struct c_type_name *);
|
||||
extern struct c_expr parser_build_unary_op (enum tree_code, struct c_expr);
|
||||
extern struct c_expr parser_build_binary_op (enum tree_code, struct c_expr,
|
||||
struct c_expr);
|
||||
extern tree build_conditional_expr (tree, tree, tree);
|
||||
extern tree build_compound_expr (tree, tree);
|
||||
extern tree c_cast_expr (struct c_type_name *, tree);
|
||||
extern tree build_c_cast (tree, tree);
|
||||
extern void store_init_value (tree, tree);
|
||||
extern void error_init (const char *);
|
||||
extern void pedwarn_init (const char *);
|
||||
extern void maybe_warn_string_init (tree, struct c_expr);
|
||||
extern void start_init (tree, tree, int);
|
||||
extern void finish_init (void);
|
||||
extern void really_start_incremental_init (tree);
|
||||
extern void push_init_level (int);
|
||||
extern struct c_expr pop_init_level (int);
|
||||
extern void set_init_index (tree, tree);
|
||||
extern void set_init_label (tree);
|
||||
extern void process_init_element (struct c_expr);
|
||||
extern tree build_compound_literal (tree, tree);
|
||||
extern tree c_start_case (tree);
|
||||
extern void c_finish_case (tree);
|
||||
extern tree build_asm_expr (tree, tree, tree, tree, bool);
|
||||
extern tree build_asm_stmt (tree, tree);
|
||||
extern tree c_convert_parm_for_inlining (tree, tree, tree, int);
|
||||
extern int c_types_compatible_p (tree, tree);
|
||||
extern tree c_begin_compound_stmt (bool);
|
||||
extern tree c_end_compound_stmt (tree, bool);
|
||||
extern void c_finish_if_stmt (location_t, tree, tree, tree, bool);
|
||||
/* APPLE LOCAL begin for-fsf-4_4 3274130 5295549 */ \
|
||||
extern void c_finish_loop (location_t, tree, tree, tree, tree, tree, tree,
|
||||
bool);
|
||||
/* APPLE LOCAL end for-fsf-4_4 3274130 5295549 */ \
|
||||
extern tree c_begin_stmt_expr (void);
|
||||
extern tree c_finish_stmt_expr (tree);
|
||||
extern tree c_process_expr_stmt (tree);
|
||||
extern tree c_finish_expr_stmt (tree);
|
||||
extern tree c_finish_return (tree);
|
||||
extern tree c_finish_bc_stmt (tree *, bool);
|
||||
extern tree c_finish_goto_label (tree);
|
||||
extern tree c_finish_goto_ptr (tree);
|
||||
extern void c_begin_vm_scope (unsigned int);
|
||||
extern void c_end_vm_scope (unsigned int);
|
||||
extern tree c_expr_to_decl (tree, bool *, bool *, bool *);
|
||||
extern tree c_begin_omp_parallel (void);
|
||||
extern tree c_finish_omp_parallel (tree, tree);
|
||||
extern tree c_finish_omp_clauses (tree);
|
||||
|
||||
/* Set to 0 at beginning of a function definition, set to 1 if
|
||||
a return statement that specifies a return value is seen. */
|
||||
|
||||
extern int current_function_returns_value;
|
||||
|
||||
/* Set to 0 at beginning of a function definition, set to 1 if
|
||||
a return statement with no argument is seen. */
|
||||
|
||||
extern int current_function_returns_null;
|
||||
|
||||
/* Set to 0 at beginning of a function definition, set to 1 if
|
||||
a call to a noreturn function is seen. */
|
||||
|
||||
extern int current_function_returns_abnormally;
|
||||
|
||||
/* Nonzero means we are reading code that came from a system header file. */
|
||||
|
||||
extern int system_header_p;
|
||||
|
||||
/* True means global_bindings_p should return false even if the scope stack
|
||||
says we are in file scope. */
|
||||
|
||||
extern bool c_override_global_bindings_to_false;
|
||||
|
||||
/* True means we've initialized exception handling. */
|
||||
extern bool c_eh_initialized_p;
|
||||
|
||||
/* In c-decl.c */
|
||||
extern void c_finish_incomplete_decl (tree);
|
||||
extern void c_write_global_declarations (void);
|
||||
|
||||
/* APPLE LOCAL radar 5741070 */
|
||||
extern tree c_return_interface_record_type (tree);
|
||||
/* In order for the format checking to accept the C frontend
|
||||
diagnostic framework extensions, you must include this file before
|
||||
toplev.h, not after. */
|
||||
#if GCC_VERSION >= 4001
|
||||
#define ATTRIBUTE_GCC_CDIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m ,n))) ATTRIBUTE_NONNULL(m)
|
||||
#else
|
||||
#define ATTRIBUTE_GCC_CDIAG(m, n) ATTRIBUTE_NONNULL(m)
|
||||
#endif
|
||||
|
||||
extern void pedwarn_c90 (const char *, ...) ATTRIBUTE_GCC_CDIAG(1,2);
|
||||
extern void pedwarn_c99 (const char *, ...) ATTRIBUTE_GCC_CDIAG(1,2);
|
||||
|
||||
#endif /* ! GCC_C_TREE_H */
|
File diff suppressed because it is too large
Load Diff
@ -1,967 +0,0 @@
|
||||
; Options for the C, ObjC, C++ and ObjC++ front ends.
|
||||
; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
;
|
||||
; 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 2, 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 COPYING. If not, write to the Free
|
||||
; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
; 02110-1301, USA.
|
||||
|
||||
; See the GCC internals manual for a description of this file's format.
|
||||
|
||||
; $FreeBSD$
|
||||
; Please try to keep this file in ASCII collating order.
|
||||
|
||||
Language
|
||||
C
|
||||
|
||||
Language
|
||||
ObjC
|
||||
|
||||
Language
|
||||
C++
|
||||
|
||||
Language
|
||||
ObjC++
|
||||
|
||||
-output-pch=
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
|
||||
A
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-A<question>=<answer> Assert the <answer> to <question>. Putting '-' before <question> disables the <answer> to <question>
|
||||
|
||||
C
|
||||
C ObjC C++ ObjC++
|
||||
Do not discard comments
|
||||
|
||||
CC
|
||||
C ObjC C++ ObjC++
|
||||
Do not discard comments in macro expansions
|
||||
|
||||
D
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-D<macro>[=<val>] Define a <macro> with <val> as its value. If just <macro> is given, <val> is taken to be 1
|
||||
|
||||
E
|
||||
C ObjC C++ ObjC++ Undocumented
|
||||
|
||||
F
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-F <dir> Add <dir> to the end of the main framework include path
|
||||
|
||||
H
|
||||
C ObjC C++ ObjC++
|
||||
Print the name of header files as they are used
|
||||
|
||||
I
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-I <dir> Add <dir> to the end of the main include path
|
||||
|
||||
M
|
||||
C ObjC C++ ObjC++
|
||||
Generate make dependencies
|
||||
|
||||
MD
|
||||
C ObjC C++ ObjC++ Separate
|
||||
Generate make dependencies and compile
|
||||
|
||||
MF
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-MF <file> Write dependency output to the given file
|
||||
|
||||
MG
|
||||
C ObjC C++ ObjC++
|
||||
Treat missing header files as generated files
|
||||
|
||||
MM
|
||||
C ObjC C++ ObjC++
|
||||
Like -M but ignore system header files
|
||||
|
||||
MMD
|
||||
C ObjC C++ ObjC++ Separate
|
||||
Like -MD but ignore system header files
|
||||
|
||||
MP
|
||||
C ObjC C++ ObjC++
|
||||
Generate phony targets for all headers
|
||||
|
||||
MQ
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-MQ <target> Add a MAKE-quoted target
|
||||
|
||||
MT
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-MT <target> Add an unquoted target
|
||||
|
||||
P
|
||||
C ObjC C++ ObjC++
|
||||
Do not generate #line directives
|
||||
|
||||
U
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-U<macro> Undefine <macro>
|
||||
|
||||
Wabi
|
||||
C++ ObjC++ Var(warn_abi)
|
||||
Warn about things that will change when compiling with an ABI-compliant compiler
|
||||
|
||||
Waddress
|
||||
C ObjC C++ ObjC++ Var(warn_address)
|
||||
Warn about suspicious uses of memory addresses
|
||||
|
||||
Wall
|
||||
C ObjC C++ ObjC++
|
||||
Enable most warning messages
|
||||
|
||||
Wassign-intercept
|
||||
ObjC ObjC++ Var(warn_assign_intercept)
|
||||
Warn whenever an Objective-C assignment is being intercepted by the garbage collector
|
||||
|
||||
Wbad-function-cast
|
||||
C ObjC Var(warn_bad_function_cast)
|
||||
Warn about casting functions to incompatible types
|
||||
|
||||
Wc++-compat
|
||||
C ObjC Var(warn_cxx_compat)
|
||||
Warn about C constructs that are not in the common subset of C and C++
|
||||
|
||||
|
||||
Wcast-qual
|
||||
C ObjC C++ ObjC++ Var(warn_cast_qual)
|
||||
Warn about casts which discard qualifiers
|
||||
|
||||
Wchar-subscripts
|
||||
C ObjC C++ ObjC++ Var(warn_char_subscripts)
|
||||
Warn about subscripts whose type is \"char\"
|
||||
|
||||
Wcomment
|
||||
C ObjC C++ ObjC++
|
||||
Warn about possibly nested block comments, and C++ comments spanning more than one physical line
|
||||
|
||||
Wcomments
|
||||
C ObjC C++ ObjC++
|
||||
Synonym for -Wcomment
|
||||
|
||||
Wconversion
|
||||
C ObjC C++ ObjC++ Var(warn_conversion)
|
||||
Warn about possibly confusing type conversions
|
||||
|
||||
Wctor-dtor-privacy
|
||||
C++ ObjC++ Var(warn_ctor_dtor_privacy)
|
||||
Warn when all constructors and destructors are private
|
||||
|
||||
Wdeclaration-after-statement
|
||||
C ObjC Var(warn_declaration_after_statement)
|
||||
Warn when a declaration is found after a statement
|
||||
|
||||
Wdeprecated
|
||||
C++ ObjC++ Var(warn_deprecated) Init(1)
|
||||
Warn about deprecated compiler features
|
||||
|
||||
Wdiv-by-zero
|
||||
C ObjC C++ ObjC++ Var(warn_div_by_zero) Init(1)
|
||||
Warn about compile-time integer division by zero
|
||||
|
||||
Weffc++
|
||||
C++ ObjC++ Var(warn_ecpp)
|
||||
Warn about violations of Effective C++ style rules
|
||||
|
||||
Wendif-labels
|
||||
C ObjC C++ ObjC++
|
||||
Warn about stray tokens after #elif and #endif
|
||||
|
||||
Werror
|
||||
C ObjC C++ ObjC++
|
||||
; Documented in common.opt
|
||||
|
||||
Werror-implicit-function-declaration
|
||||
C ObjC RejectNegative
|
||||
Make implicit function declarations an error
|
||||
|
||||
Wfloat-equal
|
||||
C ObjC C++ ObjC++ Var(warn_float_equal)
|
||||
Warn if testing floating point numbers for equality
|
||||
|
||||
Wformat
|
||||
C ObjC C++ ObjC++
|
||||
Warn about printf/scanf/strftime/strfmon format string anomalies
|
||||
|
||||
Wformat-extra-args
|
||||
C ObjC C++ ObjC++ Var(warn_format_extra_args)
|
||||
Warn if passing too many arguments to a function for its format string
|
||||
|
||||
Wformat-nonliteral
|
||||
C ObjC C++ ObjC++ Var(warn_format_nonliteral)
|
||||
Warn about format strings that are not literals
|
||||
|
||||
Wformat-security
|
||||
C ObjC C++ ObjC++ Var(warn_format_security)
|
||||
Warn about possible security problems with format functions
|
||||
|
||||
Wformat-y2k
|
||||
C ObjC C++ ObjC++ Var(warn_format_y2k)
|
||||
Warn about strftime formats yielding 2-digit years
|
||||
|
||||
Wformat-zero-length
|
||||
C ObjC Var(warn_format_zero_length)
|
||||
Warn about zero-length formats
|
||||
|
||||
Wformat=
|
||||
C ObjC C++ ObjC++ Joined
|
||||
|
||||
Winit-self
|
||||
C ObjC C++ ObjC++ Var(warn_init_self)
|
||||
Warn about variables which are initialized to themselves
|
||||
|
||||
Wimplicit
|
||||
C ObjC C++ ObjC++
|
||||
|
||||
Wimplicit-function-declaration
|
||||
C ObjC Var(mesg_implicit_function_declaration) Init(-1)
|
||||
Warn about implicit function declarations
|
||||
|
||||
Wimplicit-int
|
||||
C ObjC Var(warn_implicit_int)
|
||||
Warn when a declaration does not specify a type
|
||||
|
||||
Wimport
|
||||
C ObjC C++ ObjC++
|
||||
Deprecated. This switch has no effect
|
||||
|
||||
Wint-to-pointer-cast
|
||||
C ObjC Var(warn_int_to_pointer_cast) Init(1)
|
||||
Warn when there is a cast to a pointer from an integer of a different size
|
||||
|
||||
Winvalid-offsetof
|
||||
C++ ObjC++ Var(warn_invalid_offsetof) Init(1)
|
||||
Warn about invalid uses of the \"offsetof\" macro
|
||||
|
||||
Winvalid-pch
|
||||
C ObjC C++ ObjC++
|
||||
Warn about PCH files that are found but not used
|
||||
|
||||
Wlong-long
|
||||
C ObjC C++ ObjC++ Var(warn_long_long) Init(1)
|
||||
Do not warn about using \"long long\" when -pedantic
|
||||
|
||||
Wmain
|
||||
C ObjC
|
||||
Warn about suspicious declarations of \"main\"
|
||||
|
||||
Wmissing-braces
|
||||
C ObjC C++ ObjC++ Var(warn_missing_braces)
|
||||
Warn about possibly missing braces around initializers
|
||||
|
||||
Wmissing-declarations
|
||||
C ObjC Var(warn_missing_declarations)
|
||||
Warn about global functions without previous declarations
|
||||
|
||||
Wmissing-field-initializers
|
||||
C ObjC C++ ObjC++ Var(warn_missing_field_initializers) Init(-1)
|
||||
Warn about missing fields in struct initializers
|
||||
|
||||
Wmissing-format-attribute
|
||||
C ObjC C++ ObjC++ Var(warn_missing_format_attribute)
|
||||
Warn about functions which might be candidates for format attributes
|
||||
|
||||
Wmissing-include-dirs
|
||||
C ObjC C++ ObjC++
|
||||
Warn about user-specified include directories that do not exist
|
||||
|
||||
; APPLE LOCAL begin warn missing prototype 6261539
|
||||
Wmissing-prototypes
|
||||
C ObjC C++ ObjC++ Var(warn_missing_prototypes)
|
||||
Warn about global functions without prototypes
|
||||
; APPLE LOCAL end warn missing prototype 6261539
|
||||
|
||||
; APPLE LOCAL begin -Wmost
|
||||
Wmost
|
||||
C ObjC C++ ObjC++
|
||||
Like -Wall but without -Wparentheses
|
||||
; APPLE LOCAL end -Wmost
|
||||
|
||||
Wmultichar
|
||||
C ObjC C++ ObjC++
|
||||
Warn about use of multi-character character constants
|
||||
|
||||
Wnested-externs
|
||||
C ObjC Var(warn_nested_externs)
|
||||
Warn about \"extern\" declarations not at file scope
|
||||
|
||||
; APPLE LOCAL begin -Wnewline-eof
|
||||
Wnewline-eof
|
||||
C ObjC C++ ObjC++
|
||||
Warn about files missing a newline at the end of the file
|
||||
; APPLE LOCAL end -Wnewline-eof
|
||||
|
||||
Wnon-template-friend
|
||||
C++ ObjC++ Var(warn_nontemplate_friend) Init(1)
|
||||
Warn when non-templatized friend functions are declared within a template
|
||||
|
||||
Wnon-virtual-dtor
|
||||
C++ ObjC++ Var(warn_nonvdtor)
|
||||
Warn about non-virtual destructors
|
||||
|
||||
Wnonnull
|
||||
C ObjC Var(warn_nonnull)
|
||||
Warn about NULL being passed to argument slots marked as requiring non-NULL
|
||||
|
||||
Wnormalized=
|
||||
C ObjC C++ ObjC++ Joined
|
||||
-Wnormalized=<id|nfc|nfkc> Warn about non-normalised Unicode strings
|
||||
|
||||
Wold-style-cast
|
||||
C++ ObjC++ Var(warn_old_style_cast)
|
||||
Warn if a C-style cast is used in a program
|
||||
|
||||
Wold-style-definition
|
||||
C ObjC Var(warn_old_style_definition)
|
||||
Warn if an old-style parameter definition is used
|
||||
|
||||
Woverlength-strings
|
||||
C ObjC C++ ObjC++ Var(warn_overlength_strings) Init(-1)
|
||||
Warn if a string is longer than the maximum portable length specified by the standard
|
||||
|
||||
Woverloaded-virtual
|
||||
C++ ObjC++ Var(warn_overloaded_virtual)
|
||||
Warn about overloaded virtual function names
|
||||
|
||||
Woverride-init
|
||||
C ObjC Var(warn_override_init) Init(-1)
|
||||
Warn about overriding initializers without side effects
|
||||
|
||||
Wparentheses
|
||||
C ObjC C++ ObjC++ Var(warn_parentheses)
|
||||
Warn about possibly missing parentheses
|
||||
|
||||
Wpmf-conversions
|
||||
C++ ObjC++ Var(warn_pmf2ptr) Init(1)
|
||||
Warn when converting the type of pointers to member functions
|
||||
|
||||
Wpointer-arith
|
||||
C ObjC C++ ObjC++ Var(warn_pointer_arith)
|
||||
Warn about function pointer arithmetic
|
||||
|
||||
Wpointer-to-int-cast
|
||||
C ObjC Var(warn_pointer_to_int_cast) Init(1)
|
||||
Warn when a pointer is cast to an integer of a different size
|
||||
|
||||
Wpragmas
|
||||
C ObjC C++ ObjC++ Var(warn_pragmas) Init(1)
|
||||
Warn about misuses of pragmas
|
||||
|
||||
Wprotocol
|
||||
ObjC ObjC++ Var(warn_protocol) Init(1)
|
||||
Warn if inherited methods are unimplemented
|
||||
|
||||
Wredundant-decls
|
||||
C ObjC C++ ObjC++ Var(warn_redundant_decls)
|
||||
Warn about multiple declarations of the same object
|
||||
|
||||
Wreorder
|
||||
C++ ObjC++ Var(warn_reorder)
|
||||
Warn when the compiler reorders code
|
||||
|
||||
Wreturn-type
|
||||
C ObjC C++ ObjC++ Var(warn_return_type)
|
||||
Warn whenever a function's return type defaults to \"int\" (C), or about inconsistent return types (C++)
|
||||
|
||||
Wselector
|
||||
ObjC ObjC++ Var(warn_selector)
|
||||
Warn if a selector has multiple methods
|
||||
|
||||
Wsequence-point
|
||||
C ObjC C++ ObjC++ Var(warn_sequence_point)
|
||||
Warn about possible violations of sequence point rules
|
||||
|
||||
Wsign-compare
|
||||
C ObjC C++ ObjC++ Var(warn_sign_compare) Init(-1)
|
||||
Warn about signed-unsigned comparisons
|
||||
|
||||
Wsign-promo
|
||||
C++ ObjC++ Var(warn_sign_promo)
|
||||
Warn when overload promotes from unsigned to signed
|
||||
|
||||
Wstrict-null-sentinel
|
||||
C++ ObjC++
|
||||
Warn about uncasted NULL used as sentinel
|
||||
|
||||
Wstrict-prototypes
|
||||
C ObjC Var(warn_strict_prototypes)
|
||||
Warn about unprototyped function declarations
|
||||
|
||||
Wstrict-selector-match
|
||||
ObjC ObjC++ Var(warn_strict_selector_match)
|
||||
Warn if type signatures of candidate methods do not match exactly
|
||||
|
||||
Wsynth
|
||||
C++ ObjC++ Var(warn_synth)
|
||||
Warn when synthesis behavior differs from Cfront
|
||||
|
||||
Wsystem-headers
|
||||
C ObjC C++ ObjC++
|
||||
Do not suppress warnings from system headers
|
||||
|
||||
Wtraditional
|
||||
C ObjC Var(warn_traditional)
|
||||
Warn about features not present in traditional C
|
||||
|
||||
Wtrampolines
|
||||
Common Var(warn_trampolines)
|
||||
Warn when trampolines are emitted
|
||||
|
||||
Wtrigraphs
|
||||
C ObjC C++ ObjC++
|
||||
Warn if trigraphs are encountered that might affect the meaning of the program
|
||||
|
||||
Wundeclared-selector
|
||||
ObjC ObjC++ Var(warn_undeclared_selector)
|
||||
Warn about @selector()s without previously declared methods
|
||||
|
||||
Wundef
|
||||
C ObjC C++ ObjC++
|
||||
Warn if an undefined macro is used in an #if directive
|
||||
|
||||
Wunknown-pragmas
|
||||
C ObjC C++ ObjC++
|
||||
Warn about unrecognized pragmas
|
||||
|
||||
Wunused-macros
|
||||
C ObjC C++ ObjC++
|
||||
Warn about macros defined in the main file that are not used
|
||||
|
||||
Wvariadic-macros
|
||||
C ObjC C++ ObjC++
|
||||
Do not warn about using variadic macros when -pedantic
|
||||
|
||||
Wvla
|
||||
C ObjC C++ ObjC++ Var(warn_vla) Init(-1) Warning
|
||||
Warn if a variable length array is used
|
||||
|
||||
Wwrite-strings
|
||||
C ObjC C++ ObjC++ Var(warn_write_strings)
|
||||
In C++, nonzero means warn about deprecated conversion from string literals to `char *'. In C, similar warning, except that the conversion is of course not deprecated by the ISO C standard.
|
||||
|
||||
Wpointer-sign
|
||||
C ObjC Var(warn_pointer_sign) Init(-1)
|
||||
Warn when a pointer differs in signedness in an assignment
|
||||
|
||||
ansi
|
||||
C ObjC C++ ObjC++
|
||||
A synonym for -std=c89 (for C) or -std=c++98 (for C++)
|
||||
|
||||
d
|
||||
C ObjC C++ ObjC++ Joined
|
||||
; Documented in common.opt. FIXME - what about -dI, -dD, -dN and -dD?
|
||||
|
||||
faccess-control
|
||||
C++ ObjC++
|
||||
Enforce class member access control semantics
|
||||
|
||||
fall-virtual
|
||||
C++ ObjC++
|
||||
|
||||
falt-external-templates
|
||||
C++ ObjC++
|
||||
Change when template instances are emitted
|
||||
|
||||
fasm
|
||||
C ObjC C++ ObjC++
|
||||
Recognize the \"asm\" keyword
|
||||
|
||||
fbuiltin
|
||||
C ObjC C++ ObjC++
|
||||
Recognize built-in functions
|
||||
|
||||
fbuiltin-
|
||||
C ObjC C++ ObjC++ Joined
|
||||
|
||||
fcheck-new
|
||||
C++ ObjC++
|
||||
Check the return value of new
|
||||
|
||||
fcond-mismatch
|
||||
C ObjC C++ ObjC++
|
||||
Allow the arguments of the '?' operator to have different types
|
||||
|
||||
fconserve-space
|
||||
C++ ObjC++
|
||||
Reduce the size of object files
|
||||
|
||||
fconstant-string-class=
|
||||
ObjC ObjC++ Joined
|
||||
-fconst-string-class=<name> Use class <name> for constant strings
|
||||
|
||||
fdefault-inline
|
||||
C++ ObjC++
|
||||
Inline member functions by default
|
||||
|
||||
fdirectives-only
|
||||
C ObjC C++ ObjC++
|
||||
Preprocess directives only.
|
||||
|
||||
fdollars-in-identifiers
|
||||
C ObjC C++ ObjC++
|
||||
Permit '$' as an identifier character
|
||||
|
||||
felide-constructors
|
||||
C++ ObjC++
|
||||
|
||||
fenforce-eh-specs
|
||||
C++ ObjC++
|
||||
Generate code to check exception specifications
|
||||
|
||||
fenum-int-equiv
|
||||
C++ ObjC++
|
||||
|
||||
fexec-charset=
|
||||
C ObjC C++ ObjC++ Joined RejectNegative
|
||||
-fexec-charset=<cset> Convert all strings and character constants to character set <cset>
|
||||
|
||||
fextended-identifiers
|
||||
C ObjC C++ ObjC++
|
||||
Permit universal character names (\\u and \\U) in identifiers
|
||||
|
||||
finput-charset=
|
||||
C ObjC C++ ObjC++ Joined RejectNegative
|
||||
-finput-charset=<cset> Specify the default character set for source files
|
||||
|
||||
|
||||
fexternal-templates
|
||||
C++ ObjC++
|
||||
|
||||
ffor-scope
|
||||
C++ ObjC++
|
||||
Scope of for-init-statement variables is local to the loop
|
||||
|
||||
ffreestanding
|
||||
C ObjC
|
||||
Do not assume that standard C libraries and \"main\" exist
|
||||
|
||||
fgnu-keywords
|
||||
C++ ObjC++
|
||||
Recognize GNU-defined keywords
|
||||
|
||||
fgnu-runtime
|
||||
ObjC ObjC++
|
||||
Generate code for GNU runtime environment
|
||||
|
||||
fgnu89-inline
|
||||
C ObjC Var(flag_gnu89_inline) Init(-1)
|
||||
Use traditional GNU semantics for inline functions
|
||||
|
||||
fguiding-decls
|
||||
C++ ObjC++
|
||||
|
||||
fhandle-exceptions
|
||||
C++ ObjC++
|
||||
|
||||
fhonor-std
|
||||
C++ ObjC++
|
||||
|
||||
fhosted
|
||||
C ObjC
|
||||
Assume normal C execution environment
|
||||
|
||||
fhuge-objects
|
||||
C++ ObjC++
|
||||
Enable support for huge objects
|
||||
|
||||
fimplement-inlines
|
||||
C++ ObjC++
|
||||
Export functions even if they can be inlined
|
||||
|
||||
fimplicit-inline-templates
|
||||
C++ ObjC++
|
||||
Emit implicit instantiations of inline templates
|
||||
|
||||
fimplicit-templates
|
||||
C++ ObjC++
|
||||
Emit implicit instantiations of templates
|
||||
|
||||
ffriend-injection
|
||||
C++ ObjC++ Var(flag_friend_injection)
|
||||
Inject friend functions into enclosing namespace
|
||||
|
||||
flabels-ok
|
||||
C++ ObjC++
|
||||
|
||||
flax-vector-conversions
|
||||
C ObjC C++ ObjC++
|
||||
Allow implicit conversions between vectors with differing numbers of subparts and/or differing element types.
|
||||
|
||||
fms-extensions
|
||||
C ObjC C++ ObjC++
|
||||
Don't warn about uses of Microsoft extensions
|
||||
|
||||
fname-mangling-version-
|
||||
C++ ObjC++ Joined
|
||||
|
||||
fnew-abi
|
||||
C++ ObjC++
|
||||
|
||||
; APPLE LOCAL begin nested functions 4258406 4357979
|
||||
fnested-functions
|
||||
C ObjC Var(flag_nested_functions)
|
||||
Allow nested functions.
|
||||
; APPLE LOCAL end nested functions 4258406 4357979
|
||||
|
||||
fnext-runtime
|
||||
ObjC ObjC++
|
||||
Generate code for NeXT (Apple Mac OS X) runtime environment
|
||||
|
||||
fnil-receivers
|
||||
ObjC ObjC++
|
||||
Assume that receivers of Objective-C messages may be nil
|
||||
|
||||
fnonansi-builtins
|
||||
C++ ObjC++
|
||||
|
||||
fnonnull-objects
|
||||
C++ ObjC++
|
||||
|
||||
; Generate special '- .cxx_construct' and '- .cxx_destruct' methods
|
||||
; to initialize any non-POD ivars in Objective-C++ classes.
|
||||
fobjc-call-cxx-cdtors
|
||||
ObjC++ Var(flag_objc_call_cxx_cdtors)
|
||||
Generate special Objective-C methods to initialize/destroy non-POD C++ ivars, if needed
|
||||
|
||||
fobjc-direct-dispatch
|
||||
ObjC ObjC++ Var(flag_objc_direct_dispatch)
|
||||
Allow fast jumps to the message dispatcher
|
||||
|
||||
; Nonzero means that we will allow new ObjC exception syntax (@throw,
|
||||
; @try, etc.) in source code.
|
||||
fobjc-exceptions
|
||||
ObjC ObjC++ Var(flag_objc_exceptions)
|
||||
Enable Objective-C exception and synchronization syntax
|
||||
|
||||
fobjc-gc
|
||||
ObjC ObjC++ Var(flag_objc_gc)
|
||||
Enable garbage collection (GC) in Objective-C/Objective-C++ programs
|
||||
|
||||
; APPLE LOCAL begin radar 5811887 - blocks
|
||||
fblocks
|
||||
C ObjC C++ ObjC++ Var(flag_blocks) Init(-1)
|
||||
Program supports c/objc extension blocks
|
||||
; APPLE LOCAL end radar 5811887 - blocks
|
||||
|
||||
; Nonzero means that we generate NeXT setjmp based exceptions.
|
||||
fobjc-sjlj-exceptions
|
||||
ObjC ObjC++ Var(flag_objc_sjlj_exceptions) Init(-1)
|
||||
Enable Objective-C setjmp exception handling runtime
|
||||
|
||||
fopenmp
|
||||
C ObjC C++ ObjC++ Var(flag_openmp)
|
||||
Enable OpenMP
|
||||
|
||||
foperator-names
|
||||
C++ ObjC++
|
||||
Recognize C++ kewords like \"compl\" and \"xor\"
|
||||
|
||||
foptional-diags
|
||||
C++ ObjC++
|
||||
Enable optional diagnostics
|
||||
|
||||
fpch-deps
|
||||
C ObjC C++ ObjC++
|
||||
|
||||
fpch-preprocess
|
||||
C ObjC C++ ObjC++
|
||||
Look for and use PCH files even when preprocessing
|
||||
|
||||
fpermissive
|
||||
C++ ObjC++
|
||||
Downgrade conformance errors to warnings
|
||||
|
||||
fpreprocessed
|
||||
C ObjC C++ ObjC++
|
||||
Treat the input file as already preprocessed
|
||||
|
||||
freplace-objc-classes
|
||||
ObjC ObjC++
|
||||
Used in Fix-and-Continue mode to indicate that object files may be swapped in at runtime
|
||||
|
||||
frepo
|
||||
C++ ObjC++
|
||||
Enable automatic template instantiation
|
||||
|
||||
frtti
|
||||
C++ ObjC++
|
||||
Generate run time type descriptor information
|
||||
|
||||
fshort-double
|
||||
C ObjC C++ ObjC++
|
||||
Use the same size for double as for float
|
||||
|
||||
fshort-enums
|
||||
C ObjC C++ ObjC++
|
||||
Use the narrowest integer type possible for enumeration types
|
||||
|
||||
fshort-wchar
|
||||
C ObjC C++ ObjC++
|
||||
Force the underlying type for \"wchar_t\" to be \"unsigned short\"
|
||||
|
||||
fsigned-bitfields
|
||||
C ObjC C++ ObjC++
|
||||
When \"signed\" or \"unsigned\" is not given make the bitfield signed
|
||||
|
||||
fsigned-char
|
||||
C ObjC C++ ObjC++
|
||||
Make \"char\" signed by default
|
||||
|
||||
fsquangle
|
||||
C++ ObjC++
|
||||
|
||||
fstats
|
||||
C++ ObjC++
|
||||
Display statistics accumulated during compilation
|
||||
|
||||
fstrict-prototype
|
||||
C++ ObjC++
|
||||
|
||||
ftabstop=
|
||||
C ObjC C++ ObjC++ Joined RejectNegative UInteger
|
||||
-ftabstop=<number> Distance between tab stops for column reporting
|
||||
|
||||
ftemplate-depth-
|
||||
C++ ObjC++ Joined RejectNegative UInteger
|
||||
-ftemplate-depth-<number> Specify maximum template instantiation depth
|
||||
|
||||
fthis-is-variable
|
||||
C++ ObjC++
|
||||
|
||||
fthreadsafe-statics
|
||||
C++ ObjC++
|
||||
-fno-threadsafe-statics Do not generate thread-safe code for initializing local statics
|
||||
|
||||
funsigned-bitfields
|
||||
C ObjC C++ ObjC++
|
||||
When \"signed\" or \"unsigned\" is not given make the bitfield unsigned
|
||||
|
||||
funsigned-char
|
||||
C ObjC C++ ObjC++
|
||||
Make \"char\" unsigned by default
|
||||
|
||||
fuse-cxa-atexit
|
||||
C++ ObjC++
|
||||
Use __cxa_atexit to register destructors
|
||||
|
||||
fuse-cxa-get-exception-ptr
|
||||
C++ ObjC++
|
||||
Use __cxa_get_exception_ptr in exception handling
|
||||
|
||||
fvisibility-inlines-hidden
|
||||
C++ ObjC++
|
||||
Marks all inlined methods as having hidden visibility
|
||||
|
||||
fvisibility-ms-compat
|
||||
C++ ObjC++ Var(flag_visibility_ms_compat)
|
||||
Changes visibility to match Microsoft Visual Studio by default
|
||||
|
||||
fvtable-gc
|
||||
C++ ObjC++
|
||||
Discard unused virtual functions
|
||||
|
||||
fvtable-thunks
|
||||
C++ ObjC++
|
||||
Implement vtables using thunks
|
||||
|
||||
fweak
|
||||
C++ ObjC++
|
||||
Emit common-like symbols as weak symbols
|
||||
|
||||
fwide-exec-charset=
|
||||
C ObjC C++ ObjC++ Joined RejectNegative
|
||||
-fwide-exec-charset=<cset> Convert all wide strings and character constants to character set <cset>
|
||||
|
||||
fworking-directory
|
||||
C ObjC C++ ObjC++
|
||||
Generate a #line directive pointing at the current working directory
|
||||
|
||||
fxref
|
||||
C++ ObjC++
|
||||
Emit cross referencing information
|
||||
|
||||
fzero-link
|
||||
ObjC ObjC++
|
||||
Generate lazy class lookup (via objc_getClass()) for use in Zero-Link mode
|
||||
|
||||
gen-decls
|
||||
ObjC ObjC++
|
||||
Dump declarations to a .decl file
|
||||
|
||||
femit-struct-debug-baseonly
|
||||
C ObjC C++ ObjC++
|
||||
-femit-struct-debug-baseonly Aggressive reduced debug info for structs
|
||||
|
||||
femit-struct-debug-reduced
|
||||
C ObjC C++ ObjC++
|
||||
-femit-struct-debug-reduced Conservative reduced debug info for structs
|
||||
|
||||
femit-struct-debug-detailed=
|
||||
C ObjC C++ ObjC++ Joined
|
||||
-femit-struct-debug-detailed=<spec-list> Detailed reduced debug info for structs
|
||||
|
||||
idirafter
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-idirafter <dir> Add <dir> to the end of the system include path
|
||||
|
||||
imacros
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-imacros <file> Accept definition of macros in <file>
|
||||
|
||||
imultilib
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-imultilib <dir> Set <dir> to be the multilib include subdirectory
|
||||
|
||||
include
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-include <file> Include the contents of <file> before other files
|
||||
|
||||
iprefix
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-iprefix <path> Specify <path> as a prefix for next two options
|
||||
|
||||
isysroot
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-isysroot <dir> Set <dir> to be the system root directory
|
||||
|
||||
isystem
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-isystem <dir> Add <dir> to the start of the system include path
|
||||
|
||||
iquote
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-iquote <dir> Add <dir> to the end of the quote include path
|
||||
|
||||
iwithprefix
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-iwithprefix <dir> Add <dir> to the end of the system include path
|
||||
|
||||
iwithprefixbefore
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
-iwithprefixbefore <dir> Add <dir> to the end of the main include path
|
||||
|
||||
lang-asm
|
||||
C Undocumented
|
||||
|
||||
lang-fortran
|
||||
C Undocumented
|
||||
|
||||
lang-objc
|
||||
C ObjC C++ ObjC++ Undocumented
|
||||
|
||||
nostdinc
|
||||
C ObjC C++ ObjC++
|
||||
Do not search standard system include directories (those specified with -isystem will still be used)
|
||||
|
||||
nostdinc++
|
||||
C++ ObjC++
|
||||
Do not search standard system include directories for C++
|
||||
|
||||
o
|
||||
C ObjC C++ ObjC++ Joined Separate
|
||||
; Documented in common.opt
|
||||
|
||||
pedantic
|
||||
C ObjC C++ ObjC++
|
||||
; Documented in common.opt
|
||||
|
||||
pedantic-errors
|
||||
C ObjC C++ ObjC++
|
||||
; Documented in common.opt
|
||||
|
||||
print-objc-runtime-info
|
||||
ObjC ObjC++
|
||||
Generate C header of platform-specific features
|
||||
|
||||
print-pch-checksum
|
||||
C ObjC C++ ObjC++
|
||||
Print a checksum of the executable for PCH validity checking, and stop
|
||||
|
||||
remap
|
||||
C ObjC C++ ObjC++
|
||||
Remap file names when including files
|
||||
|
||||
std=c++98
|
||||
C++ ObjC++
|
||||
Conform to the ISO 1998 C++ standard
|
||||
|
||||
std=c89
|
||||
C ObjC
|
||||
Conform to the ISO 1990 C standard
|
||||
|
||||
std=c99
|
||||
C ObjC
|
||||
Conform to the ISO 1999 C standard
|
||||
|
||||
std=c9x
|
||||
C ObjC
|
||||
Deprecated in favor of -std=c99
|
||||
|
||||
std=gnu++98
|
||||
C++ ObjC++
|
||||
Conform to the ISO 1998 C++ standard with GNU extensions
|
||||
|
||||
std=gnu89
|
||||
C ObjC
|
||||
Conform to the ISO 1990 C standard with GNU extensions
|
||||
|
||||
std=gnu99
|
||||
C ObjC
|
||||
Conform to the ISO 1999 C standard with GNU extensions
|
||||
|
||||
std=gnu9x
|
||||
C ObjC
|
||||
Deprecated in favor of -std=gnu99
|
||||
|
||||
std=iso9899:1990
|
||||
C ObjC
|
||||
Conform to the ISO 1990 C standard
|
||||
|
||||
std=iso9899:199409
|
||||
C ObjC
|
||||
Conform to the ISO 1990 C standard as amended in 1994
|
||||
|
||||
std=iso9899:1999
|
||||
C ObjC
|
||||
Conform to the ISO 1999 C standard
|
||||
|
||||
std=iso9899:199x
|
||||
C ObjC
|
||||
Deprecated in favor of -std=iso9899:1999
|
||||
|
||||
traditional-cpp
|
||||
C ObjC C++ ObjC++
|
||||
Enable traditional preprocessing
|
||||
|
||||
trigraphs
|
||||
C ObjC C++ ObjC++
|
||||
-trigraphs Support ISO C trigraphs
|
||||
|
||||
undef
|
||||
C ObjC C++ ObjC++
|
||||
Do not predefine system-specific and GCC-specific macros
|
||||
|
||||
v
|
||||
C ObjC C++ ObjC++
|
||||
Enable verbose output
|
||||
|
||||
w
|
||||
C ObjC C++ ObjC++
|
||||
; Documented in common.opt
|
||||
|
||||
; This comment is to ensure we retain the blank line above.
|
@ -1,863 +0,0 @@
|
||||
/* Save and restore call-clobbered registers which are live across a call.
|
||||
Copyright (C) 1989, 1992, 1994, 1995, 1997, 1998,
|
||||
1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "rtl.h"
|
||||
#include "regs.h"
|
||||
#include "insn-config.h"
|
||||
#include "flags.h"
|
||||
#include "hard-reg-set.h"
|
||||
#include "recog.h"
|
||||
#include "basic-block.h"
|
||||
#include "reload.h"
|
||||
#include "function.h"
|
||||
#include "expr.h"
|
||||
#include "toplev.h"
|
||||
#include "tm_p.h"
|
||||
#include "addresses.h"
|
||||
|
||||
#ifndef MAX_MOVE_MAX
|
||||
#define MAX_MOVE_MAX MOVE_MAX
|
||||
#endif
|
||||
|
||||
#ifndef MIN_UNITS_PER_WORD
|
||||
#define MIN_UNITS_PER_WORD UNITS_PER_WORD
|
||||
#endif
|
||||
|
||||
#define MOVE_MAX_WORDS (MOVE_MAX / UNITS_PER_WORD)
|
||||
|
||||
/* Modes for each hard register that we can save. The smallest mode is wide
|
||||
enough to save the entire contents of the register. When saving the
|
||||
register because it is live we first try to save in multi-register modes.
|
||||
If that is not possible the save is done one register at a time. */
|
||||
|
||||
static enum machine_mode
|
||||
regno_save_mode[FIRST_PSEUDO_REGISTER][MAX_MOVE_MAX / MIN_UNITS_PER_WORD + 1];
|
||||
|
||||
/* For each hard register, a place on the stack where it can be saved,
|
||||
if needed. */
|
||||
|
||||
static rtx
|
||||
regno_save_mem[FIRST_PSEUDO_REGISTER][MAX_MOVE_MAX / MIN_UNITS_PER_WORD + 1];
|
||||
|
||||
/* We will only make a register eligible for caller-save if it can be
|
||||
saved in its widest mode with a simple SET insn as long as the memory
|
||||
address is valid. We record the INSN_CODE is those insns here since
|
||||
when we emit them, the addresses might not be valid, so they might not
|
||||
be recognized. */
|
||||
|
||||
static int
|
||||
reg_save_code[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
|
||||
static int
|
||||
reg_restore_code[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
|
||||
|
||||
/* Set of hard regs currently residing in save area (during insn scan). */
|
||||
|
||||
static HARD_REG_SET hard_regs_saved;
|
||||
|
||||
/* Number of registers currently in hard_regs_saved. */
|
||||
|
||||
static int n_regs_saved;
|
||||
|
||||
/* Computed by mark_referenced_regs, all regs referenced in a given
|
||||
insn. */
|
||||
static HARD_REG_SET referenced_regs;
|
||||
|
||||
|
||||
static void mark_set_regs (rtx, rtx, void *);
|
||||
static void mark_referenced_regs (rtx);
|
||||
static int insert_save (struct insn_chain *, int, int, HARD_REG_SET *,
|
||||
enum machine_mode *);
|
||||
static int insert_restore (struct insn_chain *, int, int, int,
|
||||
enum machine_mode *);
|
||||
static struct insn_chain *insert_one_insn (struct insn_chain *, int, int,
|
||||
rtx);
|
||||
static void add_stored_regs (rtx, rtx, void *);
|
||||
|
||||
/* Initialize for caller-save.
|
||||
|
||||
Look at all the hard registers that are used by a call and for which
|
||||
regclass.c has not already excluded from being used across a call.
|
||||
|
||||
Ensure that we can find a mode to save the register and that there is a
|
||||
simple insn to save and restore the register. This latter check avoids
|
||||
problems that would occur if we tried to save the MQ register of some
|
||||
machines directly into memory. */
|
||||
|
||||
void
|
||||
init_caller_save (void)
|
||||
{
|
||||
rtx addr_reg;
|
||||
int offset;
|
||||
rtx address;
|
||||
int i, j;
|
||||
enum machine_mode mode;
|
||||
rtx savepat, restpat;
|
||||
rtx test_reg, test_mem;
|
||||
rtx saveinsn, restinsn;
|
||||
|
||||
/* First find all the registers that we need to deal with and all
|
||||
the modes that they can have. If we can't find a mode to use,
|
||||
we can't have the register live over calls. */
|
||||
|
||||
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
||||
{
|
||||
if (call_used_regs[i] && ! call_fixed_regs[i])
|
||||
{
|
||||
for (j = 1; j <= MOVE_MAX_WORDS; j++)
|
||||
{
|
||||
regno_save_mode[i][j] = HARD_REGNO_CALLER_SAVE_MODE (i, j,
|
||||
VOIDmode);
|
||||
if (regno_save_mode[i][j] == VOIDmode && j == 1)
|
||||
{
|
||||
call_fixed_regs[i] = 1;
|
||||
SET_HARD_REG_BIT (call_fixed_reg_set, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
regno_save_mode[i][1] = VOIDmode;
|
||||
}
|
||||
|
||||
/* The following code tries to approximate the conditions under which
|
||||
we can easily save and restore a register without scratch registers or
|
||||
other complexities. It will usually work, except under conditions where
|
||||
the validity of an insn operand is dependent on the address offset.
|
||||
No such cases are currently known.
|
||||
|
||||
We first find a typical offset from some BASE_REG_CLASS register.
|
||||
This address is chosen by finding the first register in the class
|
||||
and by finding the smallest power of two that is a valid offset from
|
||||
that register in every mode we will use to save registers. */
|
||||
|
||||
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
||||
if (TEST_HARD_REG_BIT
|
||||
(reg_class_contents
|
||||
[(int) base_reg_class (regno_save_mode [i][1], PLUS, CONST_INT)], i))
|
||||
break;
|
||||
|
||||
gcc_assert (i < FIRST_PSEUDO_REGISTER);
|
||||
|
||||
addr_reg = gen_rtx_REG (Pmode, i);
|
||||
|
||||
for (offset = 1 << (HOST_BITS_PER_INT / 2); offset; offset >>= 1)
|
||||
{
|
||||
address = gen_rtx_PLUS (Pmode, addr_reg, GEN_INT (offset));
|
||||
|
||||
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
||||
if (regno_save_mode[i][1] != VOIDmode
|
||||
&& ! strict_memory_address_p (regno_save_mode[i][1], address))
|
||||
break;
|
||||
|
||||
if (i == FIRST_PSEUDO_REGISTER)
|
||||
break;
|
||||
}
|
||||
|
||||
/* If we didn't find a valid address, we must use register indirect. */
|
||||
if (offset == 0)
|
||||
address = addr_reg;
|
||||
|
||||
/* Next we try to form an insn to save and restore the register. We
|
||||
see if such an insn is recognized and meets its constraints.
|
||||
|
||||
To avoid lots of unnecessary RTL allocation, we construct all the RTL
|
||||
once, then modify the memory and register operands in-place. */
|
||||
|
||||
test_reg = gen_rtx_REG (VOIDmode, 0);
|
||||
test_mem = gen_rtx_MEM (VOIDmode, address);
|
||||
savepat = gen_rtx_SET (VOIDmode, test_mem, test_reg);
|
||||
restpat = gen_rtx_SET (VOIDmode, test_reg, test_mem);
|
||||
|
||||
saveinsn = gen_rtx_INSN (VOIDmode, 0, 0, 0, 0, 0, savepat, -1, 0, 0);
|
||||
restinsn = gen_rtx_INSN (VOIDmode, 0, 0, 0, 0, 0, restpat, -1, 0, 0);
|
||||
|
||||
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
||||
for (mode = 0 ; mode < MAX_MACHINE_MODE; mode++)
|
||||
if (HARD_REGNO_MODE_OK (i, mode))
|
||||
{
|
||||
int ok;
|
||||
|
||||
/* Update the register number and modes of the register
|
||||
and memory operand. */
|
||||
REGNO (test_reg) = i;
|
||||
PUT_MODE (test_reg, mode);
|
||||
PUT_MODE (test_mem, mode);
|
||||
|
||||
/* Force re-recognition of the modified insns. */
|
||||
INSN_CODE (saveinsn) = -1;
|
||||
INSN_CODE (restinsn) = -1;
|
||||
|
||||
reg_save_code[i][mode] = recog_memoized (saveinsn);
|
||||
reg_restore_code[i][mode] = recog_memoized (restinsn);
|
||||
|
||||
/* Now extract both insns and see if we can meet their
|
||||
constraints. */
|
||||
ok = (reg_save_code[i][mode] != -1
|
||||
&& reg_restore_code[i][mode] != -1);
|
||||
if (ok)
|
||||
{
|
||||
extract_insn (saveinsn);
|
||||
ok = constrain_operands (1);
|
||||
extract_insn (restinsn);
|
||||
ok &= constrain_operands (1);
|
||||
}
|
||||
|
||||
if (! ok)
|
||||
{
|
||||
reg_save_code[i][mode] = -1;
|
||||
reg_restore_code[i][mode] = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
reg_save_code[i][mode] = -1;
|
||||
reg_restore_code[i][mode] = -1;
|
||||
}
|
||||
|
||||
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
||||
for (j = 1; j <= MOVE_MAX_WORDS; j++)
|
||||
if (reg_save_code [i][regno_save_mode[i][j]] == -1)
|
||||
{
|
||||
regno_save_mode[i][j] = VOIDmode;
|
||||
if (j == 1)
|
||||
{
|
||||
call_fixed_regs[i] = 1;
|
||||
SET_HARD_REG_BIT (call_fixed_reg_set, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Initialize save areas by showing that we haven't allocated any yet. */
|
||||
|
||||
void
|
||||
init_save_areas (void)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
||||
for (j = 1; j <= MOVE_MAX_WORDS; j++)
|
||||
regno_save_mem[i][j] = 0;
|
||||
}
|
||||
|
||||
/* Allocate save areas for any hard registers that might need saving.
|
||||
We take a conservative approach here and look for call-clobbered hard
|
||||
registers that are assigned to pseudos that cross calls. This may
|
||||
overestimate slightly (especially if some of these registers are later
|
||||
used as spill registers), but it should not be significant.
|
||||
|
||||
Future work:
|
||||
|
||||
In the fallback case we should iterate backwards across all possible
|
||||
modes for the save, choosing the largest available one instead of
|
||||
falling back to the smallest mode immediately. (eg TF -> DF -> SF).
|
||||
|
||||
We do not try to use "move multiple" instructions that exist
|
||||
on some machines (such as the 68k moveml). It could be a win to try
|
||||
and use them when possible. The hard part is doing it in a way that is
|
||||
machine independent since they might be saving non-consecutive
|
||||
registers. (imagine caller-saving d0,d1,a0,a1 on the 68k) */
|
||||
|
||||
void
|
||||
setup_save_areas (void)
|
||||
{
|
||||
int i, j, k;
|
||||
unsigned int r;
|
||||
HARD_REG_SET hard_regs_used;
|
||||
|
||||
/* Allocate space in the save area for the largest multi-register
|
||||
pseudos first, then work backwards to single register
|
||||
pseudos. */
|
||||
|
||||
/* Find and record all call-used hard-registers in this function. */
|
||||
CLEAR_HARD_REG_SET (hard_regs_used);
|
||||
for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
|
||||
if (reg_renumber[i] >= 0 && REG_N_CALLS_CROSSED (i) > 0)
|
||||
{
|
||||
unsigned int regno = reg_renumber[i];
|
||||
unsigned int endregno
|
||||
= regno + hard_regno_nregs[regno][GET_MODE (regno_reg_rtx[i])];
|
||||
|
||||
for (r = regno; r < endregno; r++)
|
||||
if (call_used_regs[r])
|
||||
SET_HARD_REG_BIT (hard_regs_used, r);
|
||||
}
|
||||
|
||||
/* Now run through all the call-used hard-registers and allocate
|
||||
space for them in the caller-save area. Try to allocate space
|
||||
in a manner which allows multi-register saves/restores to be done. */
|
||||
|
||||
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
||||
for (j = MOVE_MAX_WORDS; j > 0; j--)
|
||||
{
|
||||
int do_save = 1;
|
||||
|
||||
/* If no mode exists for this size, try another. Also break out
|
||||
if we have already saved this hard register. */
|
||||
if (regno_save_mode[i][j] == VOIDmode || regno_save_mem[i][1] != 0)
|
||||
continue;
|
||||
|
||||
/* See if any register in this group has been saved. */
|
||||
for (k = 0; k < j; k++)
|
||||
if (regno_save_mem[i + k][1])
|
||||
{
|
||||
do_save = 0;
|
||||
break;
|
||||
}
|
||||
if (! do_save)
|
||||
continue;
|
||||
|
||||
for (k = 0; k < j; k++)
|
||||
if (! TEST_HARD_REG_BIT (hard_regs_used, i + k))
|
||||
{
|
||||
do_save = 0;
|
||||
break;
|
||||
}
|
||||
if (! do_save)
|
||||
continue;
|
||||
|
||||
/* We have found an acceptable mode to store in. */
|
||||
regno_save_mem[i][j]
|
||||
= assign_stack_local (regno_save_mode[i][j],
|
||||
GET_MODE_SIZE (regno_save_mode[i][j]), 0);
|
||||
|
||||
/* Setup single word save area just in case... */
|
||||
for (k = 0; k < j; k++)
|
||||
/* This should not depend on WORDS_BIG_ENDIAN.
|
||||
The order of words in regs is the same as in memory. */
|
||||
regno_save_mem[i + k][1]
|
||||
= adjust_address_nv (regno_save_mem[i][j],
|
||||
regno_save_mode[i + k][1],
|
||||
k * UNITS_PER_WORD);
|
||||
}
|
||||
|
||||
/* Now loop again and set the alias set of any save areas we made to
|
||||
the alias set used to represent frame objects. */
|
||||
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
||||
for (j = MOVE_MAX_WORDS; j > 0; j--)
|
||||
if (regno_save_mem[i][j] != 0)
|
||||
set_mem_alias_set (regno_save_mem[i][j], get_frame_alias_set ());
|
||||
}
|
||||
|
||||
/* Find the places where hard regs are live across calls and save them. */
|
||||
|
||||
void
|
||||
save_call_clobbered_regs (void)
|
||||
{
|
||||
struct insn_chain *chain, *next;
|
||||
enum machine_mode save_mode [FIRST_PSEUDO_REGISTER];
|
||||
|
||||
/* Computed in mark_set_regs, holds all registers set by the current
|
||||
instruction. */
|
||||
HARD_REG_SET this_insn_sets;
|
||||
|
||||
CLEAR_HARD_REG_SET (hard_regs_saved);
|
||||
n_regs_saved = 0;
|
||||
|
||||
for (chain = reload_insn_chain; chain != 0; chain = next)
|
||||
{
|
||||
rtx insn = chain->insn;
|
||||
enum rtx_code code = GET_CODE (insn);
|
||||
|
||||
next = chain->next;
|
||||
|
||||
gcc_assert (!chain->is_caller_save_insn);
|
||||
|
||||
if (INSN_P (insn))
|
||||
{
|
||||
/* If some registers have been saved, see if INSN references
|
||||
any of them. We must restore them before the insn if so. */
|
||||
|
||||
if (n_regs_saved)
|
||||
{
|
||||
int regno;
|
||||
|
||||
if (code == JUMP_INSN)
|
||||
/* Restore all registers if this is a JUMP_INSN. */
|
||||
COPY_HARD_REG_SET (referenced_regs, hard_regs_saved);
|
||||
else
|
||||
{
|
||||
CLEAR_HARD_REG_SET (referenced_regs);
|
||||
mark_referenced_regs (PATTERN (insn));
|
||||
AND_HARD_REG_SET (referenced_regs, hard_regs_saved);
|
||||
}
|
||||
|
||||
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
|
||||
if (TEST_HARD_REG_BIT (referenced_regs, regno))
|
||||
regno += insert_restore (chain, 1, regno, MOVE_MAX_WORDS, save_mode);
|
||||
}
|
||||
|
||||
if (code == CALL_INSN && ! find_reg_note (insn, REG_NORETURN, NULL))
|
||||
{
|
||||
unsigned regno;
|
||||
HARD_REG_SET hard_regs_to_save;
|
||||
reg_set_iterator rsi;
|
||||
|
||||
/* Use the register life information in CHAIN to compute which
|
||||
regs are live during the call. */
|
||||
REG_SET_TO_HARD_REG_SET (hard_regs_to_save,
|
||||
&chain->live_throughout);
|
||||
/* Save hard registers always in the widest mode available. */
|
||||
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
|
||||
if (TEST_HARD_REG_BIT (hard_regs_to_save, regno))
|
||||
save_mode [regno] = regno_save_mode [regno][1];
|
||||
else
|
||||
save_mode [regno] = VOIDmode;
|
||||
|
||||
/* Look through all live pseudos, mark their hard registers
|
||||
and choose proper mode for saving. */
|
||||
EXECUTE_IF_SET_IN_REG_SET
|
||||
(&chain->live_throughout, FIRST_PSEUDO_REGISTER, regno, rsi)
|
||||
{
|
||||
int r = reg_renumber[regno];
|
||||
int nregs;
|
||||
enum machine_mode mode;
|
||||
|
||||
gcc_assert (r >= 0);
|
||||
nregs = hard_regno_nregs[r][PSEUDO_REGNO_MODE (regno)];
|
||||
mode = HARD_REGNO_CALLER_SAVE_MODE
|
||||
(r, nregs, PSEUDO_REGNO_MODE (regno));
|
||||
if (GET_MODE_BITSIZE (mode)
|
||||
> GET_MODE_BITSIZE (save_mode[r]))
|
||||
save_mode[r] = mode;
|
||||
while (nregs-- > 0)
|
||||
SET_HARD_REG_BIT (hard_regs_to_save, r + nregs);
|
||||
}
|
||||
|
||||
/* Record all registers set in this call insn. These don't need
|
||||
to be saved. N.B. the call insn might set a subreg of a
|
||||
multi-hard-reg pseudo; then the pseudo is considered live
|
||||
during the call, but the subreg that is set isn't. */
|
||||
CLEAR_HARD_REG_SET (this_insn_sets);
|
||||
note_stores (PATTERN (insn), mark_set_regs, &this_insn_sets);
|
||||
/* Sibcalls are considered to set the return value,
|
||||
compare flow.c:propagate_one_insn. */
|
||||
if (SIBLING_CALL_P (insn) && current_function_return_rtx)
|
||||
mark_set_regs (current_function_return_rtx, NULL_RTX,
|
||||
&this_insn_sets);
|
||||
|
||||
/* Compute which hard regs must be saved before this call. */
|
||||
AND_COMPL_HARD_REG_SET (hard_regs_to_save, call_fixed_reg_set);
|
||||
AND_COMPL_HARD_REG_SET (hard_regs_to_save, this_insn_sets);
|
||||
AND_COMPL_HARD_REG_SET (hard_regs_to_save, hard_regs_saved);
|
||||
AND_HARD_REG_SET (hard_regs_to_save, call_used_reg_set);
|
||||
|
||||
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
|
||||
if (TEST_HARD_REG_BIT (hard_regs_to_save, regno))
|
||||
regno += insert_save (chain, 1, regno, &hard_regs_to_save, save_mode);
|
||||
|
||||
/* Must recompute n_regs_saved. */
|
||||
n_regs_saved = 0;
|
||||
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
|
||||
if (TEST_HARD_REG_BIT (hard_regs_saved, regno))
|
||||
n_regs_saved++;
|
||||
}
|
||||
}
|
||||
|
||||
if (chain->next == 0 || chain->next->block > chain->block)
|
||||
{
|
||||
int regno;
|
||||
/* At the end of the basic block, we must restore any registers that
|
||||
remain saved. If the last insn in the block is a JUMP_INSN, put
|
||||
the restore before the insn, otherwise, put it after the insn. */
|
||||
|
||||
if (n_regs_saved)
|
||||
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
|
||||
if (TEST_HARD_REG_BIT (hard_regs_saved, regno))
|
||||
regno += insert_restore (chain, JUMP_P (insn),
|
||||
regno, MOVE_MAX_WORDS, save_mode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Here from note_stores, or directly from save_call_clobbered_regs, when
|
||||
an insn stores a value in a register.
|
||||
Set the proper bit or bits in this_insn_sets. All pseudos that have
|
||||
been assigned hard regs have had their register number changed already,
|
||||
so we can ignore pseudos. */
|
||||
static void
|
||||
mark_set_regs (rtx reg, rtx setter ATTRIBUTE_UNUSED, void *data)
|
||||
{
|
||||
int regno, endregno, i;
|
||||
enum machine_mode mode = GET_MODE (reg);
|
||||
HARD_REG_SET *this_insn_sets = data;
|
||||
|
||||
if (GET_CODE (reg) == SUBREG)
|
||||
{
|
||||
rtx inner = SUBREG_REG (reg);
|
||||
if (!REG_P (inner) || REGNO (inner) >= FIRST_PSEUDO_REGISTER)
|
||||
return;
|
||||
regno = subreg_regno (reg);
|
||||
}
|
||||
else if (REG_P (reg)
|
||||
&& REGNO (reg) < FIRST_PSEUDO_REGISTER)
|
||||
regno = REGNO (reg);
|
||||
else
|
||||
return;
|
||||
|
||||
endregno = regno + hard_regno_nregs[regno][mode];
|
||||
|
||||
for (i = regno; i < endregno; i++)
|
||||
SET_HARD_REG_BIT (*this_insn_sets, i);
|
||||
}
|
||||
|
||||
/* Here from note_stores when an insn stores a value in a register.
|
||||
Set the proper bit or bits in the passed regset. All pseudos that have
|
||||
been assigned hard regs have had their register number changed already,
|
||||
so we can ignore pseudos. */
|
||||
static void
|
||||
add_stored_regs (rtx reg, rtx setter, void *data)
|
||||
{
|
||||
int regno, endregno, i;
|
||||
enum machine_mode mode = GET_MODE (reg);
|
||||
int offset = 0;
|
||||
|
||||
if (GET_CODE (setter) == CLOBBER)
|
||||
return;
|
||||
|
||||
if (GET_CODE (reg) == SUBREG && REG_P (SUBREG_REG (reg)))
|
||||
{
|
||||
offset = subreg_regno_offset (REGNO (SUBREG_REG (reg)),
|
||||
GET_MODE (SUBREG_REG (reg)),
|
||||
SUBREG_BYTE (reg),
|
||||
GET_MODE (reg));
|
||||
reg = SUBREG_REG (reg);
|
||||
}
|
||||
|
||||
if (!REG_P (reg) || REGNO (reg) >= FIRST_PSEUDO_REGISTER)
|
||||
return;
|
||||
|
||||
regno = REGNO (reg) + offset;
|
||||
endregno = regno + hard_regno_nregs[regno][mode];
|
||||
|
||||
for (i = regno; i < endregno; i++)
|
||||
SET_REGNO_REG_SET ((regset) data, i);
|
||||
}
|
||||
|
||||
/* Walk X and record all referenced registers in REFERENCED_REGS. */
|
||||
static void
|
||||
mark_referenced_regs (rtx x)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (x);
|
||||
const char *fmt;
|
||||
int i, j;
|
||||
|
||||
if (code == SET)
|
||||
mark_referenced_regs (SET_SRC (x));
|
||||
if (code == SET || code == CLOBBER)
|
||||
{
|
||||
x = SET_DEST (x);
|
||||
code = GET_CODE (x);
|
||||
if ((code == REG && REGNO (x) < FIRST_PSEUDO_REGISTER)
|
||||
|| code == PC || code == CC0
|
||||
|| (code == SUBREG && REG_P (SUBREG_REG (x))
|
||||
&& REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER
|
||||
/* If we're setting only part of a multi-word register,
|
||||
we shall mark it as referenced, because the words
|
||||
that are not being set should be restored. */
|
||||
&& ((GET_MODE_SIZE (GET_MODE (x))
|
||||
>= GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))))
|
||||
|| (GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))
|
||||
<= UNITS_PER_WORD))))
|
||||
return;
|
||||
}
|
||||
if (code == MEM || code == SUBREG)
|
||||
{
|
||||
x = XEXP (x, 0);
|
||||
code = GET_CODE (x);
|
||||
}
|
||||
|
||||
if (code == REG)
|
||||
{
|
||||
int regno = REGNO (x);
|
||||
int hardregno = (regno < FIRST_PSEUDO_REGISTER ? regno
|
||||
: reg_renumber[regno]);
|
||||
|
||||
if (hardregno >= 0)
|
||||
{
|
||||
int nregs = hard_regno_nregs[hardregno][GET_MODE (x)];
|
||||
while (nregs-- > 0)
|
||||
SET_HARD_REG_BIT (referenced_regs, hardregno + nregs);
|
||||
}
|
||||
/* If this is a pseudo that did not get a hard register, scan its
|
||||
memory location, since it might involve the use of another
|
||||
register, which might be saved. */
|
||||
else if (reg_equiv_mem[regno] != 0)
|
||||
mark_referenced_regs (XEXP (reg_equiv_mem[regno], 0));
|
||||
else if (reg_equiv_address[regno] != 0)
|
||||
mark_referenced_regs (reg_equiv_address[regno]);
|
||||
return;
|
||||
}
|
||||
|
||||
fmt = GET_RTX_FORMAT (code);
|
||||
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
|
||||
{
|
||||
if (fmt[i] == 'e')
|
||||
mark_referenced_regs (XEXP (x, i));
|
||||
else if (fmt[i] == 'E')
|
||||
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
|
||||
mark_referenced_regs (XVECEXP (x, i, j));
|
||||
}
|
||||
}
|
||||
|
||||
/* Insert a sequence of insns to restore. Place these insns in front of
|
||||
CHAIN if BEFORE_P is nonzero, behind the insn otherwise. MAXRESTORE is
|
||||
the maximum number of registers which should be restored during this call.
|
||||
It should never be less than 1 since we only work with entire registers.
|
||||
|
||||
Note that we have verified in init_caller_save that we can do this
|
||||
with a simple SET, so use it. Set INSN_CODE to what we save there
|
||||
since the address might not be valid so the insn might not be recognized.
|
||||
These insns will be reloaded and have register elimination done by
|
||||
find_reload, so we need not worry about that here.
|
||||
|
||||
Return the extra number of registers saved. */
|
||||
|
||||
static int
|
||||
insert_restore (struct insn_chain *chain, int before_p, int regno,
|
||||
int maxrestore, enum machine_mode *save_mode)
|
||||
{
|
||||
int i, k;
|
||||
rtx pat = NULL_RTX;
|
||||
int code;
|
||||
unsigned int numregs = 0;
|
||||
struct insn_chain *new;
|
||||
rtx mem;
|
||||
|
||||
/* A common failure mode if register status is not correct in the
|
||||
RTL is for this routine to be called with a REGNO we didn't
|
||||
expect to save. That will cause us to write an insn with a (nil)
|
||||
SET_DEST or SET_SRC. Instead of doing so and causing a crash
|
||||
later, check for this common case here instead. This will remove
|
||||
one step in debugging such problems. */
|
||||
gcc_assert (regno_save_mem[regno][1]);
|
||||
|
||||
/* Get the pattern to emit and update our status.
|
||||
|
||||
See if we can restore `maxrestore' registers at once. Work
|
||||
backwards to the single register case. */
|
||||
for (i = maxrestore; i > 0; i--)
|
||||
{
|
||||
int j;
|
||||
int ok = 1;
|
||||
|
||||
if (regno_save_mem[regno][i] == 0)
|
||||
continue;
|
||||
|
||||
for (j = 0; j < i; j++)
|
||||
if (! TEST_HARD_REG_BIT (hard_regs_saved, regno + j))
|
||||
{
|
||||
ok = 0;
|
||||
break;
|
||||
}
|
||||
/* Must do this one restore at a time. */
|
||||
if (! ok)
|
||||
continue;
|
||||
|
||||
numregs = i;
|
||||
break;
|
||||
}
|
||||
|
||||
mem = regno_save_mem [regno][numregs];
|
||||
if (save_mode [regno] != VOIDmode
|
||||
&& save_mode [regno] != GET_MODE (mem)
|
||||
&& numregs == (unsigned int) hard_regno_nregs[regno][save_mode [regno]])
|
||||
mem = adjust_address (mem, save_mode[regno], 0);
|
||||
else
|
||||
mem = copy_rtx (mem);
|
||||
pat = gen_rtx_SET (VOIDmode,
|
||||
gen_rtx_REG (GET_MODE (mem),
|
||||
regno), mem);
|
||||
code = reg_restore_code[regno][GET_MODE (mem)];
|
||||
new = insert_one_insn (chain, before_p, code, pat);
|
||||
|
||||
/* Clear status for all registers we restored. */
|
||||
for (k = 0; k < i; k++)
|
||||
{
|
||||
CLEAR_HARD_REG_BIT (hard_regs_saved, regno + k);
|
||||
SET_REGNO_REG_SET (&new->dead_or_set, regno + k);
|
||||
n_regs_saved--;
|
||||
}
|
||||
|
||||
/* Tell our callers how many extra registers we saved/restored. */
|
||||
return numregs - 1;
|
||||
}
|
||||
|
||||
/* Like insert_restore above, but save registers instead. */
|
||||
|
||||
static int
|
||||
insert_save (struct insn_chain *chain, int before_p, int regno,
|
||||
HARD_REG_SET (*to_save), enum machine_mode *save_mode)
|
||||
{
|
||||
int i;
|
||||
unsigned int k;
|
||||
rtx pat = NULL_RTX;
|
||||
int code;
|
||||
unsigned int numregs = 0;
|
||||
struct insn_chain *new;
|
||||
rtx mem;
|
||||
|
||||
/* A common failure mode if register status is not correct in the
|
||||
RTL is for this routine to be called with a REGNO we didn't
|
||||
expect to save. That will cause us to write an insn with a (nil)
|
||||
SET_DEST or SET_SRC. Instead of doing so and causing a crash
|
||||
later, check for this common case here. This will remove one
|
||||
step in debugging such problems. */
|
||||
gcc_assert (regno_save_mem[regno][1]);
|
||||
|
||||
/* Get the pattern to emit and update our status.
|
||||
|
||||
See if we can save several registers with a single instruction.
|
||||
Work backwards to the single register case. */
|
||||
for (i = MOVE_MAX_WORDS; i > 0; i--)
|
||||
{
|
||||
int j;
|
||||
int ok = 1;
|
||||
if (regno_save_mem[regno][i] == 0)
|
||||
continue;
|
||||
|
||||
for (j = 0; j < i; j++)
|
||||
if (! TEST_HARD_REG_BIT (*to_save, regno + j))
|
||||
{
|
||||
ok = 0;
|
||||
break;
|
||||
}
|
||||
/* Must do this one save at a time. */
|
||||
if (! ok)
|
||||
continue;
|
||||
|
||||
numregs = i;
|
||||
break;
|
||||
}
|
||||
|
||||
mem = regno_save_mem [regno][numregs];
|
||||
if (save_mode [regno] != VOIDmode
|
||||
&& save_mode [regno] != GET_MODE (mem)
|
||||
&& numregs == (unsigned int) hard_regno_nregs[regno][save_mode [regno]])
|
||||
mem = adjust_address (mem, save_mode[regno], 0);
|
||||
else
|
||||
mem = copy_rtx (mem);
|
||||
pat = gen_rtx_SET (VOIDmode, mem,
|
||||
gen_rtx_REG (GET_MODE (mem),
|
||||
regno));
|
||||
code = reg_save_code[regno][GET_MODE (mem)];
|
||||
new = insert_one_insn (chain, before_p, code, pat);
|
||||
|
||||
/* Set hard_regs_saved and dead_or_set for all the registers we saved. */
|
||||
for (k = 0; k < numregs; k++)
|
||||
{
|
||||
SET_HARD_REG_BIT (hard_regs_saved, regno + k);
|
||||
SET_REGNO_REG_SET (&new->dead_or_set, regno + k);
|
||||
n_regs_saved++;
|
||||
}
|
||||
|
||||
/* Tell our callers how many extra registers we saved/restored. */
|
||||
return numregs - 1;
|
||||
}
|
||||
|
||||
/* Emit a new caller-save insn and set the code. */
|
||||
static struct insn_chain *
|
||||
insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat)
|
||||
{
|
||||
rtx insn = chain->insn;
|
||||
struct insn_chain *new;
|
||||
|
||||
#ifdef HAVE_cc0
|
||||
/* If INSN references CC0, put our insns in front of the insn that sets
|
||||
CC0. This is always safe, since the only way we could be passed an
|
||||
insn that references CC0 is for a restore, and doing a restore earlier
|
||||
isn't a problem. We do, however, assume here that CALL_INSNs don't
|
||||
reference CC0. Guard against non-INSN's like CODE_LABEL. */
|
||||
|
||||
if ((NONJUMP_INSN_P (insn) || JUMP_P (insn))
|
||||
&& before_p
|
||||
&& reg_referenced_p (cc0_rtx, PATTERN (insn)))
|
||||
chain = chain->prev, insn = chain->insn;
|
||||
#endif
|
||||
|
||||
new = new_insn_chain ();
|
||||
if (before_p)
|
||||
{
|
||||
rtx link;
|
||||
|
||||
new->prev = chain->prev;
|
||||
if (new->prev != 0)
|
||||
new->prev->next = new;
|
||||
else
|
||||
reload_insn_chain = new;
|
||||
|
||||
chain->prev = new;
|
||||
new->next = chain;
|
||||
new->insn = emit_insn_before (pat, insn);
|
||||
/* ??? It would be nice if we could exclude the already / still saved
|
||||
registers from the live sets. */
|
||||
COPY_REG_SET (&new->live_throughout, &chain->live_throughout);
|
||||
/* Registers that die in CHAIN->INSN still live in the new insn. */
|
||||
for (link = REG_NOTES (chain->insn); link; link = XEXP (link, 1))
|
||||
{
|
||||
if (REG_NOTE_KIND (link) == REG_DEAD)
|
||||
{
|
||||
rtx reg = XEXP (link, 0);
|
||||
int regno, i;
|
||||
|
||||
gcc_assert (REG_P (reg));
|
||||
regno = REGNO (reg);
|
||||
if (regno >= FIRST_PSEUDO_REGISTER)
|
||||
regno = reg_renumber[regno];
|
||||
if (regno < 0)
|
||||
continue;
|
||||
for (i = hard_regno_nregs[regno][GET_MODE (reg)] - 1;
|
||||
i >= 0; i--)
|
||||
SET_REGNO_REG_SET (&new->live_throughout, regno + i);
|
||||
}
|
||||
}
|
||||
CLEAR_REG_SET (&new->dead_or_set);
|
||||
if (chain->insn == BB_HEAD (BASIC_BLOCK (chain->block)))
|
||||
BB_HEAD (BASIC_BLOCK (chain->block)) = new->insn;
|
||||
}
|
||||
else
|
||||
{
|
||||
new->next = chain->next;
|
||||
if (new->next != 0)
|
||||
new->next->prev = new;
|
||||
chain->next = new;
|
||||
new->prev = chain;
|
||||
new->insn = emit_insn_after (pat, insn);
|
||||
/* ??? It would be nice if we could exclude the already / still saved
|
||||
registers from the live sets, and observe REG_UNUSED notes. */
|
||||
COPY_REG_SET (&new->live_throughout, &chain->live_throughout);
|
||||
/* Registers that are set in CHAIN->INSN live in the new insn.
|
||||
(Unless there is a REG_UNUSED note for them, but we don't
|
||||
look for them here.) */
|
||||
note_stores (PATTERN (chain->insn), add_stored_regs,
|
||||
&new->live_throughout);
|
||||
CLEAR_REG_SET (&new->dead_or_set);
|
||||
if (chain->insn == BB_END (BASIC_BLOCK (chain->block)))
|
||||
BB_END (BASIC_BLOCK (chain->block)) = new->insn;
|
||||
}
|
||||
new->block = chain->block;
|
||||
new->is_caller_save_insn = 1;
|
||||
|
||||
INSN_CODE (new->insn) = code;
|
||||
return new;
|
||||
}
|
4425
contrib/gcc/calls.c
4425
contrib/gcc/calls.c
File diff suppressed because it is too large
Load Diff
1156
contrib/gcc/cfg.c
1156
contrib/gcc/cfg.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,802 +0,0 @@
|
||||
/* Control flow graph building code for GNU compiler.
|
||||
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
||||
1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
/* find_basic_blocks divides the current function's rtl into basic
|
||||
blocks and constructs the CFG. The blocks are recorded in the
|
||||
basic_block_info array; the CFG exists in the edge structures
|
||||
referenced by the blocks.
|
||||
|
||||
find_basic_blocks also finds any unreachable loops and deletes them.
|
||||
|
||||
Available functionality:
|
||||
- CFG construction
|
||||
find_basic_blocks */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "tree.h"
|
||||
#include "rtl.h"
|
||||
#include "hard-reg-set.h"
|
||||
#include "basic-block.h"
|
||||
#include "regs.h"
|
||||
#include "flags.h"
|
||||
#include "output.h"
|
||||
#include "function.h"
|
||||
#include "except.h"
|
||||
#include "toplev.h"
|
||||
#include "timevar.h"
|
||||
|
||||
static int count_basic_blocks (rtx);
|
||||
static void find_basic_blocks_1 (rtx);
|
||||
static void make_edges (basic_block, basic_block, int);
|
||||
static void make_label_edge (sbitmap, basic_block, rtx, int);
|
||||
static void find_bb_boundaries (basic_block);
|
||||
static void compute_outgoing_frequencies (basic_block);
|
||||
|
||||
/* Return true if insn is something that should be contained inside basic
|
||||
block. */
|
||||
|
||||
bool
|
||||
inside_basic_block_p (rtx insn)
|
||||
{
|
||||
switch (GET_CODE (insn))
|
||||
{
|
||||
case CODE_LABEL:
|
||||
/* Avoid creating of basic block for jumptables. */
|
||||
return (NEXT_INSN (insn) == 0
|
||||
|| !JUMP_P (NEXT_INSN (insn))
|
||||
|| (GET_CODE (PATTERN (NEXT_INSN (insn))) != ADDR_VEC
|
||||
&& GET_CODE (PATTERN (NEXT_INSN (insn))) != ADDR_DIFF_VEC));
|
||||
|
||||
case JUMP_INSN:
|
||||
return (GET_CODE (PATTERN (insn)) != ADDR_VEC
|
||||
&& GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC);
|
||||
|
||||
case CALL_INSN:
|
||||
case INSN:
|
||||
return true;
|
||||
|
||||
case BARRIER:
|
||||
case NOTE:
|
||||
return false;
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
|
||||
/* Return true if INSN may cause control flow transfer, so it should be last in
|
||||
the basic block. */
|
||||
|
||||
bool
|
||||
control_flow_insn_p (rtx insn)
|
||||
{
|
||||
rtx note;
|
||||
|
||||
switch (GET_CODE (insn))
|
||||
{
|
||||
case NOTE:
|
||||
case CODE_LABEL:
|
||||
return false;
|
||||
|
||||
case JUMP_INSN:
|
||||
/* Jump insn always causes control transfer except for tablejumps. */
|
||||
return (GET_CODE (PATTERN (insn)) != ADDR_VEC
|
||||
&& GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC);
|
||||
|
||||
case CALL_INSN:
|
||||
/* Noreturn and sibling call instructions terminate the basic blocks
|
||||
(but only if they happen unconditionally). */
|
||||
if ((SIBLING_CALL_P (insn)
|
||||
|| find_reg_note (insn, REG_NORETURN, 0))
|
||||
&& GET_CODE (PATTERN (insn)) != COND_EXEC)
|
||||
return true;
|
||||
/* Call insn may return to the nonlocal goto handler. */
|
||||
return ((nonlocal_goto_handler_labels
|
||||
&& (0 == (note = find_reg_note (insn, REG_EH_REGION,
|
||||
NULL_RTX))
|
||||
|| INTVAL (XEXP (note, 0)) >= 0))
|
||||
/* Or may trap. */
|
||||
|| can_throw_internal (insn));
|
||||
|
||||
case INSN:
|
||||
/* Treat trap instructions like noreturn calls (same provision). */
|
||||
if (GET_CODE (PATTERN (insn)) == TRAP_IF
|
||||
&& XEXP (PATTERN (insn), 0) == const1_rtx)
|
||||
return true;
|
||||
|
||||
return (flag_non_call_exceptions && can_throw_internal (insn));
|
||||
|
||||
case BARRIER:
|
||||
/* It is nonsense to reach barrier when looking for the
|
||||
end of basic block, but before dead code is eliminated
|
||||
this may happen. */
|
||||
return false;
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
|
||||
/* Count the basic blocks of the function. */
|
||||
|
||||
static int
|
||||
count_basic_blocks (rtx f)
|
||||
{
|
||||
int count = NUM_FIXED_BLOCKS;
|
||||
bool saw_insn = false;
|
||||
rtx insn;
|
||||
|
||||
for (insn = f; insn; insn = NEXT_INSN (insn))
|
||||
{
|
||||
/* Code labels and barriers causes current basic block to be
|
||||
terminated at previous real insn. */
|
||||
if ((LABEL_P (insn) || BARRIER_P (insn))
|
||||
&& saw_insn)
|
||||
count++, saw_insn = false;
|
||||
|
||||
/* Start basic block if needed. */
|
||||
if (!saw_insn && inside_basic_block_p (insn))
|
||||
saw_insn = true;
|
||||
|
||||
/* Control flow insn causes current basic block to be terminated. */
|
||||
if (saw_insn && control_flow_insn_p (insn))
|
||||
count++, saw_insn = false;
|
||||
}
|
||||
|
||||
if (saw_insn)
|
||||
count++;
|
||||
|
||||
/* The rest of the compiler works a bit smoother when we don't have to
|
||||
check for the edge case of do-nothing functions with no basic blocks. */
|
||||
if (count == NUM_FIXED_BLOCKS)
|
||||
{
|
||||
emit_insn (gen_rtx_USE (VOIDmode, const0_rtx));
|
||||
count = NUM_FIXED_BLOCKS + 1;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
/* Create an edge between two basic blocks. FLAGS are auxiliary information
|
||||
about the edge that is accumulated between calls. */
|
||||
|
||||
/* Create an edge from a basic block to a label. */
|
||||
|
||||
static void
|
||||
make_label_edge (sbitmap edge_cache, basic_block src, rtx label, int flags)
|
||||
{
|
||||
gcc_assert (LABEL_P (label));
|
||||
|
||||
/* If the label was never emitted, this insn is junk, but avoid a
|
||||
crash trying to refer to BLOCK_FOR_INSN (label). This can happen
|
||||
as a result of a syntax error and a diagnostic has already been
|
||||
printed. */
|
||||
|
||||
if (INSN_UID (label) == 0)
|
||||
return;
|
||||
|
||||
cached_make_edge (edge_cache, src, BLOCK_FOR_INSN (label), flags);
|
||||
}
|
||||
|
||||
/* Create the edges generated by INSN in REGION. */
|
||||
|
||||
void
|
||||
rtl_make_eh_edge (sbitmap edge_cache, basic_block src, rtx insn)
|
||||
{
|
||||
int is_call = CALL_P (insn) ? EDGE_ABNORMAL_CALL : 0;
|
||||
rtx handlers, i;
|
||||
|
||||
handlers = reachable_handlers (insn);
|
||||
|
||||
for (i = handlers; i; i = XEXP (i, 1))
|
||||
make_label_edge (edge_cache, src, XEXP (i, 0),
|
||||
EDGE_ABNORMAL | EDGE_EH | is_call);
|
||||
|
||||
free_INSN_LIST_list (&handlers);
|
||||
}
|
||||
|
||||
/* States of basic block as seen by find_many_sub_basic_blocks. */
|
||||
enum state {
|
||||
/* Basic blocks created via split_block belong to this state.
|
||||
make_edges will examine these basic blocks to see if we need to
|
||||
create edges going out of them. */
|
||||
BLOCK_NEW = 0,
|
||||
|
||||
/* Basic blocks that do not need examining belong to this state.
|
||||
These blocks will be left intact. In particular, make_edges will
|
||||
not create edges going out of these basic blocks. */
|
||||
BLOCK_ORIGINAL,
|
||||
|
||||
/* Basic blocks that may need splitting (due to a label appearing in
|
||||
the middle, etc) belong to this state. After splitting them,
|
||||
make_edges will create edges going out of them as needed. */
|
||||
BLOCK_TO_SPLIT
|
||||
};
|
||||
|
||||
#define STATE(BB) (enum state) ((size_t) (BB)->aux)
|
||||
#define SET_STATE(BB, STATE) ((BB)->aux = (void *) (size_t) (STATE))
|
||||
|
||||
/* Used internally by purge_dead_tablejump_edges, ORed into state. */
|
||||
#define BLOCK_USED_BY_TABLEJUMP 32
|
||||
#define FULL_STATE(BB) ((size_t) (BB)->aux)
|
||||
|
||||
/* Identify the edges going out of basic blocks between MIN and MAX,
|
||||
inclusive, that have their states set to BLOCK_NEW or
|
||||
BLOCK_TO_SPLIT.
|
||||
|
||||
UPDATE_P should be nonzero if we are updating CFG and zero if we
|
||||
are building CFG from scratch. */
|
||||
|
||||
static void
|
||||
make_edges (basic_block min, basic_block max, int update_p)
|
||||
{
|
||||
basic_block bb;
|
||||
sbitmap edge_cache = NULL;
|
||||
|
||||
/* Heavy use of computed goto in machine-generated code can lead to
|
||||
nearly fully-connected CFGs. In that case we spend a significant
|
||||
amount of time searching the edge lists for duplicates. */
|
||||
if (forced_labels || cfun->max_jumptable_ents > 100)
|
||||
edge_cache = sbitmap_alloc (last_basic_block);
|
||||
|
||||
/* By nature of the way these get numbered, ENTRY_BLOCK_PTR->next_bb block
|
||||
is always the entry. */
|
||||
if (min == ENTRY_BLOCK_PTR->next_bb)
|
||||
make_edge (ENTRY_BLOCK_PTR, min, EDGE_FALLTHRU);
|
||||
|
||||
FOR_BB_BETWEEN (bb, min, max->next_bb, next_bb)
|
||||
{
|
||||
rtx insn, x;
|
||||
enum rtx_code code;
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
|
||||
if (STATE (bb) == BLOCK_ORIGINAL)
|
||||
continue;
|
||||
|
||||
/* If we have an edge cache, cache edges going out of BB. */
|
||||
if (edge_cache)
|
||||
{
|
||||
sbitmap_zero (edge_cache);
|
||||
if (update_p)
|
||||
{
|
||||
FOR_EACH_EDGE (e, ei, bb->succs)
|
||||
if (e->dest != EXIT_BLOCK_PTR)
|
||||
SET_BIT (edge_cache, e->dest->index);
|
||||
}
|
||||
}
|
||||
|
||||
if (LABEL_P (BB_HEAD (bb))
|
||||
&& LABEL_ALT_ENTRY_P (BB_HEAD (bb)))
|
||||
cached_make_edge (NULL, ENTRY_BLOCK_PTR, bb, 0);
|
||||
|
||||
/* Examine the last instruction of the block, and discover the
|
||||
ways we can leave the block. */
|
||||
|
||||
insn = BB_END (bb);
|
||||
code = GET_CODE (insn);
|
||||
|
||||
/* A branch. */
|
||||
if (code == JUMP_INSN)
|
||||
{
|
||||
rtx tmp;
|
||||
|
||||
/* Recognize exception handling placeholders. */
|
||||
if (GET_CODE (PATTERN (insn)) == RESX)
|
||||
rtl_make_eh_edge (edge_cache, bb, insn);
|
||||
|
||||
/* Recognize a non-local goto as a branch outside the
|
||||
current function. */
|
||||
else if (find_reg_note (insn, REG_NON_LOCAL_GOTO, NULL_RTX))
|
||||
;
|
||||
|
||||
/* Recognize a tablejump and do the right thing. */
|
||||
else if (tablejump_p (insn, NULL, &tmp))
|
||||
{
|
||||
rtvec vec;
|
||||
int j;
|
||||
|
||||
if (GET_CODE (PATTERN (tmp)) == ADDR_VEC)
|
||||
vec = XVEC (PATTERN (tmp), 0);
|
||||
else
|
||||
vec = XVEC (PATTERN (tmp), 1);
|
||||
|
||||
for (j = GET_NUM_ELEM (vec) - 1; j >= 0; --j)
|
||||
make_label_edge (edge_cache, bb,
|
||||
XEXP (RTVEC_ELT (vec, j), 0), 0);
|
||||
|
||||
/* Some targets (eg, ARM) emit a conditional jump that also
|
||||
contains the out-of-range target. Scan for these and
|
||||
add an edge if necessary. */
|
||||
if ((tmp = single_set (insn)) != NULL
|
||||
&& SET_DEST (tmp) == pc_rtx
|
||||
&& GET_CODE (SET_SRC (tmp)) == IF_THEN_ELSE
|
||||
&& GET_CODE (XEXP (SET_SRC (tmp), 2)) == LABEL_REF)
|
||||
make_label_edge (edge_cache, bb,
|
||||
XEXP (XEXP (SET_SRC (tmp), 2), 0), 0);
|
||||
}
|
||||
|
||||
/* If this is a computed jump, then mark it as reaching
|
||||
everything on the forced_labels list. */
|
||||
else if (computed_jump_p (insn))
|
||||
{
|
||||
for (x = forced_labels; x; x = XEXP (x, 1))
|
||||
make_label_edge (edge_cache, bb, XEXP (x, 0), EDGE_ABNORMAL);
|
||||
}
|
||||
|
||||
/* Returns create an exit out. */
|
||||
else if (returnjump_p (insn))
|
||||
cached_make_edge (edge_cache, bb, EXIT_BLOCK_PTR, 0);
|
||||
|
||||
/* Otherwise, we have a plain conditional or unconditional jump. */
|
||||
else
|
||||
{
|
||||
gcc_assert (JUMP_LABEL (insn));
|
||||
make_label_edge (edge_cache, bb, JUMP_LABEL (insn), 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* If this is a sibling call insn, then this is in effect a combined call
|
||||
and return, and so we need an edge to the exit block. No need to
|
||||
worry about EH edges, since we wouldn't have created the sibling call
|
||||
in the first place. */
|
||||
if (code == CALL_INSN && SIBLING_CALL_P (insn))
|
||||
cached_make_edge (edge_cache, bb, EXIT_BLOCK_PTR,
|
||||
EDGE_SIBCALL | EDGE_ABNORMAL);
|
||||
|
||||
/* If this is a CALL_INSN, then mark it as reaching the active EH
|
||||
handler for this CALL_INSN. If we're handling non-call
|
||||
exceptions then any insn can reach any of the active handlers.
|
||||
Also mark the CALL_INSN as reaching any nonlocal goto handler. */
|
||||
else if (code == CALL_INSN || flag_non_call_exceptions)
|
||||
{
|
||||
/* Add any appropriate EH edges. */
|
||||
rtl_make_eh_edge (edge_cache, bb, insn);
|
||||
|
||||
if (code == CALL_INSN && nonlocal_goto_handler_labels)
|
||||
{
|
||||
/* ??? This could be made smarter: in some cases it's possible
|
||||
to tell that certain calls will not do a nonlocal goto.
|
||||
For example, if the nested functions that do the nonlocal
|
||||
gotos do not have their addresses taken, then only calls to
|
||||
those functions or to other nested functions that use them
|
||||
could possibly do nonlocal gotos. */
|
||||
|
||||
/* We do know that a REG_EH_REGION note with a value less
|
||||
than 0 is guaranteed not to perform a non-local goto. */
|
||||
rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
|
||||
|
||||
if (!note || INTVAL (XEXP (note, 0)) >= 0)
|
||||
for (x = nonlocal_goto_handler_labels; x; x = XEXP (x, 1))
|
||||
make_label_edge (edge_cache, bb, XEXP (x, 0),
|
||||
EDGE_ABNORMAL | EDGE_ABNORMAL_CALL);
|
||||
}
|
||||
}
|
||||
|
||||
/* Find out if we can drop through to the next block. */
|
||||
insn = NEXT_INSN (insn);
|
||||
e = find_edge (bb, EXIT_BLOCK_PTR);
|
||||
if (e && e->flags & EDGE_FALLTHRU)
|
||||
insn = NULL;
|
||||
|
||||
while (insn
|
||||
&& NOTE_P (insn)
|
||||
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK)
|
||||
insn = NEXT_INSN (insn);
|
||||
|
||||
if (!insn)
|
||||
cached_make_edge (edge_cache, bb, EXIT_BLOCK_PTR, EDGE_FALLTHRU);
|
||||
else if (bb->next_bb != EXIT_BLOCK_PTR)
|
||||
{
|
||||
if (insn == BB_HEAD (bb->next_bb))
|
||||
cached_make_edge (edge_cache, bb, bb->next_bb, EDGE_FALLTHRU);
|
||||
}
|
||||
}
|
||||
|
||||
if (edge_cache)
|
||||
sbitmap_vector_free (edge_cache);
|
||||
}
|
||||
|
||||
/* Find all basic blocks of the function whose first insn is F.
|
||||
|
||||
Collect and return a list of labels whose addresses are taken. This
|
||||
will be used in make_edges for use with computed gotos. */
|
||||
|
||||
static void
|
||||
find_basic_blocks_1 (rtx f)
|
||||
{
|
||||
rtx insn, next;
|
||||
rtx bb_note = NULL_RTX;
|
||||
rtx head = NULL_RTX;
|
||||
rtx end = NULL_RTX;
|
||||
basic_block prev = ENTRY_BLOCK_PTR;
|
||||
|
||||
/* We process the instructions in a slightly different way than we did
|
||||
previously. This is so that we see a NOTE_BASIC_BLOCK after we have
|
||||
closed out the previous block, so that it gets attached at the proper
|
||||
place. Since this form should be equivalent to the previous,
|
||||
count_basic_blocks continues to use the old form as a check. */
|
||||
|
||||
for (insn = f; insn; insn = next)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (insn);
|
||||
|
||||
next = NEXT_INSN (insn);
|
||||
|
||||
if ((LABEL_P (insn) || BARRIER_P (insn))
|
||||
&& head)
|
||||
{
|
||||
prev = create_basic_block_structure (head, end, bb_note, prev);
|
||||
head = end = NULL_RTX;
|
||||
bb_note = NULL_RTX;
|
||||
}
|
||||
|
||||
if (inside_basic_block_p (insn))
|
||||
{
|
||||
if (head == NULL_RTX)
|
||||
head = insn;
|
||||
end = insn;
|
||||
}
|
||||
|
||||
if (head && control_flow_insn_p (insn))
|
||||
{
|
||||
prev = create_basic_block_structure (head, end, bb_note, prev);
|
||||
head = end = NULL_RTX;
|
||||
bb_note = NULL_RTX;
|
||||
}
|
||||
|
||||
switch (code)
|
||||
{
|
||||
case NOTE:
|
||||
{
|
||||
int kind = NOTE_LINE_NUMBER (insn);
|
||||
|
||||
/* Look for basic block notes with which to keep the
|
||||
basic_block_info pointers stable. Unthread the note now;
|
||||
we'll put it back at the right place in create_basic_block.
|
||||
Or not at all if we've already found a note in this block. */
|
||||
if (kind == NOTE_INSN_BASIC_BLOCK)
|
||||
{
|
||||
if (bb_note == NULL_RTX)
|
||||
bb_note = insn;
|
||||
else
|
||||
next = delete_insn (insn);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case CODE_LABEL:
|
||||
case JUMP_INSN:
|
||||
case CALL_INSN:
|
||||
case INSN:
|
||||
case BARRIER:
|
||||
break;
|
||||
|
||||
default:
|
||||
gcc_unreachable ();
|
||||
}
|
||||
}
|
||||
|
||||
if (head != NULL_RTX)
|
||||
create_basic_block_structure (head, end, bb_note, prev);
|
||||
else if (bb_note)
|
||||
delete_insn (bb_note);
|
||||
|
||||
gcc_assert (last_basic_block == n_basic_blocks);
|
||||
|
||||
clear_aux_for_blocks ();
|
||||
}
|
||||
|
||||
|
||||
/* Find basic blocks of the current function.
|
||||
F is the first insn of the function. */
|
||||
|
||||
void
|
||||
find_basic_blocks (rtx f)
|
||||
{
|
||||
basic_block bb;
|
||||
|
||||
timevar_push (TV_CFG);
|
||||
|
||||
/* Flush out existing data. */
|
||||
if (basic_block_info != NULL)
|
||||
{
|
||||
clear_edges ();
|
||||
|
||||
/* Clear bb->aux on all extant basic blocks. We'll use this as a
|
||||
tag for reuse during create_basic_block, just in case some pass
|
||||
copies around basic block notes improperly. */
|
||||
FOR_EACH_BB (bb)
|
||||
bb->aux = NULL;
|
||||
|
||||
basic_block_info = NULL;
|
||||
}
|
||||
|
||||
n_basic_blocks = count_basic_blocks (f);
|
||||
last_basic_block = NUM_FIXED_BLOCKS;
|
||||
ENTRY_BLOCK_PTR->next_bb = EXIT_BLOCK_PTR;
|
||||
EXIT_BLOCK_PTR->prev_bb = ENTRY_BLOCK_PTR;
|
||||
|
||||
|
||||
/* Size the basic block table. The actual structures will be allocated
|
||||
by find_basic_blocks_1, since we want to keep the structure pointers
|
||||
stable across calls to find_basic_blocks. */
|
||||
/* ??? This whole issue would be much simpler if we called find_basic_blocks
|
||||
exactly once, and thereafter we don't have a single long chain of
|
||||
instructions at all until close to the end of compilation when we
|
||||
actually lay them out. */
|
||||
|
||||
basic_block_info = VEC_alloc (basic_block, gc, n_basic_blocks);
|
||||
VEC_safe_grow (basic_block, gc, basic_block_info, n_basic_blocks);
|
||||
memset (VEC_address (basic_block, basic_block_info), 0,
|
||||
sizeof (basic_block) * n_basic_blocks);
|
||||
SET_BASIC_BLOCK (ENTRY_BLOCK, ENTRY_BLOCK_PTR);
|
||||
SET_BASIC_BLOCK (EXIT_BLOCK, EXIT_BLOCK_PTR);
|
||||
|
||||
find_basic_blocks_1 (f);
|
||||
|
||||
profile_status = PROFILE_ABSENT;
|
||||
|
||||
/* Tell make_edges to examine every block for out-going edges. */
|
||||
FOR_EACH_BB (bb)
|
||||
SET_STATE (bb, BLOCK_NEW);
|
||||
|
||||
/* Discover the edges of our cfg. */
|
||||
make_edges (ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR->prev_bb, 0);
|
||||
|
||||
/* Do very simple cleanup now, for the benefit of code that runs between
|
||||
here and cleanup_cfg, e.g. thread_prologue_and_epilogue_insns. */
|
||||
tidy_fallthru_edges ();
|
||||
|
||||
#ifdef ENABLE_CHECKING
|
||||
verify_flow_info ();
|
||||
#endif
|
||||
timevar_pop (TV_CFG);
|
||||
}
|
||||
|
||||
static void
|
||||
mark_tablejump_edge (rtx label)
|
||||
{
|
||||
basic_block bb;
|
||||
|
||||
gcc_assert (LABEL_P (label));
|
||||
/* See comment in make_label_edge. */
|
||||
if (INSN_UID (label) == 0)
|
||||
return;
|
||||
bb = BLOCK_FOR_INSN (label);
|
||||
SET_STATE (bb, FULL_STATE (bb) | BLOCK_USED_BY_TABLEJUMP);
|
||||
}
|
||||
|
||||
static void
|
||||
purge_dead_tablejump_edges (basic_block bb, rtx table)
|
||||
{
|
||||
rtx insn = BB_END (bb), tmp;
|
||||
rtvec vec;
|
||||
int j;
|
||||
edge_iterator ei;
|
||||
edge e;
|
||||
|
||||
if (GET_CODE (PATTERN (table)) == ADDR_VEC)
|
||||
vec = XVEC (PATTERN (table), 0);
|
||||
else
|
||||
vec = XVEC (PATTERN (table), 1);
|
||||
|
||||
for (j = GET_NUM_ELEM (vec) - 1; j >= 0; --j)
|
||||
mark_tablejump_edge (XEXP (RTVEC_ELT (vec, j), 0));
|
||||
|
||||
/* Some targets (eg, ARM) emit a conditional jump that also
|
||||
contains the out-of-range target. Scan for these and
|
||||
add an edge if necessary. */
|
||||
if ((tmp = single_set (insn)) != NULL
|
||||
&& SET_DEST (tmp) == pc_rtx
|
||||
&& GET_CODE (SET_SRC (tmp)) == IF_THEN_ELSE
|
||||
&& GET_CODE (XEXP (SET_SRC (tmp), 2)) == LABEL_REF)
|
||||
mark_tablejump_edge (XEXP (XEXP (SET_SRC (tmp), 2), 0));
|
||||
|
||||
for (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); )
|
||||
{
|
||||
if (FULL_STATE (e->dest) & BLOCK_USED_BY_TABLEJUMP)
|
||||
SET_STATE (e->dest, FULL_STATE (e->dest)
|
||||
& ~(size_t) BLOCK_USED_BY_TABLEJUMP);
|
||||
else if (!(e->flags & (EDGE_ABNORMAL | EDGE_EH)))
|
||||
{
|
||||
remove_edge (e);
|
||||
continue;
|
||||
}
|
||||
ei_next (&ei);
|
||||
}
|
||||
}
|
||||
|
||||
/* Scan basic block BB for possible BB boundaries inside the block
|
||||
and create new basic blocks in the progress. */
|
||||
|
||||
static void
|
||||
find_bb_boundaries (basic_block bb)
|
||||
{
|
||||
basic_block orig_bb = bb;
|
||||
rtx insn = BB_HEAD (bb);
|
||||
rtx end = BB_END (bb);
|
||||
rtx table;
|
||||
rtx flow_transfer_insn = NULL_RTX;
|
||||
edge fallthru = NULL;
|
||||
|
||||
if (insn == BB_END (bb))
|
||||
return;
|
||||
|
||||
if (LABEL_P (insn))
|
||||
insn = NEXT_INSN (insn);
|
||||
|
||||
/* Scan insn chain and try to find new basic block boundaries. */
|
||||
while (1)
|
||||
{
|
||||
enum rtx_code code = GET_CODE (insn);
|
||||
|
||||
/* On code label, split current basic block. */
|
||||
if (code == CODE_LABEL)
|
||||
{
|
||||
fallthru = split_block (bb, PREV_INSN (insn));
|
||||
if (flow_transfer_insn)
|
||||
BB_END (bb) = flow_transfer_insn;
|
||||
|
||||
bb = fallthru->dest;
|
||||
remove_edge (fallthru);
|
||||
flow_transfer_insn = NULL_RTX;
|
||||
if (LABEL_ALT_ENTRY_P (insn))
|
||||
make_edge (ENTRY_BLOCK_PTR, bb, 0);
|
||||
}
|
||||
|
||||
/* In case we've previously seen an insn that effects a control
|
||||
flow transfer, split the block. */
|
||||
if (flow_transfer_insn && inside_basic_block_p (insn))
|
||||
{
|
||||
fallthru = split_block (bb, PREV_INSN (insn));
|
||||
BB_END (bb) = flow_transfer_insn;
|
||||
bb = fallthru->dest;
|
||||
remove_edge (fallthru);
|
||||
flow_transfer_insn = NULL_RTX;
|
||||
}
|
||||
|
||||
if (control_flow_insn_p (insn))
|
||||
flow_transfer_insn = insn;
|
||||
if (insn == end)
|
||||
break;
|
||||
insn = NEXT_INSN (insn);
|
||||
}
|
||||
|
||||
/* In case expander replaced normal insn by sequence terminating by
|
||||
return and barrier, or possibly other sequence not behaving like
|
||||
ordinary jump, we need to take care and move basic block boundary. */
|
||||
if (flow_transfer_insn)
|
||||
BB_END (bb) = flow_transfer_insn;
|
||||
|
||||
/* We've possibly replaced the conditional jump by conditional jump
|
||||
followed by cleanup at fallthru edge, so the outgoing edges may
|
||||
be dead. */
|
||||
purge_dead_edges (bb);
|
||||
|
||||
/* purge_dead_edges doesn't handle tablejump's, but if we have split the
|
||||
basic block, we might need to kill some edges. */
|
||||
if (bb != orig_bb && tablejump_p (BB_END (bb), NULL, &table))
|
||||
purge_dead_tablejump_edges (bb, table);
|
||||
}
|
||||
|
||||
/* Assume that frequency of basic block B is known. Compute frequencies
|
||||
and probabilities of outgoing edges. */
|
||||
|
||||
static void
|
||||
compute_outgoing_frequencies (basic_block b)
|
||||
{
|
||||
edge e, f;
|
||||
edge_iterator ei;
|
||||
|
||||
if (EDGE_COUNT (b->succs) == 2)
|
||||
{
|
||||
rtx note = find_reg_note (BB_END (b), REG_BR_PROB, NULL);
|
||||
int probability;
|
||||
|
||||
if (note)
|
||||
{
|
||||
probability = INTVAL (XEXP (note, 0));
|
||||
e = BRANCH_EDGE (b);
|
||||
e->probability = probability;
|
||||
e->count = ((b->count * probability + REG_BR_PROB_BASE / 2)
|
||||
/ REG_BR_PROB_BASE);
|
||||
f = FALLTHRU_EDGE (b);
|
||||
f->probability = REG_BR_PROB_BASE - probability;
|
||||
f->count = b->count - e->count;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (single_succ_p (b))
|
||||
{
|
||||
e = single_succ_edge (b);
|
||||
e->probability = REG_BR_PROB_BASE;
|
||||
e->count = b->count;
|
||||
return;
|
||||
}
|
||||
guess_outgoing_edge_probabilities (b);
|
||||
if (b->count)
|
||||
FOR_EACH_EDGE (e, ei, b->succs)
|
||||
e->count = ((b->count * e->probability + REG_BR_PROB_BASE / 2)
|
||||
/ REG_BR_PROB_BASE);
|
||||
}
|
||||
|
||||
/* Assume that some pass has inserted labels or control flow
|
||||
instructions within a basic block. Split basic blocks as needed
|
||||
and create edges. */
|
||||
|
||||
void
|
||||
find_many_sub_basic_blocks (sbitmap blocks)
|
||||
{
|
||||
basic_block bb, min, max;
|
||||
|
||||
FOR_EACH_BB (bb)
|
||||
SET_STATE (bb,
|
||||
TEST_BIT (blocks, bb->index) ? BLOCK_TO_SPLIT : BLOCK_ORIGINAL);
|
||||
|
||||
FOR_EACH_BB (bb)
|
||||
if (STATE (bb) == BLOCK_TO_SPLIT)
|
||||
find_bb_boundaries (bb);
|
||||
|
||||
FOR_EACH_BB (bb)
|
||||
if (STATE (bb) != BLOCK_ORIGINAL)
|
||||
break;
|
||||
|
||||
min = max = bb;
|
||||
for (; bb != EXIT_BLOCK_PTR; bb = bb->next_bb)
|
||||
if (STATE (bb) != BLOCK_ORIGINAL)
|
||||
max = bb;
|
||||
|
||||
/* Now re-scan and wire in all edges. This expect simple (conditional)
|
||||
jumps at the end of each new basic blocks. */
|
||||
make_edges (min, max, 1);
|
||||
|
||||
/* Update branch probabilities. Expect only (un)conditional jumps
|
||||
to be created with only the forward edges. */
|
||||
if (profile_status != PROFILE_ABSENT)
|
||||
FOR_BB_BETWEEN (bb, min, max->next_bb, next_bb)
|
||||
{
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
|
||||
if (STATE (bb) == BLOCK_ORIGINAL)
|
||||
continue;
|
||||
if (STATE (bb) == BLOCK_NEW)
|
||||
{
|
||||
bb->count = 0;
|
||||
bb->frequency = 0;
|
||||
FOR_EACH_EDGE (e, ei, bb->preds)
|
||||
{
|
||||
bb->count += e->count;
|
||||
bb->frequency += EDGE_FREQUENCY (e);
|
||||
}
|
||||
}
|
||||
|
||||
compute_outgoing_frequencies (bb);
|
||||
}
|
||||
|
||||
FOR_EACH_BB (bb)
|
||||
SET_STATE (bb, 0);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,890 +0,0 @@
|
||||
/* Hooks for cfg representation specific functions.
|
||||
Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Contributed by Sebastian Pop <s.pop@laposte.net>
|
||||
|
||||
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 2, 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 COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "tree.h"
|
||||
#include "rtl.h"
|
||||
#include "basic-block.h"
|
||||
#include "tree-flow.h"
|
||||
#include "timevar.h"
|
||||
#include "toplev.h"
|
||||
|
||||
/* A pointer to one of the hooks containers. */
|
||||
static struct cfg_hooks *cfg_hooks;
|
||||
|
||||
/* Initialization of functions specific to the rtl IR. */
|
||||
void
|
||||
rtl_register_cfg_hooks (void)
|
||||
{
|
||||
cfg_hooks = &rtl_cfg_hooks;
|
||||
}
|
||||
|
||||
/* Initialization of functions specific to the rtl IR. */
|
||||
void
|
||||
cfg_layout_rtl_register_cfg_hooks (void)
|
||||
{
|
||||
cfg_hooks = &cfg_layout_rtl_cfg_hooks;
|
||||
}
|
||||
|
||||
/* Initialization of functions specific to the tree IR. */
|
||||
|
||||
void
|
||||
tree_register_cfg_hooks (void)
|
||||
{
|
||||
cfg_hooks = &tree_cfg_hooks;
|
||||
}
|
||||
|
||||
/* Returns current ir type (rtl = 0, trees = 1). */
|
||||
|
||||
int
|
||||
ir_type (void)
|
||||
{
|
||||
return cfg_hooks == &tree_cfg_hooks ? 1 : 0;
|
||||
}
|
||||
|
||||
/* Verify the CFG consistency.
|
||||
|
||||
Currently it does following: checks edge and basic block list correctness
|
||||
and calls into IL dependent checking then. */
|
||||
|
||||
void
|
||||
verify_flow_info (void)
|
||||
{
|
||||
size_t *edge_checksum;
|
||||
int err = 0;
|
||||
basic_block bb, last_bb_seen;
|
||||
basic_block *last_visited;
|
||||
|
||||
timevar_push (TV_CFG_VERIFY);
|
||||
last_visited = XCNEWVEC (basic_block, last_basic_block);
|
||||
edge_checksum = XCNEWVEC (size_t, last_basic_block);
|
||||
|
||||
/* Check bb chain & numbers. */
|
||||
last_bb_seen = ENTRY_BLOCK_PTR;
|
||||
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR->next_bb, NULL, next_bb)
|
||||
{
|
||||
if (bb != EXIT_BLOCK_PTR
|
||||
&& bb != BASIC_BLOCK (bb->index))
|
||||
{
|
||||
error ("bb %d on wrong place", bb->index);
|
||||
err = 1;
|
||||
}
|
||||
|
||||
if (bb->prev_bb != last_bb_seen)
|
||||
{
|
||||
error ("prev_bb of %d should be %d, not %d",
|
||||
bb->index, last_bb_seen->index, bb->prev_bb->index);
|
||||
err = 1;
|
||||
}
|
||||
|
||||
last_bb_seen = bb;
|
||||
}
|
||||
|
||||
/* Now check the basic blocks (boundaries etc.) */
|
||||
FOR_EACH_BB_REVERSE (bb)
|
||||
{
|
||||
int n_fallthru = 0;
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
|
||||
if (bb->count < 0)
|
||||
{
|
||||
error ("verify_flow_info: Wrong count of block %i %i",
|
||||
bb->index, (int)bb->count);
|
||||
err = 1;
|
||||
}
|
||||
if (bb->frequency < 0)
|
||||
{
|
||||
error ("verify_flow_info: Wrong frequency of block %i %i",
|
||||
bb->index, bb->frequency);
|
||||
err = 1;
|
||||
}
|
||||
FOR_EACH_EDGE (e, ei, bb->succs)
|
||||
{
|
||||
if (last_visited [e->dest->index] == bb)
|
||||
{
|
||||
error ("verify_flow_info: Duplicate edge %i->%i",
|
||||
e->src->index, e->dest->index);
|
||||
err = 1;
|
||||
}
|
||||
if (e->probability < 0 || e->probability > REG_BR_PROB_BASE)
|
||||
{
|
||||
error ("verify_flow_info: Wrong probability of edge %i->%i %i",
|
||||
e->src->index, e->dest->index, e->probability);
|
||||
err = 1;
|
||||
}
|
||||
if (e->count < 0)
|
||||
{
|
||||
error ("verify_flow_info: Wrong count of edge %i->%i %i",
|
||||
e->src->index, e->dest->index, (int)e->count);
|
||||
err = 1;
|
||||
}
|
||||
|
||||
last_visited [e->dest->index] = bb;
|
||||
|
||||
if (e->flags & EDGE_FALLTHRU)
|
||||
n_fallthru++;
|
||||
|
||||
if (e->src != bb)
|
||||
{
|
||||
error ("verify_flow_info: Basic block %d succ edge is corrupted",
|
||||
bb->index);
|
||||
fprintf (stderr, "Predecessor: ");
|
||||
dump_edge_info (stderr, e, 0);
|
||||
fprintf (stderr, "\nSuccessor: ");
|
||||
dump_edge_info (stderr, e, 1);
|
||||
fprintf (stderr, "\n");
|
||||
err = 1;
|
||||
}
|
||||
|
||||
edge_checksum[e->dest->index] += (size_t) e;
|
||||
}
|
||||
if (n_fallthru > 1)
|
||||
{
|
||||
error ("wrong amount of branch edges after unconditional jump %i", bb->index);
|
||||
err = 1;
|
||||
}
|
||||
|
||||
FOR_EACH_EDGE (e, ei, bb->preds)
|
||||
{
|
||||
if (e->dest != bb)
|
||||
{
|
||||
error ("basic block %d pred edge is corrupted", bb->index);
|
||||
fputs ("Predecessor: ", stderr);
|
||||
dump_edge_info (stderr, e, 0);
|
||||
fputs ("\nSuccessor: ", stderr);
|
||||
dump_edge_info (stderr, e, 1);
|
||||
fputc ('\n', stderr);
|
||||
err = 1;
|
||||
}
|
||||
|
||||
if (ei.index != e->dest_idx)
|
||||
{
|
||||
error ("basic block %d pred edge is corrupted", bb->index);
|
||||
error ("its dest_idx should be %d, not %d",
|
||||
ei.index, e->dest_idx);
|
||||
fputs ("Predecessor: ", stderr);
|
||||
dump_edge_info (stderr, e, 0);
|
||||
fputs ("\nSuccessor: ", stderr);
|
||||
dump_edge_info (stderr, e, 1);
|
||||
fputc ('\n', stderr);
|
||||
err = 1;
|
||||
}
|
||||
|
||||
edge_checksum[e->dest->index] -= (size_t) e;
|
||||
}
|
||||
}
|
||||
|
||||
/* Complete edge checksumming for ENTRY and EXIT. */
|
||||
{
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
|
||||
FOR_EACH_EDGE (e, ei, ENTRY_BLOCK_PTR->succs)
|
||||
edge_checksum[e->dest->index] += (size_t) e;
|
||||
|
||||
FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds)
|
||||
edge_checksum[e->dest->index] -= (size_t) e;
|
||||
}
|
||||
|
||||
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR, NULL, next_bb)
|
||||
if (edge_checksum[bb->index])
|
||||
{
|
||||
error ("basic block %i edge lists are corrupted", bb->index);
|
||||
err = 1;
|
||||
}
|
||||
|
||||
last_bb_seen = ENTRY_BLOCK_PTR;
|
||||
|
||||
/* Clean up. */
|
||||
free (last_visited);
|
||||
free (edge_checksum);
|
||||
|
||||
if (cfg_hooks->verify_flow_info)
|
||||
err |= cfg_hooks->verify_flow_info ();
|
||||
if (err)
|
||||
internal_error ("verify_flow_info failed");
|
||||
timevar_pop (TV_CFG_VERIFY);
|
||||
}
|
||||
|
||||
/* Print out one basic block. This function takes care of the purely
|
||||
graph related information. The cfg hook for the active representation
|
||||
should dump representation-specific information. */
|
||||
|
||||
void
|
||||
dump_bb (basic_block bb, FILE *outf, int indent)
|
||||
{
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
char *s_indent;
|
||||
|
||||
s_indent = alloca ((size_t) indent + 1);
|
||||
memset (s_indent, ' ', (size_t) indent);
|
||||
s_indent[indent] = '\0';
|
||||
|
||||
fprintf (outf, ";;%s basic block %d, loop depth %d, count ",
|
||||
s_indent, bb->index, bb->loop_depth);
|
||||
fprintf (outf, HOST_WIDEST_INT_PRINT_DEC, (HOST_WIDEST_INT) bb->count);
|
||||
putc ('\n', outf);
|
||||
|
||||
fprintf (outf, ";;%s prev block ", s_indent);
|
||||
if (bb->prev_bb)
|
||||
fprintf (outf, "%d, ", bb->prev_bb->index);
|
||||
else
|
||||
fprintf (outf, "(nil), ");
|
||||
fprintf (outf, "next block ");
|
||||
if (bb->next_bb)
|
||||
fprintf (outf, "%d", bb->next_bb->index);
|
||||
else
|
||||
fprintf (outf, "(nil)");
|
||||
putc ('\n', outf);
|
||||
|
||||
fprintf (outf, ";;%s pred: ", s_indent);
|
||||
FOR_EACH_EDGE (e, ei, bb->preds)
|
||||
dump_edge_info (outf, e, 0);
|
||||
putc ('\n', outf);
|
||||
|
||||
fprintf (outf, ";;%s succ: ", s_indent);
|
||||
FOR_EACH_EDGE (e, ei, bb->succs)
|
||||
dump_edge_info (outf, e, 1);
|
||||
putc ('\n', outf);
|
||||
|
||||
if (cfg_hooks->dump_bb)
|
||||
cfg_hooks->dump_bb (bb, outf, indent);
|
||||
}
|
||||
|
||||
/* Redirect edge E to the given basic block DEST and update underlying program
|
||||
representation. Returns edge representing redirected branch (that may not
|
||||
be equivalent to E in the case of duplicate edges being removed) or NULL
|
||||
if edge is not easily redirectable for whatever reason. */
|
||||
|
||||
edge
|
||||
redirect_edge_and_branch (edge e, basic_block dest)
|
||||
{
|
||||
edge ret;
|
||||
|
||||
if (!cfg_hooks->redirect_edge_and_branch)
|
||||
internal_error ("%s does not support redirect_edge_and_branch",
|
||||
cfg_hooks->name);
|
||||
|
||||
ret = cfg_hooks->redirect_edge_and_branch (e, dest);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Redirect the edge E to basic block DEST even if it requires creating
|
||||
of a new basic block; then it returns the newly created basic block.
|
||||
Aborts when redirection is impossible. */
|
||||
|
||||
basic_block
|
||||
redirect_edge_and_branch_force (edge e, basic_block dest)
|
||||
{
|
||||
basic_block ret;
|
||||
|
||||
if (!cfg_hooks->redirect_edge_and_branch_force)
|
||||
internal_error ("%s does not support redirect_edge_and_branch_force",
|
||||
cfg_hooks->name);
|
||||
|
||||
ret = cfg_hooks->redirect_edge_and_branch_force (e, dest);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Splits basic block BB after the specified instruction I (but at least after
|
||||
the labels). If I is NULL, splits just after labels. The newly created edge
|
||||
is returned. The new basic block is created just after the old one. */
|
||||
|
||||
edge
|
||||
split_block (basic_block bb, void *i)
|
||||
{
|
||||
basic_block new_bb;
|
||||
|
||||
if (!cfg_hooks->split_block)
|
||||
internal_error ("%s does not support split_block", cfg_hooks->name);
|
||||
|
||||
new_bb = cfg_hooks->split_block (bb, i);
|
||||
if (!new_bb)
|
||||
return NULL;
|
||||
|
||||
new_bb->count = bb->count;
|
||||
new_bb->frequency = bb->frequency;
|
||||
new_bb->loop_depth = bb->loop_depth;
|
||||
|
||||
if (dom_info_available_p (CDI_DOMINATORS))
|
||||
{
|
||||
redirect_immediate_dominators (CDI_DOMINATORS, bb, new_bb);
|
||||
set_immediate_dominator (CDI_DOMINATORS, new_bb, bb);
|
||||
}
|
||||
|
||||
return make_single_succ_edge (bb, new_bb, EDGE_FALLTHRU);
|
||||
}
|
||||
|
||||
/* Splits block BB just after labels. The newly created edge is returned. */
|
||||
|
||||
edge
|
||||
split_block_after_labels (basic_block bb)
|
||||
{
|
||||
return split_block (bb, NULL);
|
||||
}
|
||||
|
||||
/* Moves block BB immediately after block AFTER. Returns false if the
|
||||
movement was impossible. */
|
||||
|
||||
bool
|
||||
move_block_after (basic_block bb, basic_block after)
|
||||
{
|
||||
bool ret;
|
||||
|
||||
if (!cfg_hooks->move_block_after)
|
||||
internal_error ("%s does not support move_block_after", cfg_hooks->name);
|
||||
|
||||
ret = cfg_hooks->move_block_after (bb, after);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Deletes the basic block BB. */
|
||||
|
||||
void
|
||||
delete_basic_block (basic_block bb)
|
||||
{
|
||||
if (!cfg_hooks->delete_basic_block)
|
||||
internal_error ("%s does not support delete_basic_block", cfg_hooks->name);
|
||||
|
||||
cfg_hooks->delete_basic_block (bb);
|
||||
|
||||
/* Remove the edges into and out of this block. Note that there may
|
||||
indeed be edges in, if we are removing an unreachable loop. */
|
||||
while (EDGE_COUNT (bb->preds) != 0)
|
||||
remove_edge (EDGE_PRED (bb, 0));
|
||||
while (EDGE_COUNT (bb->succs) != 0)
|
||||
remove_edge (EDGE_SUCC (bb, 0));
|
||||
|
||||
if (dom_computed[CDI_DOMINATORS])
|
||||
delete_from_dominance_info (CDI_DOMINATORS, bb);
|
||||
if (dom_computed[CDI_POST_DOMINATORS])
|
||||
delete_from_dominance_info (CDI_POST_DOMINATORS, bb);
|
||||
|
||||
/* Remove the basic block from the array. */
|
||||
expunge_block (bb);
|
||||
}
|
||||
|
||||
/* Splits edge E and returns the newly created basic block. */
|
||||
|
||||
basic_block
|
||||
split_edge (edge e)
|
||||
{
|
||||
basic_block ret;
|
||||
gcov_type count = e->count;
|
||||
int freq = EDGE_FREQUENCY (e);
|
||||
edge f;
|
||||
bool irr = (e->flags & EDGE_IRREDUCIBLE_LOOP) != 0;
|
||||
|
||||
if (!cfg_hooks->split_edge)
|
||||
internal_error ("%s does not support split_edge", cfg_hooks->name);
|
||||
|
||||
ret = cfg_hooks->split_edge (e);
|
||||
ret->count = count;
|
||||
ret->frequency = freq;
|
||||
single_succ_edge (ret)->probability = REG_BR_PROB_BASE;
|
||||
single_succ_edge (ret)->count = count;
|
||||
|
||||
if (irr)
|
||||
{
|
||||
ret->flags |= BB_IRREDUCIBLE_LOOP;
|
||||
single_pred_edge (ret)->flags |= EDGE_IRREDUCIBLE_LOOP;
|
||||
single_succ_edge (ret)->flags |= EDGE_IRREDUCIBLE_LOOP;
|
||||
}
|
||||
|
||||
if (dom_computed[CDI_DOMINATORS])
|
||||
set_immediate_dominator (CDI_DOMINATORS, ret, single_pred (ret));
|
||||
|
||||
if (dom_computed[CDI_DOMINATORS] >= DOM_NO_FAST_QUERY)
|
||||
{
|
||||
/* There are two cases:
|
||||
|
||||
If the immediate dominator of e->dest is not e->src, it
|
||||
remains unchanged.
|
||||
|
||||
If immediate dominator of e->dest is e->src, it may become
|
||||
ret, provided that all other predecessors of e->dest are
|
||||
dominated by e->dest. */
|
||||
|
||||
if (get_immediate_dominator (CDI_DOMINATORS, single_succ (ret))
|
||||
== single_pred (ret))
|
||||
{
|
||||
edge_iterator ei;
|
||||
FOR_EACH_EDGE (f, ei, single_succ (ret)->preds)
|
||||
{
|
||||
if (f == single_succ_edge (ret))
|
||||
continue;
|
||||
|
||||
if (!dominated_by_p (CDI_DOMINATORS, f->src,
|
||||
single_succ (ret)))
|
||||
break;
|
||||
}
|
||||
|
||||
if (!f)
|
||||
set_immediate_dominator (CDI_DOMINATORS, single_succ (ret), ret);
|
||||
}
|
||||
};
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Creates a new basic block just after the basic block AFTER.
|
||||
HEAD and END are the first and the last statement belonging
|
||||
to the block. If both are NULL, an empty block is created. */
|
||||
|
||||
basic_block
|
||||
create_basic_block (void *head, void *end, basic_block after)
|
||||
{
|
||||
basic_block ret;
|
||||
|
||||
if (!cfg_hooks->create_basic_block)
|
||||
internal_error ("%s does not support create_basic_block", cfg_hooks->name);
|
||||
|
||||
ret = cfg_hooks->create_basic_block (head, end, after);
|
||||
|
||||
if (dom_computed[CDI_DOMINATORS])
|
||||
add_to_dominance_info (CDI_DOMINATORS, ret);
|
||||
if (dom_computed[CDI_POST_DOMINATORS])
|
||||
add_to_dominance_info (CDI_POST_DOMINATORS, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Creates an empty basic block just after basic block AFTER. */
|
||||
|
||||
basic_block
|
||||
create_empty_bb (basic_block after)
|
||||
{
|
||||
return create_basic_block (NULL, NULL, after);
|
||||
}
|
||||
|
||||
/* Checks whether we may merge blocks BB1 and BB2. */
|
||||
|
||||
bool
|
||||
can_merge_blocks_p (basic_block bb1, basic_block bb2)
|
||||
{
|
||||
bool ret;
|
||||
|
||||
if (!cfg_hooks->can_merge_blocks_p)
|
||||
internal_error ("%s does not support can_merge_blocks_p", cfg_hooks->name);
|
||||
|
||||
ret = cfg_hooks->can_merge_blocks_p (bb1, bb2);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
predict_edge (edge e, enum br_predictor predictor, int probability)
|
||||
{
|
||||
if (!cfg_hooks->predict_edge)
|
||||
internal_error ("%s does not support predict_edge", cfg_hooks->name);
|
||||
|
||||
cfg_hooks->predict_edge (e, predictor, probability);
|
||||
}
|
||||
|
||||
bool
|
||||
predicted_by_p (basic_block bb, enum br_predictor predictor)
|
||||
{
|
||||
if (!cfg_hooks->predict_edge)
|
||||
internal_error ("%s does not support predicted_by_p", cfg_hooks->name);
|
||||
|
||||
return cfg_hooks->predicted_by_p (bb, predictor);
|
||||
}
|
||||
|
||||
/* Merges basic block B into basic block A. */
|
||||
|
||||
void
|
||||
merge_blocks (basic_block a, basic_block b)
|
||||
{
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
|
||||
if (!cfg_hooks->merge_blocks)
|
||||
internal_error ("%s does not support merge_blocks", cfg_hooks->name);
|
||||
|
||||
cfg_hooks->merge_blocks (a, b);
|
||||
|
||||
/* Normally there should only be one successor of A and that is B, but
|
||||
partway though the merge of blocks for conditional_execution we'll
|
||||
be merging a TEST block with THEN and ELSE successors. Free the
|
||||
whole lot of them and hope the caller knows what they're doing. */
|
||||
|
||||
while (EDGE_COUNT (a->succs) != 0)
|
||||
remove_edge (EDGE_SUCC (a, 0));
|
||||
|
||||
/* Adjust the edges out of B for the new owner. */
|
||||
FOR_EACH_EDGE (e, ei, b->succs)
|
||||
e->src = a;
|
||||
a->succs = b->succs;
|
||||
a->flags |= b->flags;
|
||||
|
||||
/* B hasn't quite yet ceased to exist. Attempt to prevent mishap. */
|
||||
b->preds = b->succs = NULL;
|
||||
|
||||
if (dom_computed[CDI_DOMINATORS])
|
||||
redirect_immediate_dominators (CDI_DOMINATORS, b, a);
|
||||
|
||||
if (dom_computed[CDI_DOMINATORS])
|
||||
delete_from_dominance_info (CDI_DOMINATORS, b);
|
||||
if (dom_computed[CDI_POST_DOMINATORS])
|
||||
delete_from_dominance_info (CDI_POST_DOMINATORS, b);
|
||||
|
||||
expunge_block (b);
|
||||
}
|
||||
|
||||
/* Split BB into entry part and the rest (the rest is the newly created block).
|
||||
Redirect those edges for that REDIRECT_EDGE_P returns true to the entry
|
||||
part. Returns the edge connecting the entry part to the rest. */
|
||||
|
||||
edge
|
||||
make_forwarder_block (basic_block bb, bool (*redirect_edge_p) (edge),
|
||||
void (*new_bb_cbk) (basic_block))
|
||||
{
|
||||
edge e, fallthru;
|
||||
edge_iterator ei;
|
||||
basic_block dummy, jump;
|
||||
|
||||
if (!cfg_hooks->make_forwarder_block)
|
||||
internal_error ("%s does not support make_forwarder_block",
|
||||
cfg_hooks->name);
|
||||
|
||||
fallthru = split_block_after_labels (bb);
|
||||
dummy = fallthru->src;
|
||||
bb = fallthru->dest;
|
||||
|
||||
/* Redirect back edges we want to keep. */
|
||||
for (ei = ei_start (dummy->preds); (e = ei_safe_edge (ei)); )
|
||||
{
|
||||
if (redirect_edge_p (e))
|
||||
{
|
||||
ei_next (&ei);
|
||||
continue;
|
||||
}
|
||||
|
||||
dummy->frequency -= EDGE_FREQUENCY (e);
|
||||
dummy->count -= e->count;
|
||||
if (dummy->frequency < 0)
|
||||
dummy->frequency = 0;
|
||||
if (dummy->count < 0)
|
||||
dummy->count = 0;
|
||||
fallthru->count -= e->count;
|
||||
if (fallthru->count < 0)
|
||||
fallthru->count = 0;
|
||||
|
||||
jump = redirect_edge_and_branch_force (e, bb);
|
||||
if (jump)
|
||||
new_bb_cbk (jump);
|
||||
}
|
||||
|
||||
if (dom_info_available_p (CDI_DOMINATORS))
|
||||
{
|
||||
basic_block doms_to_fix[2];
|
||||
|
||||
doms_to_fix[0] = dummy;
|
||||
doms_to_fix[1] = bb;
|
||||
iterate_fix_dominators (CDI_DOMINATORS, doms_to_fix, 2);
|
||||
}
|
||||
|
||||
cfg_hooks->make_forwarder_block (fallthru);
|
||||
|
||||
return fallthru;
|
||||
}
|
||||
|
||||
void
|
||||
tidy_fallthru_edge (edge e)
|
||||
{
|
||||
if (cfg_hooks->tidy_fallthru_edge)
|
||||
cfg_hooks->tidy_fallthru_edge (e);
|
||||
}
|
||||
|
||||
/* Fix up edges that now fall through, or rather should now fall through
|
||||
but previously required a jump around now deleted blocks. Simplify
|
||||
the search by only examining blocks numerically adjacent, since this
|
||||
is how find_basic_blocks created them. */
|
||||
|
||||
void
|
||||
tidy_fallthru_edges (void)
|
||||
{
|
||||
basic_block b, c;
|
||||
|
||||
if (!cfg_hooks->tidy_fallthru_edge)
|
||||
return;
|
||||
|
||||
if (ENTRY_BLOCK_PTR->next_bb == EXIT_BLOCK_PTR)
|
||||
return;
|
||||
|
||||
FOR_BB_BETWEEN (b, ENTRY_BLOCK_PTR->next_bb, EXIT_BLOCK_PTR->prev_bb, next_bb)
|
||||
{
|
||||
edge s;
|
||||
|
||||
c = b->next_bb;
|
||||
|
||||
/* We care about simple conditional or unconditional jumps with
|
||||
a single successor.
|
||||
|
||||
If we had a conditional branch to the next instruction when
|
||||
find_basic_blocks was called, then there will only be one
|
||||
out edge for the block which ended with the conditional
|
||||
branch (since we do not create duplicate edges).
|
||||
|
||||
Furthermore, the edge will be marked as a fallthru because we
|
||||
merge the flags for the duplicate edges. So we do not want to
|
||||
check that the edge is not a FALLTHRU edge. */
|
||||
|
||||
if (single_succ_p (b))
|
||||
{
|
||||
s = single_succ_edge (b);
|
||||
if (! (s->flags & EDGE_COMPLEX)
|
||||
&& s->dest == c
|
||||
&& !find_reg_note (BB_END (b), REG_CROSSING_JUMP, NULL_RTX))
|
||||
tidy_fallthru_edge (s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Returns true if we can duplicate basic block BB. */
|
||||
|
||||
bool
|
||||
can_duplicate_block_p (basic_block bb)
|
||||
{
|
||||
edge e;
|
||||
|
||||
if (!cfg_hooks->can_duplicate_block_p)
|
||||
internal_error ("%s does not support can_duplicate_block_p",
|
||||
cfg_hooks->name);
|
||||
|
||||
if (bb == EXIT_BLOCK_PTR || bb == ENTRY_BLOCK_PTR)
|
||||
return false;
|
||||
|
||||
/* Duplicating fallthru block to exit would require adding a jump
|
||||
and splitting the real last BB. */
|
||||
e = find_edge (bb, EXIT_BLOCK_PTR);
|
||||
if (e && (e->flags & EDGE_FALLTHRU))
|
||||
return false;
|
||||
|
||||
return cfg_hooks->can_duplicate_block_p (bb);
|
||||
}
|
||||
|
||||
/* Duplicates basic block BB and redirects edge E to it. Returns the
|
||||
new basic block. The new basic block is placed after the basic block
|
||||
AFTER. */
|
||||
|
||||
basic_block
|
||||
duplicate_block (basic_block bb, edge e, basic_block after)
|
||||
{
|
||||
edge s, n;
|
||||
basic_block new_bb;
|
||||
gcov_type new_count = e ? e->count : 0;
|
||||
edge_iterator ei;
|
||||
|
||||
if (!cfg_hooks->duplicate_block)
|
||||
internal_error ("%s does not support duplicate_block",
|
||||
cfg_hooks->name);
|
||||
|
||||
if (bb->count < new_count)
|
||||
new_count = bb->count;
|
||||
|
||||
#ifdef ENABLE_CHECKING
|
||||
gcc_assert (can_duplicate_block_p (bb));
|
||||
#endif
|
||||
|
||||
new_bb = cfg_hooks->duplicate_block (bb);
|
||||
if (after)
|
||||
move_block_after (new_bb, after);
|
||||
|
||||
new_bb->loop_depth = bb->loop_depth;
|
||||
new_bb->flags = bb->flags;
|
||||
FOR_EACH_EDGE (s, ei, bb->succs)
|
||||
{
|
||||
/* Since we are creating edges from a new block to successors
|
||||
of another block (which therefore are known to be disjoint), there
|
||||
is no need to actually check for duplicated edges. */
|
||||
n = unchecked_make_edge (new_bb, s->dest, s->flags);
|
||||
n->probability = s->probability;
|
||||
if (e && bb->count)
|
||||
{
|
||||
/* Take care for overflows! */
|
||||
n->count = s->count * (new_count * 10000 / bb->count) / 10000;
|
||||
s->count -= n->count;
|
||||
}
|
||||
else
|
||||
n->count = s->count;
|
||||
n->aux = s->aux;
|
||||
}
|
||||
|
||||
if (e)
|
||||
{
|
||||
new_bb->count = new_count;
|
||||
bb->count -= new_count;
|
||||
|
||||
new_bb->frequency = EDGE_FREQUENCY (e);
|
||||
bb->frequency -= EDGE_FREQUENCY (e);
|
||||
|
||||
redirect_edge_and_branch_force (e, new_bb);
|
||||
|
||||
if (bb->count < 0)
|
||||
bb->count = 0;
|
||||
if (bb->frequency < 0)
|
||||
bb->frequency = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
new_bb->count = bb->count;
|
||||
new_bb->frequency = bb->frequency;
|
||||
}
|
||||
|
||||
set_bb_original (new_bb, bb);
|
||||
set_bb_copy (bb, new_bb);
|
||||
|
||||
return new_bb;
|
||||
}
|
||||
|
||||
/* Return 1 if BB ends with a call, possibly followed by some
|
||||
instructions that must stay with the call, 0 otherwise. */
|
||||
|
||||
bool
|
||||
block_ends_with_call_p (basic_block bb)
|
||||
{
|
||||
if (!cfg_hooks->block_ends_with_call_p)
|
||||
internal_error ("%s does not support block_ends_with_call_p", cfg_hooks->name);
|
||||
|
||||
return (cfg_hooks->block_ends_with_call_p) (bb);
|
||||
}
|
||||
|
||||
/* Return 1 if BB ends with a conditional branch, 0 otherwise. */
|
||||
|
||||
bool
|
||||
block_ends_with_condjump_p (basic_block bb)
|
||||
{
|
||||
if (!cfg_hooks->block_ends_with_condjump_p)
|
||||
internal_error ("%s does not support block_ends_with_condjump_p",
|
||||
cfg_hooks->name);
|
||||
|
||||
return (cfg_hooks->block_ends_with_condjump_p) (bb);
|
||||
}
|
||||
|
||||
/* Add fake edges to the function exit for any non constant and non noreturn
|
||||
calls, volatile inline assembly in the bitmap of blocks specified by
|
||||
BLOCKS or to the whole CFG if BLOCKS is zero. Return the number of blocks
|
||||
that were split.
|
||||
|
||||
The goal is to expose cases in which entering a basic block does not imply
|
||||
that all subsequent instructions must be executed. */
|
||||
|
||||
int
|
||||
flow_call_edges_add (sbitmap blocks)
|
||||
{
|
||||
if (!cfg_hooks->flow_call_edges_add)
|
||||
internal_error ("%s does not support flow_call_edges_add",
|
||||
cfg_hooks->name);
|
||||
|
||||
return (cfg_hooks->flow_call_edges_add) (blocks);
|
||||
}
|
||||
|
||||
/* This function is called immediately after edge E is added to the
|
||||
edge vector E->dest->preds. */
|
||||
|
||||
void
|
||||
execute_on_growing_pred (edge e)
|
||||
{
|
||||
if (cfg_hooks->execute_on_growing_pred)
|
||||
cfg_hooks->execute_on_growing_pred (e);
|
||||
}
|
||||
|
||||
/* This function is called immediately before edge E is removed from
|
||||
the edge vector E->dest->preds. */
|
||||
|
||||
void
|
||||
execute_on_shrinking_pred (edge e)
|
||||
{
|
||||
if (cfg_hooks->execute_on_shrinking_pred)
|
||||
cfg_hooks->execute_on_shrinking_pred (e);
|
||||
}
|
||||
|
||||
/* This is used inside loop versioning when we want to insert
|
||||
stmts/insns on the edges, which have a different behavior
|
||||
in tree's and in RTL, so we made a CFG hook. */
|
||||
void
|
||||
lv_flush_pending_stmts (edge e)
|
||||
{
|
||||
if (cfg_hooks->flush_pending_stmts)
|
||||
cfg_hooks->flush_pending_stmts (e);
|
||||
}
|
||||
|
||||
/* Loop versioning uses the duplicate_loop_to_header_edge to create
|
||||
a new version of the loop basic-blocks, the parameters here are
|
||||
exactly the same as in duplicate_loop_to_header_edge or
|
||||
tree_duplicate_loop_to_header_edge; while in tree-ssa there is
|
||||
additional work to maintain ssa information that's why there is
|
||||
a need to call the tree_duplicate_loop_to_header_edge rather
|
||||
than duplicate_loop_to_header_edge when we are in tree mode. */
|
||||
bool
|
||||
cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge e,
|
||||
struct loops *loops, unsigned int ndupl,
|
||||
sbitmap wont_exit, edge orig,
|
||||
edge *to_remove,
|
||||
unsigned int *n_to_remove, int flags)
|
||||
{
|
||||
gcc_assert (cfg_hooks->cfg_hook_duplicate_loop_to_header_edge);
|
||||
return cfg_hooks->cfg_hook_duplicate_loop_to_header_edge (loop, e, loops,
|
||||
ndupl, wont_exit,
|
||||
orig, to_remove,
|
||||
n_to_remove, flags);
|
||||
}
|
||||
|
||||
/* Conditional jumps are represented differently in trees and RTL,
|
||||
this hook takes a basic block that is known to have a cond jump
|
||||
at its end and extracts the taken and not taken eges out of it
|
||||
and store it in E1 and E2 respectively. */
|
||||
void
|
||||
extract_cond_bb_edges (basic_block b, edge *e1, edge *e2)
|
||||
{
|
||||
gcc_assert (cfg_hooks->extract_cond_bb_edges);
|
||||
cfg_hooks->extract_cond_bb_edges (b, e1, e2);
|
||||
}
|
||||
|
||||
/* Responsible for updating the ssa info (PHI nodes) on the
|
||||
new condition basic block that guards the versioned loop. */
|
||||
void
|
||||
lv_adjust_loop_header_phi (basic_block first, basic_block second,
|
||||
basic_block new, edge e)
|
||||
{
|
||||
if (cfg_hooks->lv_adjust_loop_header_phi)
|
||||
cfg_hooks->lv_adjust_loop_header_phi (first, second, new, e);
|
||||
}
|
||||
|
||||
/* Conditions in trees and RTL are different so we need
|
||||
a different handling when we add the condition to the
|
||||
versioning code. */
|
||||
void
|
||||
lv_add_condition_to_bb (basic_block first, basic_block second,
|
||||
basic_block new, void *cond)
|
||||
{
|
||||
gcc_assert (cfg_hooks->lv_add_condition_to_bb);
|
||||
cfg_hooks->lv_add_condition_to_bb (first, second, new, cond);
|
||||
}
|
@ -1,192 +0,0 @@
|
||||
/* Hooks for cfg representation specific functions.
|
||||
Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
Contributed by Sebastian Pop <s.pop@laposte.net>
|
||||
|
||||
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 2, 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 COPYING. If not, write to
|
||||
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef GCC_CFGHOOKS_H
|
||||
#define GCC_CFGHOOKS_H
|
||||
|
||||
struct cfg_hooks
|
||||
{
|
||||
/* Name of the corresponding ir. */
|
||||
const char *name;
|
||||
|
||||
/* Debugging. */
|
||||
int (*verify_flow_info) (void);
|
||||
void (*dump_bb) (basic_block, FILE *, int);
|
||||
|
||||
/* Basic CFG manipulation. */
|
||||
|
||||
/* Return new basic block. */
|
||||
basic_block (*create_basic_block) (void *head, void *end, basic_block after);
|
||||
|
||||
/* Redirect edge E to the given basic block B and update underlying program
|
||||
representation. Returns edge representing redirected branch (that may not
|
||||
be equivalent to E in the case of duplicate edges being removed) or NULL
|
||||
if edge is not easily redirectable for whatever reason. */
|
||||
edge (*redirect_edge_and_branch) (edge e, basic_block b);
|
||||
|
||||
/* Same as the above but allows redirecting of fallthru edges. In that case
|
||||
newly created forwarder basic block is returned. The edge must
|
||||
not be abnormal. */
|
||||
basic_block (*redirect_edge_and_branch_force) (edge, basic_block);
|
||||
|
||||
/* Remove statements corresponding to a given basic block. */
|
||||
void (*delete_basic_block) (basic_block);
|
||||
|
||||
/* Creates a new basic block just after basic block B by splitting
|
||||
everything after specified instruction I. */
|
||||
basic_block (*split_block) (basic_block b, void * i);
|
||||
|
||||
/* Move block B immediately after block A. */
|
||||
bool (*move_block_after) (basic_block b, basic_block a);
|
||||
|
||||
/* Return true when blocks A and B can be merged into single basic block. */
|
||||
bool (*can_merge_blocks_p) (basic_block a, basic_block b);
|
||||
|
||||
/* Merge blocks A and B. */
|
||||
void (*merge_blocks) (basic_block a, basic_block b);
|
||||
|
||||
/* Predict edge E using PREDICTOR to given PROBABILITY. */
|
||||
void (*predict_edge) (edge e, enum br_predictor predictor, int probability);
|
||||
|
||||
/* Return true if the one of outgoing edges is already predicted by
|
||||
PREDICTOR. */
|
||||
bool (*predicted_by_p) (basic_block bb, enum br_predictor predictor);
|
||||
|
||||
/* Return true when block A can be duplicated. */
|
||||
bool (*can_duplicate_block_p) (basic_block a);
|
||||
|
||||
/* Duplicate block A. */
|
||||
basic_block (*duplicate_block) (basic_block a);
|
||||
|
||||
/* Higher level functions representable by primitive operations above if
|
||||
we didn't have some oddities in RTL and Tree representations. */
|
||||
basic_block (*split_edge) (edge);
|
||||
void (*make_forwarder_block) (edge);
|
||||
|
||||
/* Tries to make the edge fallthru. */
|
||||
void (*tidy_fallthru_edge) (edge);
|
||||
|
||||
/* Say whether a block ends with a call, possibly followed by some
|
||||
other code that must stay with the call. */
|
||||
bool (*block_ends_with_call_p) (basic_block);
|
||||
|
||||
/* Say whether a block ends with a conditional branch. Switches
|
||||
and unconditional branches do not qualify. */
|
||||
bool (*block_ends_with_condjump_p) (basic_block);
|
||||
|
||||
/* Add fake edges to the function exit for any non constant and non noreturn
|
||||
calls, volatile inline assembly in the bitmap of blocks specified by
|
||||
BLOCKS or to the whole CFG if BLOCKS is zero. Return the number of blocks
|
||||
that were split.
|
||||
|
||||
The goal is to expose cases in which entering a basic block does not imply
|
||||
that all subsequent instructions must be executed. */
|
||||
int (*flow_call_edges_add) (sbitmap);
|
||||
|
||||
/* This function is called immediately after edge E is added to the
|
||||
edge vector E->dest->preds. */
|
||||
void (*execute_on_growing_pred) (edge);
|
||||
|
||||
/* This function is called immediately before edge E is removed from
|
||||
the edge vector E->dest->preds. */
|
||||
void (*execute_on_shrinking_pred) (edge);
|
||||
|
||||
/* A hook for duplicating loop in CFG, currently this is used
|
||||
in loop versioning. */
|
||||
bool (*cfg_hook_duplicate_loop_to_header_edge) (struct loop *loop, edge e,
|
||||
struct loops *loops,
|
||||
unsigned int ndupl,
|
||||
sbitmap wont_exit,
|
||||
edge orig, edge *to_remove,
|
||||
unsigned int *n_to_remove,
|
||||
int flags);
|
||||
|
||||
/* Add condition to new basic block and update CFG used in loop
|
||||
versioning. */
|
||||
void (*lv_add_condition_to_bb) (basic_block, basic_block, basic_block,
|
||||
void *);
|
||||
/* Update the PHI nodes in case of loop versioning. */
|
||||
void (*lv_adjust_loop_header_phi) (basic_block, basic_block,
|
||||
basic_block, edge);
|
||||
|
||||
/* Given a condition BB extract the true/false taken/not taken edges
|
||||
(depending if we are on tree's or RTL). */
|
||||
void (*extract_cond_bb_edges) (basic_block, edge *, edge *);
|
||||
|
||||
|
||||
/* Add PHI arguments queued in PENDINT_STMT list on edge E to edge
|
||||
E->dest (only in tree-ssa loop versioning. */
|
||||
void (*flush_pending_stmts) (edge);
|
||||
};
|
||||
|
||||
extern void verify_flow_info (void);
|
||||
extern void dump_bb (basic_block, FILE *, int);
|
||||
extern edge redirect_edge_and_branch (edge, basic_block);
|
||||
extern basic_block redirect_edge_and_branch_force (edge, basic_block);
|
||||
extern edge split_block (basic_block, void *);
|
||||
extern edge split_block_after_labels (basic_block);
|
||||
extern bool move_block_after (basic_block, basic_block);
|
||||
extern void delete_basic_block (basic_block);
|
||||
extern basic_block split_edge (edge);
|
||||
extern basic_block create_basic_block (void *, void *, basic_block);
|
||||
extern basic_block create_empty_bb (basic_block);
|
||||
extern bool can_merge_blocks_p (basic_block, basic_block);
|
||||
extern void merge_blocks (basic_block, basic_block);
|
||||
extern edge make_forwarder_block (basic_block, bool (*)(edge),
|
||||
void (*) (basic_block));
|
||||
extern void tidy_fallthru_edge (edge);
|
||||
extern void tidy_fallthru_edges (void);
|
||||
extern void predict_edge (edge e, enum br_predictor predictor, int probability);
|
||||
extern bool predicted_by_p (basic_block bb, enum br_predictor predictor);
|
||||
extern bool can_duplicate_block_p (basic_block);
|
||||
extern basic_block duplicate_block (basic_block, edge, basic_block);
|
||||
extern bool block_ends_with_call_p (basic_block bb);
|
||||
extern bool block_ends_with_condjump_p (basic_block bb);
|
||||
extern int flow_call_edges_add (sbitmap);
|
||||
extern void execute_on_growing_pred (edge);
|
||||
extern void execute_on_shrinking_pred (edge);
|
||||
extern bool cfg_hook_duplicate_loop_to_header_edge (struct loop *loop, edge,
|
||||
struct loops *loops,
|
||||
unsigned int ndupl,
|
||||
sbitmap wont_exit,
|
||||
edge orig, edge *to_remove,
|
||||
unsigned int *n_to_remove,
|
||||
int flags);
|
||||
|
||||
extern void lv_flush_pending_stmts (edge);
|
||||
extern void extract_cond_bb_edges (basic_block, edge *, edge*);
|
||||
extern void lv_adjust_loop_header_phi (basic_block, basic_block, basic_block,
|
||||
edge);
|
||||
extern void lv_add_condition_to_bb (basic_block, basic_block, basic_block,
|
||||
void *);
|
||||
|
||||
/* Hooks containers. */
|
||||
extern struct cfg_hooks tree_cfg_hooks;
|
||||
extern struct cfg_hooks rtl_cfg_hooks;
|
||||
extern struct cfg_hooks cfg_layout_rtl_cfg_hooks;
|
||||
|
||||
/* Declarations. */
|
||||
extern int ir_type (void);
|
||||
extern void rtl_register_cfg_hooks (void);
|
||||
extern void cfg_layout_rtl_register_cfg_hooks (void);
|
||||
extern void tree_register_cfg_hooks (void);
|
||||
|
||||
#endif /* GCC_CFGHOOKS_H */
|
File diff suppressed because it is too large
Load Diff
@ -1,38 +0,0 @@
|
||||
/* Basic block reordering routines for the GNU compiler.
|
||||
Copyright (C) 2000, 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifndef GCC_CFGLAYOUT_H
|
||||
#define GCC_CFGLAYOUT_H
|
||||
|
||||
#include "basic-block.h"
|
||||
|
||||
extern rtx cfg_layout_function_footer;
|
||||
|
||||
extern void cfg_layout_initialize (unsigned int);
|
||||
extern void cfg_layout_finalize (void);
|
||||
extern unsigned int insn_locators_initialize (void);
|
||||
extern void reemit_insn_block_notes (void);
|
||||
extern bool can_copy_bbs_p (basic_block *, unsigned);
|
||||
extern void copy_bbs (basic_block *, unsigned, basic_block *,
|
||||
edge *, unsigned, edge *, struct loop *,
|
||||
basic_block);
|
||||
extern rtx duplicate_insn_chain (rtx, rtx);
|
||||
|
||||
#endif /* GCC_CFGLAYOUT_H */
|
File diff suppressed because it is too large
Load Diff
@ -1,403 +0,0 @@
|
||||
/* Natural loop functions
|
||||
Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#ifndef GCC_CFGLOOP_H
|
||||
#define GCC_CFGLOOP_H
|
||||
|
||||
#include "basic-block.h"
|
||||
/* For rtx_code. */
|
||||
#include "rtl.h"
|
||||
|
||||
/* Structure to hold decision about unrolling/peeling. */
|
||||
enum lpt_dec
|
||||
{
|
||||
LPT_NONE,
|
||||
LPT_PEEL_COMPLETELY,
|
||||
LPT_PEEL_SIMPLE,
|
||||
LPT_UNROLL_CONSTANT,
|
||||
LPT_UNROLL_RUNTIME,
|
||||
LPT_UNROLL_STUPID
|
||||
};
|
||||
|
||||
struct lpt_decision
|
||||
{
|
||||
enum lpt_dec decision;
|
||||
unsigned times;
|
||||
};
|
||||
|
||||
/* The structure describing a bound on number of iterations of a loop. */
|
||||
|
||||
struct nb_iter_bound
|
||||
{
|
||||
tree bound; /* The constant expression whose value is an upper
|
||||
bound on the number of executions of ... */
|
||||
tree at_stmt; /* ... this statement during one execution of
|
||||
a loop. */
|
||||
struct nb_iter_bound *next;
|
||||
/* The next bound in a list. */
|
||||
};
|
||||
|
||||
/* Structure to hold information for each natural loop. */
|
||||
struct loop
|
||||
{
|
||||
/* Index into loops array. */
|
||||
int num;
|
||||
|
||||
/* Basic block of loop header. */
|
||||
basic_block header;
|
||||
|
||||
/* Basic block of loop latch. */
|
||||
basic_block latch;
|
||||
|
||||
/* For loop unrolling/peeling decision. */
|
||||
struct lpt_decision lpt_decision;
|
||||
|
||||
/* Number of loop insns. */
|
||||
unsigned ninsns;
|
||||
|
||||
/* Average number of executed insns per iteration. */
|
||||
unsigned av_ninsns;
|
||||
|
||||
/* Number of blocks contained within the loop. */
|
||||
unsigned num_nodes;
|
||||
|
||||
/* The loop nesting depth. */
|
||||
int depth;
|
||||
|
||||
/* Superloops of the loop. */
|
||||
struct loop **pred;
|
||||
|
||||
/* The height of the loop (enclosed loop levels) within the loop
|
||||
hierarchy tree. */
|
||||
int level;
|
||||
|
||||
/* The outer (parent) loop or NULL if outermost loop. */
|
||||
struct loop *outer;
|
||||
|
||||
/* The first inner (child) loop or NULL if innermost loop. */
|
||||
struct loop *inner;
|
||||
|
||||
/* Link to the next (sibling) loop. */
|
||||
struct loop *next;
|
||||
|
||||
/* Loop that is copy of this loop. */
|
||||
struct loop *copy;
|
||||
|
||||
/* Auxiliary info specific to a pass. */
|
||||
void *aux;
|
||||
|
||||
/* The probable number of times the loop is executed at runtime.
|
||||
This is an INTEGER_CST or an expression containing symbolic
|
||||
names. Don't access this field directly:
|
||||
number_of_iterations_in_loop computes and caches the computed
|
||||
information in this field. */
|
||||
tree nb_iterations;
|
||||
|
||||
/* An INTEGER_CST estimation of the number of iterations. NULL_TREE
|
||||
if there is no estimation. */
|
||||
tree estimated_nb_iterations;
|
||||
|
||||
/* Upper bound on number of iterations of a loop. */
|
||||
struct nb_iter_bound *bounds;
|
||||
|
||||
/* If not NULL, loop has just single exit edge stored here (edges to the
|
||||
EXIT_BLOCK_PTR do not count. */
|
||||
edge single_exit;
|
||||
|
||||
/* True when the loop does not carry data dependences, and
|
||||
consequently the iterations can be executed in any order. False
|
||||
when the loop carries data dependences, or when the property is
|
||||
not decidable. */
|
||||
bool parallel_p;
|
||||
};
|
||||
|
||||
/* Flags for state of loop structure. */
|
||||
enum
|
||||
{
|
||||
LOOPS_HAVE_PREHEADERS = 1,
|
||||
LOOPS_HAVE_SIMPLE_LATCHES = 2,
|
||||
LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS = 4,
|
||||
LOOPS_HAVE_MARKED_SINGLE_EXITS = 8
|
||||
};
|
||||
|
||||
#define LOOPS_NORMAL (LOOPS_HAVE_PREHEADERS | LOOPS_HAVE_SIMPLE_LATCHES \
|
||||
| LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS)
|
||||
|
||||
/* Structure to hold CFG information about natural loops within a function. */
|
||||
struct loops
|
||||
{
|
||||
/* Number of natural loops in the function. */
|
||||
unsigned num;
|
||||
|
||||
/* State of loops. */
|
||||
int state;
|
||||
|
||||
/* We store just pointers to loops here.
|
||||
Note that a loop in this array may actually be NULL, if the loop
|
||||
has been removed and the entire loops structure has not been
|
||||
recomputed since that time. */
|
||||
struct loop **parray;
|
||||
|
||||
/* Pointer to root of loop hierarchy tree. */
|
||||
struct loop *tree_root;
|
||||
|
||||
/* Information derived from the CFG. */
|
||||
struct cfg
|
||||
{
|
||||
/* The ordering of the basic blocks in a depth first search. */
|
||||
int *dfs_order;
|
||||
|
||||
/* The reverse completion ordering of the basic blocks found in a
|
||||
depth first search. */
|
||||
int *rc_order;
|
||||
} cfg;
|
||||
|
||||
/* Headers shared by multiple loops that should be merged. */
|
||||
sbitmap shared_headers;
|
||||
};
|
||||
|
||||
/* The loop tree currently optimized. */
|
||||
|
||||
extern struct loops *current_loops;
|
||||
|
||||
/* Loop recognition. */
|
||||
extern int flow_loops_find (struct loops *);
|
||||
extern void flow_loops_free (struct loops *);
|
||||
extern void flow_loops_dump (const struct loops *, FILE *,
|
||||
void (*)(const struct loop *, FILE *, int), int);
|
||||
extern void flow_loop_dump (const struct loop *, FILE *,
|
||||
void (*)(const struct loop *, FILE *, int), int);
|
||||
extern void flow_loop_free (struct loop *);
|
||||
int flow_loop_nodes_find (basic_block, struct loop *);
|
||||
void fix_loop_structure (struct loops *, bitmap changed_bbs);
|
||||
void mark_irreducible_loops (struct loops *);
|
||||
void mark_single_exit_loops (struct loops *);
|
||||
|
||||
/* Loop data structure manipulation/querying. */
|
||||
extern void flow_loop_tree_node_add (struct loop *, struct loop *);
|
||||
extern void flow_loop_tree_node_remove (struct loop *);
|
||||
extern bool flow_loop_nested_p (const struct loop *, const struct loop *);
|
||||
extern bool flow_bb_inside_loop_p (const struct loop *, const basic_block);
|
||||
extern struct loop * find_common_loop (struct loop *, struct loop *);
|
||||
struct loop *superloop_at_depth (struct loop *, unsigned);
|
||||
extern unsigned tree_num_loop_insns (struct loop *);
|
||||
extern int num_loop_insns (struct loop *);
|
||||
extern int average_num_loop_insns (struct loop *);
|
||||
extern unsigned get_loop_level (const struct loop *);
|
||||
extern bool loop_exit_edge_p (const struct loop *, edge);
|
||||
extern void mark_loop_exit_edges (struct loops *);
|
||||
|
||||
/* Loops & cfg manipulation. */
|
||||
extern basic_block *get_loop_body (const struct loop *);
|
||||
extern basic_block *get_loop_body_in_dom_order (const struct loop *);
|
||||
extern basic_block *get_loop_body_in_bfs_order (const struct loop *);
|
||||
extern edge *get_loop_exit_edges (const struct loop *, unsigned *);
|
||||
extern unsigned num_loop_branches (const struct loop *);
|
||||
|
||||
extern edge loop_preheader_edge (const struct loop *);
|
||||
extern edge loop_latch_edge (const struct loop *);
|
||||
|
||||
extern void add_bb_to_loop (basic_block, struct loop *);
|
||||
extern void remove_bb_from_loops (basic_block);
|
||||
|
||||
extern void cancel_loop_tree (struct loops *, struct loop *);
|
||||
|
||||
extern basic_block loop_split_edge_with (edge, rtx);
|
||||
extern int fix_loop_placement (struct loop *);
|
||||
|
||||
enum
|
||||
{
|
||||
CP_SIMPLE_PREHEADERS = 1
|
||||
};
|
||||
|
||||
extern void create_preheaders (struct loops *, int);
|
||||
extern void force_single_succ_latches (struct loops *);
|
||||
|
||||
extern void verify_loop_structure (struct loops *);
|
||||
|
||||
/* Loop analysis. */
|
||||
extern bool just_once_each_iteration_p (const struct loop *, basic_block);
|
||||
extern unsigned expected_loop_iterations (const struct loop *);
|
||||
extern rtx doloop_condition_get (rtx);
|
||||
|
||||
/* Loop manipulation. */
|
||||
extern bool can_duplicate_loop_p (struct loop *loop);
|
||||
|
||||
#define DLTHE_FLAG_UPDATE_FREQ 1 /* Update frequencies in
|
||||
duplicate_loop_to_header_edge. */
|
||||
#define DLTHE_RECORD_COPY_NUMBER 2 /* Record copy number in the aux
|
||||
field of newly create BB. */
|
||||
#define DLTHE_FLAG_COMPLETTE_PEEL 4 /* Update frequencies expecting
|
||||
a complete peeling. */
|
||||
|
||||
extern struct loop * duplicate_loop (struct loops *, struct loop *,
|
||||
struct loop *);
|
||||
extern bool duplicate_loop_to_header_edge (struct loop *, edge, struct loops *,
|
||||
unsigned, sbitmap, edge, edge *,
|
||||
unsigned *, int);
|
||||
extern struct loop *loopify (struct loops *, edge, edge,
|
||||
basic_block, edge, edge, bool);
|
||||
struct loop * loop_version (struct loops *, struct loop *, void *,
|
||||
basic_block *, bool);
|
||||
extern bool remove_path (struct loops *, edge);
|
||||
|
||||
/* Induction variable analysis. */
|
||||
|
||||
/* The description of induction variable. The things are a bit complicated
|
||||
due to need to handle subregs and extends. The value of the object described
|
||||
by it can be obtained as follows (all computations are done in extend_mode):
|
||||
|
||||
Value in i-th iteration is
|
||||
delta + mult * extend_{extend_mode} (subreg_{mode} (base + i * step)).
|
||||
|
||||
If first_special is true, the value in the first iteration is
|
||||
delta + mult * base
|
||||
|
||||
If extend = UNKNOWN, first_special must be false, delta 0, mult 1 and value is
|
||||
subreg_{mode} (base + i * step)
|
||||
|
||||
The get_iv_value function can be used to obtain these expressions.
|
||||
|
||||
??? Add a third mode field that would specify the mode in that inner
|
||||
computation is done, which would enable it to be different from the
|
||||
outer one? */
|
||||
|
||||
struct rtx_iv
|
||||
{
|
||||
/* Its base and step (mode of base and step is supposed to be extend_mode,
|
||||
see the description above). */
|
||||
rtx base, step;
|
||||
|
||||
/* The type of extend applied to it (SIGN_EXTEND, ZERO_EXTEND or UNKNOWN). */
|
||||
enum rtx_code extend;
|
||||
|
||||
/* Operations applied in the extended mode. */
|
||||
rtx delta, mult;
|
||||
|
||||
/* The mode it is extended to. */
|
||||
enum machine_mode extend_mode;
|
||||
|
||||
/* The mode the variable iterates in. */
|
||||
enum machine_mode mode;
|
||||
|
||||
/* Whether the first iteration needs to be handled specially. */
|
||||
unsigned first_special : 1;
|
||||
};
|
||||
|
||||
/* The description of an exit from the loop and of the number of iterations
|
||||
till we take the exit. */
|
||||
|
||||
struct niter_desc
|
||||
{
|
||||
/* The edge out of the loop. */
|
||||
edge out_edge;
|
||||
|
||||
/* The other edge leading from the condition. */
|
||||
edge in_edge;
|
||||
|
||||
/* True if we are able to say anything about number of iterations of the
|
||||
loop. */
|
||||
bool simple_p;
|
||||
|
||||
/* True if the loop iterates the constant number of times. */
|
||||
bool const_iter;
|
||||
|
||||
/* Number of iterations if constant. */
|
||||
unsigned HOST_WIDEST_INT niter;
|
||||
|
||||
/* Upper bound on the number of iterations. */
|
||||
unsigned HOST_WIDEST_INT niter_max;
|
||||
|
||||
/* Assumptions under that the rest of the information is valid. */
|
||||
rtx assumptions;
|
||||
|
||||
/* Assumptions under that the loop ends before reaching the latch,
|
||||
even if value of niter_expr says otherwise. */
|
||||
rtx noloop_assumptions;
|
||||
|
||||
/* Condition under that the loop is infinite. */
|
||||
rtx infinite;
|
||||
|
||||
/* Whether the comparison is signed. */
|
||||
bool signed_p;
|
||||
|
||||
/* The mode in that niter_expr should be computed. */
|
||||
enum machine_mode mode;
|
||||
|
||||
/* The number of iterations of the loop. */
|
||||
rtx niter_expr;
|
||||
};
|
||||
|
||||
extern void iv_analysis_loop_init (struct loop *);
|
||||
extern bool iv_analyze (rtx, rtx, struct rtx_iv *);
|
||||
extern bool iv_analyze_result (rtx, rtx, struct rtx_iv *);
|
||||
extern bool iv_analyze_expr (rtx, rtx, enum machine_mode, struct rtx_iv *);
|
||||
extern rtx get_iv_value (struct rtx_iv *, rtx);
|
||||
extern bool biv_p (rtx, rtx);
|
||||
extern void find_simple_exit (struct loop *, struct niter_desc *);
|
||||
extern void iv_analysis_done (void);
|
||||
extern struct df *iv_current_loop_df (void);
|
||||
|
||||
extern struct niter_desc *get_simple_loop_desc (struct loop *loop);
|
||||
extern void free_simple_loop_desc (struct loop *loop);
|
||||
|
||||
static inline struct niter_desc *
|
||||
simple_loop_desc (struct loop *loop)
|
||||
{
|
||||
return (struct niter_desc *) loop->aux;
|
||||
}
|
||||
|
||||
/* The properties of the target. */
|
||||
|
||||
extern unsigned target_avail_regs; /* Number of available registers. */
|
||||
extern unsigned target_res_regs; /* Number of reserved registers. */
|
||||
extern unsigned target_small_cost; /* The cost for register when there
|
||||
is a free one. */
|
||||
extern unsigned target_pres_cost; /* The cost for register when there are
|
||||
not too many free ones. */
|
||||
extern unsigned target_spill_cost; /* The cost for register when we need
|
||||
to spill. */
|
||||
|
||||
/* Register pressure estimation for induction variable optimizations & loop
|
||||
invariant motion. */
|
||||
extern unsigned global_cost_for_size (unsigned, unsigned, unsigned);
|
||||
extern void init_set_costs (void);
|
||||
|
||||
/* Loop optimizer initialization. */
|
||||
extern struct loops *loop_optimizer_init (unsigned);
|
||||
extern void loop_optimizer_finalize (struct loops *);
|
||||
|
||||
/* Optimization passes. */
|
||||
extern void unswitch_loops (struct loops *);
|
||||
|
||||
enum
|
||||
{
|
||||
UAP_PEEL = 1, /* Enables loop peeling. */
|
||||
UAP_UNROLL = 2, /* Enables peeling of loops if it seems profitable. */
|
||||
UAP_UNROLL_ALL = 4 /* Enables peeling of all loops. */
|
||||
};
|
||||
|
||||
extern void unroll_and_peel_loops (struct loops *, int);
|
||||
extern void doloop_optimize_loops (struct loops *);
|
||||
extern void move_loop_invariants (struct loops *);
|
||||
extern void record_estimate (struct loop *, tree, tree, tree);
|
||||
|
||||
#endif /* GCC_CFGLOOP_H */
|
@ -1,595 +0,0 @@
|
||||
/* Natural loop analysis code for GNU compiler.
|
||||
Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
|
||||
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 2, 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 COPYING. If not, write to the Free
|
||||
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
02110-1301, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "tm.h"
|
||||
#include "rtl.h"
|
||||
#include "hard-reg-set.h"
|
||||
#include "obstack.h"
|
||||
#include "basic-block.h"
|
||||
#include "cfgloop.h"
|
||||
#include "expr.h"
|
||||
#include "output.h"
|
||||
|
||||
/* Checks whether BB is executed exactly once in each LOOP iteration. */
|
||||
|
||||
bool
|
||||
just_once_each_iteration_p (const struct loop *loop, basic_block bb)
|
||||
{
|
||||
/* It must be executed at least once each iteration. */
|
||||
if (!dominated_by_p (CDI_DOMINATORS, loop->latch, bb))
|
||||
return false;
|
||||
|
||||
/* And just once. */
|
||||
if (bb->loop_father != loop)
|
||||
return false;
|
||||
|
||||
/* But this was not enough. We might have some irreducible loop here. */
|
||||
if (bb->flags & BB_IRREDUCIBLE_LOOP)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Structure representing edge of a graph. */
|
||||
|
||||
struct edge
|
||||
{
|
||||
int src, dest; /* Source and destination. */
|
||||
struct edge *pred_next, *succ_next;
|
||||
/* Next edge in predecessor and successor lists. */
|
||||
void *data; /* Data attached to the edge. */
|
||||
};
|
||||
|
||||
/* Structure representing vertex of a graph. */
|
||||
|
||||
struct vertex
|
||||
{
|
||||
struct edge *pred, *succ;
|
||||
/* Lists of predecessors and successors. */
|
||||
int component; /* Number of dfs restarts before reaching the
|
||||
vertex. */
|
||||
int post; /* Postorder number. */
|
||||
};
|
||||
|
||||
/* Structure representing a graph. */
|
||||
|
||||
struct graph
|
||||
{
|
||||
int n_vertices; /* Number of vertices. */
|
||||
struct vertex *vertices;
|
||||
/* The vertices. */
|
||||
};
|
||||
|
||||
/* Dumps graph G into F. */
|
||||
|
||||
extern void dump_graph (FILE *, struct graph *);
|
||||
|
||||
void
|
||||
dump_graph (FILE *f, struct graph *g)
|
||||
{
|
||||
int i;
|
||||
struct edge *e;
|
||||
|
||||
for (i = 0; i < g->n_vertices; i++)
|
||||
{
|
||||
if (!g->vertices[i].pred
|
||||
&& !g->vertices[i].succ)
|
||||
continue;
|
||||
|
||||
fprintf (f, "%d (%d)\t<-", i, g->vertices[i].component);
|
||||
for (e = g->vertices[i].pred; e; e = e->pred_next)
|
||||
fprintf (f, " %d", e->src);
|
||||
fprintf (f, "\n");
|
||||
|
||||
fprintf (f, "\t->");
|
||||
for (e = g->vertices[i].succ; e; e = e->succ_next)
|
||||
fprintf (f, " %d", e->dest);
|
||||
fprintf (f, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* Creates a new graph with N_VERTICES vertices. */
|
||||
|
||||
static struct graph *
|
||||
new_graph (int n_vertices)
|
||||
{
|
||||
struct graph *g = XNEW (struct graph);
|
||||
|
||||
g->n_vertices = n_vertices;
|
||||
g->vertices = XCNEWVEC (struct vertex, n_vertices);
|
||||
|
||||
return g;
|
||||
}
|
||||
|
||||
/* Adds an edge from F to T to graph G, with DATA attached. */
|
||||
|
||||
static void
|
||||
add_edge (struct graph *g, int f, int t, void *data)
|
||||
{
|
||||
struct edge *e = xmalloc (sizeof (struct edge));
|
||||
|
||||
e->src = f;
|
||||
e->dest = t;
|
||||
e->data = data;
|
||||
|
||||
e->pred_next = g->vertices[t].pred;
|
||||
g->vertices[t].pred = e;
|
||||
|
||||
e->succ_next = g->vertices[f].succ;
|
||||
g->vertices[f].succ = e;
|
||||
}
|
||||
|
||||
/* Runs dfs search over vertices of G, from NQ vertices in queue QS.
|
||||
The vertices in postorder are stored into QT. If FORWARD is false,
|
||||
backward dfs is run. */
|
||||
|
||||
static void
|
||||
dfs (struct graph *g, int *qs, int nq, int *qt, bool forward)
|
||||
{
|
||||
int i, tick = 0, v, comp = 0, top;
|
||||
struct edge *e;
|
||||
struct edge **stack = xmalloc (sizeof (struct edge *) * g->n_vertices);
|
||||
|
||||
for (i = 0; i < g->n_vertices; i++)
|
||||
{
|
||||
g->vertices[i].component = -1;
|
||||
g->vertices[i].post = -1;
|
||||
}
|
||||
|
||||
#define FST_EDGE(V) (forward ? g->vertices[(V)].succ : g->vertices[(V)].pred)
|
||||
#define NEXT_EDGE(E) (forward ? (E)->succ_next : (E)->pred_next)
|
||||
#define EDGE_SRC(E) (forward ? (E)->src : (E)->dest)
|
||||
#define EDGE_DEST(E) (forward ? (E)->dest : (E)->src)
|
||||
|
||||
for (i = 0; i < nq; i++)
|
||||
{
|
||||
v = qs[i];
|
||||
if (g->vertices[v].post != -1)
|
||||
continue;
|
||||
|
||||
g->vertices[v].component = comp++;
|
||||
e = FST_EDGE (v);
|
||||
top = 0;
|
||||
|
||||
while (1)
|
||||
{
|
||||
while (e && g->vertices[EDGE_DEST (e)].component != -1)
|
||||
e = NEXT_EDGE (e);
|
||||
|
||||
if (!e)
|
||||
{
|
||||
if (qt)
|
||||
qt[tick] = v;
|
||||
g->vertices[v].post = tick++;
|
||||
|
||||
if (!top)
|
||||
break;
|
||||
|
||||
e = stack[--top];
|
||||
v = EDGE_SRC (e);
|
||||
e = NEXT_EDGE (e);
|
||||
continue;
|
||||
}
|
||||
|
||||
stack[top++] = e;
|
||||
v = EDGE_DEST (e);
|
||||
e = FST_EDGE (v);
|
||||
g->vertices[v].component = comp - 1;
|
||||
}
|
||||
}
|
||||
|
||||
free (stack);
|
||||
}
|
||||
|
||||
/* Marks the edge E in graph G irreducible if it connects two vertices in the
|
||||
same scc. */
|
||||
|
||||
static void
|
||||
check_irred (struct graph *g, struct edge *e)
|
||||
{
|
||||
edge real = e->data;
|
||||
|
||||
/* All edges should lead from a component with higher number to the
|
||||
one with lower one. */
|
||||
gcc_assert (g->vertices[e->src].component >= g->vertices[e->dest].component);
|
||||
|
||||
if (g->vertices[e->src].component != g->vertices[e->dest].component)
|
||||
return;
|
||||
|
||||
real->flags |= EDGE_IRREDUCIBLE_LOOP;
|
||||
if (flow_bb_inside_loop_p (real->src->loop_father, real->dest))
|
||||
real->src->flags |= BB_IRREDUCIBLE_LOOP;
|
||||
}
|
||||
|
||||
/* Runs CALLBACK for all edges in G. */
|
||||
|
||||
static void
|
||||
for_each_edge (struct graph *g,
|
||||
void (callback) (struct graph *, struct edge *))
|
||||
{
|
||||
struct edge *e;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < g->n_vertices; i++)
|
||||
for (e = g->vertices[i].succ; e; e = e->succ_next)
|
||||
callback (g, e);
|
||||
}
|
||||
|
||||
/* Releases the memory occupied by G. */
|
||||
|
||||
static void
|
||||
free_graph (struct graph *g)
|
||||
{
|
||||
struct edge *e, *n;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < g->n_vertices; i++)
|
||||
for (e = g->vertices[i].succ; e; e = n)
|
||||
{
|
||||
n = e->succ_next;
|
||||
free (e);
|
||||
}
|
||||
free (g->vertices);
|
||||
free (g);
|
||||
}
|
||||
|
||||
/* Marks blocks and edges that are part of non-recognized loops; i.e. we
|
||||
throw away all latch edges and mark blocks inside any remaining cycle.
|
||||
Everything is a bit complicated due to fact we do not want to do this
|
||||
for parts of cycles that only "pass" through some loop -- i.e. for
|
||||
each cycle, we want to mark blocks that belong directly to innermost
|
||||
loop containing the whole cycle.
|
||||
|
||||
LOOPS is the loop tree. */
|
||||
|
||||
#define LOOP_REPR(LOOP) ((LOOP)->num + last_basic_block)
|
||||
#define BB_REPR(BB) ((BB)->index + 1)
|
||||
|
||||
void
|
||||
mark_irreducible_loops (struct loops *loops)
|
||||
{
|
||||
basic_block act;
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
int i, src, dest;
|
||||
struct graph *g;
|
||||
int *queue1 = XNEWVEC (int, last_basic_block + loops->num);
|
||||
int *queue2 = XNEWVEC (int, last_basic_block + loops->num);
|
||||
int nq, depth;
|
||||
struct loop *cloop;
|
||||
|
||||
/* Reset the flags. */
|
||||
FOR_BB_BETWEEN (act, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb)
|
||||
{
|
||||
act->flags &= ~BB_IRREDUCIBLE_LOOP;
|
||||
FOR_EACH_EDGE (e, ei, act->succs)
|
||||
e->flags &= ~EDGE_IRREDUCIBLE_LOOP;
|
||||
}
|
||||
|
||||
/* Create the edge lists. */
|
||||
g = new_graph (last_basic_block + loops->num);
|
||||
|
||||
FOR_BB_BETWEEN (act, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb)
|
||||
FOR_EACH_EDGE (e, ei, act->succs)
|
||||
{
|
||||
/* Ignore edges to exit. */
|
||||
if (e->dest == EXIT_BLOCK_PTR)
|
||||
continue;
|
||||
|
||||
/* And latch edges. */
|
||||
if (e->dest->loop_father->header == e->dest
|
||||
&& e->dest->loop_father->latch == act)
|
||||
continue;
|
||||
|
||||
/* Edges inside a single loop should be left where they are. Edges
|
||||
to subloop headers should lead to representative of the subloop,
|
||||
but from the same place.
|
||||
|
||||
Edges exiting loops should lead from representative
|
||||
of the son of nearest common ancestor of the loops in that
|
||||
act lays. */
|
||||
|
||||
src = BB_REPR (act);
|
||||
dest = BB_REPR (e->dest);
|
||||
|
||||
if (e->dest->loop_father->header == e->dest)
|
||||
dest = LOOP_REPR (e->dest->loop_father);
|
||||
|
||||
if (!flow_bb_inside_loop_p (act->loop_father, e->dest))
|
||||
{
|
||||
depth = find_common_loop (act->loop_father,
|
||||
e->dest->loop_father)->depth + 1;
|
||||
if (depth == act->loop_father->depth)
|
||||
cloop = act->loop_father;
|
||||
else
|
||||
cloop = act->loop_father->pred[depth];
|
||||
|
||||
src = LOOP_REPR (cloop);
|
||||
}
|
||||
|
||||
add_edge (g, src, dest, e);
|
||||
}
|
||||
|
||||
/* Find the strongly connected components. Use the algorithm of Tarjan --
|
||||
first determine the postorder dfs numbering in reversed graph, then
|
||||
run the dfs on the original graph in the order given by decreasing
|
||||
numbers assigned by the previous pass. */
|
||||
nq = 0;
|
||||
FOR_BB_BETWEEN (act, ENTRY_BLOCK_PTR, EXIT_BLOCK_PTR, next_bb)
|
||||
{
|
||||
queue1[nq++] = BB_REPR (act);
|
||||
}
|
||||
for (i = 1; i < (int) loops->num; i++)
|
||||
if (loops->parray[i])
|
||||
queue1[nq++] = LOOP_REPR (loops->parray[i]);
|
||||
dfs (g, queue1, nq, queue2, false);
|
||||
for (i = 0; i < nq; i++)
|
||||
queue1[i] = queue2[nq - i - 1];
|
||||
dfs (g, queue1, nq, NULL, true);
|
||||
|
||||
/* Mark the irreducible loops. */
|
||||
for_each_edge (g, check_irred);
|
||||
|
||||
free_graph (g);
|
||||
free (queue1);
|
||||
free (queue2);
|
||||
|
||||
loops->state |= LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS;
|
||||
}
|
||||
|
||||
/* Counts number of insns inside LOOP. */
|
||||
int
|
||||
num_loop_insns (struct loop *loop)
|
||||
{
|
||||
basic_block *bbs, bb;
|
||||
unsigned i, ninsns = 0;
|
||||
rtx insn;
|
||||
|
||||
bbs = get_loop_body (loop);
|
||||
for (i = 0; i < loop->num_nodes; i++)
|
||||
{
|
||||
bb = bbs[i];
|
||||
ninsns++;
|
||||
for (insn = BB_HEAD (bb); insn != BB_END (bb); insn = NEXT_INSN (insn))
|
||||
if (INSN_P (insn))
|
||||
ninsns++;
|
||||
}
|
||||
free(bbs);
|
||||
|
||||
return ninsns;
|
||||
}
|
||||
|
||||
/* Counts number of insns executed on average per iteration LOOP. */
|
||||
int
|
||||
average_num_loop_insns (struct loop *loop)
|
||||
{
|
||||
basic_block *bbs, bb;
|
||||
unsigned i, binsns, ninsns, ratio;
|
||||
rtx insn;
|
||||
|
||||
ninsns = 0;
|
||||
bbs = get_loop_body (loop);
|
||||
for (i = 0; i < loop->num_nodes; i++)
|
||||
{
|
||||
bb = bbs[i];
|
||||
|
||||
binsns = 1;
|
||||
for (insn = BB_HEAD (bb); insn != BB_END (bb); insn = NEXT_INSN (insn))
|
||||
if (INSN_P (insn))
|
||||
binsns++;
|
||||
|
||||
ratio = loop->header->frequency == 0
|
||||
? BB_FREQ_MAX
|
||||
: (bb->frequency * BB_FREQ_MAX) / loop->header->frequency;
|
||||
ninsns += binsns * ratio;
|
||||
}
|
||||
free(bbs);
|
||||
|
||||
ninsns /= BB_FREQ_MAX;
|
||||
if (!ninsns)
|
||||
ninsns = 1; /* To avoid division by zero. */
|
||||
|
||||
return ninsns;
|
||||
}
|
||||
|
||||
/* Returns expected number of LOOP iterations.
|
||||
Compute upper bound on number of iterations in case they do not fit integer
|
||||
to help loop peeling heuristics. Use exact counts if at all possible. */
|
||||
unsigned
|
||||
expected_loop_iterations (const struct loop *loop)
|
||||
{
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
|
||||
if (loop->latch->count || loop->header->count)
|
||||
{
|
||||
gcov_type count_in, count_latch, expected;
|
||||
|
||||
count_in = 0;
|
||||
count_latch = 0;
|
||||
|
||||
FOR_EACH_EDGE (e, ei, loop->header->preds)
|
||||
if (e->src == loop->latch)
|
||||
count_latch = e->count;
|
||||
else
|
||||
count_in += e->count;
|
||||
|
||||
if (count_in == 0)
|
||||
expected = count_latch * 2;
|
||||
else
|
||||
expected = (count_latch + count_in - 1) / count_in;
|
||||
|
||||
/* Avoid overflows. */
|
||||
return (expected > REG_BR_PROB_BASE ? REG_BR_PROB_BASE : expected);
|
||||
}
|
||||
else
|
||||
{
|
||||
int freq_in, freq_latch;
|
||||
|
||||
freq_in = 0;
|
||||
freq_latch = 0;
|
||||
|
||||
FOR_EACH_EDGE (e, ei, loop->header->preds)
|
||||
if (e->src == loop->latch)
|
||||
freq_latch = EDGE_FREQUENCY (e);
|
||||
else
|
||||
freq_in += EDGE_FREQUENCY (e);
|
||||
|
||||
if (freq_in == 0)
|
||||
return freq_latch * 2;
|
||||
|
||||
return (freq_latch + freq_in - 1) / freq_in;
|
||||
}
|
||||
}
|
||||
|
||||
/* Returns the maximum level of nesting of subloops of LOOP. */
|
||||
|
||||
unsigned
|
||||
get_loop_level (const struct loop *loop)
|
||||
{
|
||||
const struct loop *ploop;
|
||||
unsigned mx = 0, l;
|
||||
|
||||
for (ploop = loop->inner; ploop; ploop = ploop->next)
|
||||
{
|
||||
l = get_loop_level (ploop);
|
||||
if (l >= mx)
|
||||
mx = l + 1;
|
||||
}
|
||||
return mx;
|
||||
}
|
||||
|
||||
/* Returns estimate on cost of computing SEQ. */
|
||||
|
||||
static unsigned
|
||||
seq_cost (rtx seq)
|
||||
{
|
||||
unsigned cost = 0;
|
||||
rtx set;
|
||||
|
||||
for (; seq; seq = NEXT_INSN (seq))
|
||||
{
|
||||
set = single_set (seq);
|
||||
if (set)
|
||||
cost += rtx_cost (set, SET);
|
||||
else
|
||||
cost++;
|
||||
}
|
||||
|
||||
return cost;
|
||||
}
|
||||
|
||||
/* The properties of the target. */
|
||||
|
||||
unsigned target_avail_regs; /* Number of available registers. */
|
||||
unsigned target_res_regs; /* Number of reserved registers. */
|
||||
unsigned target_small_cost; /* The cost for register when there is a free one. */
|
||||
unsigned target_pres_cost; /* The cost for register when there are not too many
|
||||
free ones. */
|
||||
unsigned target_spill_cost; /* The cost for register when we need to spill. */
|
||||
|
||||
/* Initialize the constants for computing set costs. */
|
||||
|
||||
void
|
||||
init_set_costs (void)
|
||||
{
|
||||
rtx seq;
|
||||
rtx reg1 = gen_raw_REG (SImode, FIRST_PSEUDO_REGISTER);
|
||||
rtx reg2 = gen_raw_REG (SImode, FIRST_PSEUDO_REGISTER + 1);
|
||||
rtx addr = gen_raw_REG (Pmode, FIRST_PSEUDO_REGISTER + 2);
|
||||
rtx mem = validize_mem (gen_rtx_MEM (SImode, addr));
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
||||
if (TEST_HARD_REG_BIT (reg_class_contents[GENERAL_REGS], i)
|
||||
&& !fixed_regs[i])
|
||||
target_avail_regs++;
|
||||
|
||||
target_res_regs = 3;
|
||||
|
||||
/* These are really just heuristic values. */
|
||||
|
||||
start_sequence ();
|
||||
emit_move_insn (reg1, reg2);
|
||||
seq = get_insns ();
|
||||
end_sequence ();
|
||||
target_small_cost = seq_cost (seq);
|
||||
target_pres_cost = 2 * target_small_cost;
|
||||
|
||||
start_sequence ();
|
||||
emit_move_insn (mem, reg1);
|
||||
emit_move_insn (reg2, mem);
|
||||
seq = get_insns ();
|
||||
end_sequence ();
|
||||
target_spill_cost = seq_cost (seq);
|
||||
}
|
||||
|
||||
/* Calculates cost for having SIZE new loop global variables. REGS_USED is the
|
||||
number of global registers used in loop. N_USES is the number of relevant
|
||||
variable uses. */
|
||||
|
||||
unsigned
|
||||
global_cost_for_size (unsigned size, unsigned regs_used, unsigned n_uses)
|
||||
{
|
||||
unsigned regs_needed = regs_used + size;
|
||||
unsigned cost = 0;
|
||||
|
||||
if (regs_needed + target_res_regs <= target_avail_regs)
|
||||
cost += target_small_cost * size;
|
||||
else if (regs_needed <= target_avail_regs)
|
||||
cost += target_pres_cost * size;
|
||||
else
|
||||
{
|
||||
cost += target_pres_cost * size;
|
||||
cost += target_spill_cost * n_uses * (regs_needed - target_avail_regs) / regs_needed;
|
||||
}
|
||||
|
||||
return cost;
|
||||
}
|
||||
|
||||
/* Sets EDGE_LOOP_EXIT flag for all exits of LOOPS. */
|
||||
|
||||
void
|
||||
mark_loop_exit_edges (struct loops *loops)
|
||||
{
|
||||
basic_block bb;
|
||||
edge e;
|
||||
|
||||
if (loops->num <= 1)
|
||||
return;
|
||||
|
||||
FOR_EACH_BB (bb)
|
||||
{
|
||||
edge_iterator ei;
|
||||
|
||||
FOR_EACH_EDGE (e, ei, bb->succs)
|
||||
{
|
||||
if (bb->loop_father->outer
|
||||
&& loop_exit_edge_p (bb->loop_father, e))
|
||||
e->flags |= EDGE_LOOP_EXIT;
|
||||
else
|
||||
e->flags &= ~EDGE_LOOP_EXIT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user