mirror of
https://github.com/rtlduino/RTL8710AF_GCC.git
synced 2026-07-15 15:55:41 +00:00
motify compile link error
motify compile link error
This commit is contained in:
parent
923914edae
commit
03e74a8e50
5418 changed files with 1367914 additions and 206149 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,14 @@
|
|||
This README file is copied into the directory for GCC-only header files
|
||||
when fixincludes is run by the makefile for GCC.
|
||||
|
||||
Many of the files in this directory were automatically edited from the
|
||||
standard system header files by the fixincludes process. They are
|
||||
system-specific, and will not work on any other kind of system. They
|
||||
are also not part of GCC. The reason we have to do this is because
|
||||
GCC requires ANSI C headers and many vendors supply ANSI-incompatible
|
||||
headers.
|
||||
|
||||
Because this is an automated process, sometimes headers get "fixed"
|
||||
that do not, strictly speaking, need a fix. As long as nothing is broken
|
||||
by the process, it is just an unfortunate collateral inconvenience.
|
||||
We would like to rectify it, if it is not "too inconvenient".
|
||||
|
|
@ -0,0 +1,171 @@
|
|||
/* Copyright (C) 1992-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This administrivia gets added to the beginning of limits.h
|
||||
if the system has its own version of limits.h. */
|
||||
|
||||
/* We use _GCC_LIMITS_H_ because we want this not to match
|
||||
any macros that the system's limits.h uses for its own purposes. */
|
||||
#ifndef _GCC_LIMITS_H_ /* Terminated in limity.h. */
|
||||
#define _GCC_LIMITS_H_
|
||||
|
||||
#ifndef _LIBC_LIMITS_H_
|
||||
/* Use "..." so that we find syslimits.h only in this same directory. */
|
||||
#include "syslimits.h"
|
||||
#endif
|
||||
/* Copyright (C) 1991-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _LIMITS_H___
|
||||
#define _LIMITS_H___
|
||||
|
||||
/* Number of bits in a `char'. */
|
||||
#undef CHAR_BIT
|
||||
#define CHAR_BIT __CHAR_BIT__
|
||||
|
||||
/* Maximum length of a multibyte character. */
|
||||
#ifndef MB_LEN_MAX
|
||||
#define MB_LEN_MAX 1
|
||||
#endif
|
||||
|
||||
/* Minimum and maximum values a `signed char' can hold. */
|
||||
#undef SCHAR_MIN
|
||||
#define SCHAR_MIN (-SCHAR_MAX - 1)
|
||||
#undef SCHAR_MAX
|
||||
#define SCHAR_MAX __SCHAR_MAX__
|
||||
|
||||
/* Maximum value an `unsigned char' can hold. (Minimum is 0). */
|
||||
#undef UCHAR_MAX
|
||||
#if __SCHAR_MAX__ == __INT_MAX__
|
||||
# define UCHAR_MAX (SCHAR_MAX * 2U + 1U)
|
||||
#else
|
||||
# define UCHAR_MAX (SCHAR_MAX * 2 + 1)
|
||||
#endif
|
||||
|
||||
/* Minimum and maximum values a `char' can hold. */
|
||||
#ifdef __CHAR_UNSIGNED__
|
||||
# undef CHAR_MIN
|
||||
# if __SCHAR_MAX__ == __INT_MAX__
|
||||
# define CHAR_MIN 0U
|
||||
# else
|
||||
# define CHAR_MIN 0
|
||||
# endif
|
||||
# undef CHAR_MAX
|
||||
# define CHAR_MAX UCHAR_MAX
|
||||
#else
|
||||
# undef CHAR_MIN
|
||||
# define CHAR_MIN SCHAR_MIN
|
||||
# undef CHAR_MAX
|
||||
# define CHAR_MAX SCHAR_MAX
|
||||
#endif
|
||||
|
||||
/* Minimum and maximum values a `signed short int' can hold. */
|
||||
#undef SHRT_MIN
|
||||
#define SHRT_MIN (-SHRT_MAX - 1)
|
||||
#undef SHRT_MAX
|
||||
#define SHRT_MAX __SHRT_MAX__
|
||||
|
||||
/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
|
||||
#undef USHRT_MAX
|
||||
#if __SHRT_MAX__ == __INT_MAX__
|
||||
# define USHRT_MAX (SHRT_MAX * 2U + 1U)
|
||||
#else
|
||||
# define USHRT_MAX (SHRT_MAX * 2 + 1)
|
||||
#endif
|
||||
|
||||
/* Minimum and maximum values a `signed int' can hold. */
|
||||
#undef INT_MIN
|
||||
#define INT_MIN (-INT_MAX - 1)
|
||||
#undef INT_MAX
|
||||
#define INT_MAX __INT_MAX__
|
||||
|
||||
/* Maximum value an `unsigned int' can hold. (Minimum is 0). */
|
||||
#undef UINT_MAX
|
||||
#define UINT_MAX (INT_MAX * 2U + 1U)
|
||||
|
||||
/* Minimum and maximum values a `signed long int' can hold.
|
||||
(Same as `int'). */
|
||||
#undef LONG_MIN
|
||||
#define LONG_MIN (-LONG_MAX - 1L)
|
||||
#undef LONG_MAX
|
||||
#define LONG_MAX __LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
|
||||
#undef ULONG_MAX
|
||||
#define ULONG_MAX (LONG_MAX * 2UL + 1UL)
|
||||
|
||||
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
/* Minimum and maximum values a `signed long long int' can hold. */
|
||||
# undef LLONG_MIN
|
||||
# define LLONG_MIN (-LLONG_MAX - 1LL)
|
||||
# undef LLONG_MAX
|
||||
# define LLONG_MAX __LONG_LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
|
||||
# undef ULLONG_MAX
|
||||
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
|
||||
#endif
|
||||
|
||||
#if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
|
||||
/* Minimum and maximum values a `signed long long int' can hold. */
|
||||
# undef LONG_LONG_MIN
|
||||
# define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
|
||||
# undef LONG_LONG_MAX
|
||||
# define LONG_LONG_MAX __LONG_LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
|
||||
# undef ULONG_LONG_MAX
|
||||
# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL)
|
||||
#endif
|
||||
|
||||
#endif /* _LIMITS_H___ */
|
||||
/* This administrivia gets added to the end of limits.h
|
||||
if the system has its own version of limits.h. */
|
||||
|
||||
#else /* not _GCC_LIMITS_H_ */
|
||||
|
||||
#ifdef _GCC_NEXT_LIMITS_H
|
||||
#include_next <limits.h> /* recurse down to the real one */
|
||||
#endif
|
||||
|
||||
#endif /* not _GCC_LIMITS_H_ */
|
||||
|
|
@ -0,0 +1,719 @@
|
|||
/* DO NOT EDIT THIS FILE.
|
||||
|
||||
It has been auto-edited by fixincludes from:
|
||||
|
||||
"/home/build/work/GCC-4-8-build/install-native/arm-none-eabi/usr/include/sys/cdefs.h"
|
||||
|
||||
This had to be done to correct non-standard usages in the
|
||||
original, manufacturer supplied header file. */
|
||||
|
||||
/* libc/sys/linux/sys/cdefs.h - Helper macros for K&R vs. ANSI C compat. */
|
||||
|
||||
/* Written 2000 by Werner Almesberger */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Berkeley Software Design, Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)cdefs.h 8.8 (Berkeley) 1/9/95
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _SYS_CDEFS_H_
|
||||
#define _SYS_CDEFS_H_
|
||||
|
||||
#include <machine/_default_types.h>
|
||||
#include <sys/features.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define __PMT(args) args
|
||||
#define __DOTS , ...
|
||||
#define __THROW
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define __ASMNAME(cname) __XSTRING (__USER_LABEL_PREFIX__) cname
|
||||
#endif
|
||||
|
||||
#define __ptr_t void *
|
||||
#define __long_double_t long double
|
||||
|
||||
#define __attribute_malloc__
|
||||
#define __attribute_pure__
|
||||
#define __attribute_format_strfmon__(a,b)
|
||||
#define __flexarr [0]
|
||||
|
||||
#ifndef __BOUNDED_POINTERS__
|
||||
# define __bounded /* nothing */
|
||||
# define __unbounded /* nothing */
|
||||
# define __ptrvalue /* nothing */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Testing against Clang-specific extensions.
|
||||
*/
|
||||
|
||||
#ifndef __has_extension
|
||||
#define __has_extension __has_feature
|
||||
#endif
|
||||
#ifndef __has_feature
|
||||
#define __has_feature(x) 0
|
||||
#endif
|
||||
#ifndef __has_include
|
||||
#define __has_include(x) 0
|
||||
#endif
|
||||
#ifndef __has_builtin
|
||||
#define __has_builtin(x) 0
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus)
|
||||
#define __BEGIN_DECLS extern "C" {
|
||||
#define __END_DECLS }
|
||||
#else
|
||||
#define __BEGIN_DECLS
|
||||
#define __END_DECLS
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This code has been put in place to help reduce the addition of
|
||||
* compiler specific defines in FreeBSD code. It helps to aid in
|
||||
* having a compiler-agnostic source tree.
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
|
||||
#if __GNUC__ >= 3 || defined(__INTEL_COMPILER)
|
||||
#define __GNUCLIKE_ASM 3
|
||||
#define __GNUCLIKE_MATH_BUILTIN_CONSTANTS
|
||||
#else
|
||||
#define __GNUCLIKE_ASM 2
|
||||
#endif
|
||||
#define __GNUCLIKE___TYPEOF 1
|
||||
#define __GNUCLIKE___OFFSETOF 1
|
||||
#define __GNUCLIKE___SECTION 1
|
||||
|
||||
#ifndef __INTEL_COMPILER
|
||||
# define __GNUCLIKE_CTOR_SECTION_HANDLING 1
|
||||
#endif
|
||||
|
||||
#define __GNUCLIKE_BUILTIN_CONSTANT_P 1
|
||||
# if defined(__INTEL_COMPILER) && defined(__cplusplus) \
|
||||
&& __INTEL_COMPILER < 800
|
||||
# undef __GNUCLIKE_BUILTIN_CONSTANT_P
|
||||
# endif
|
||||
|
||||
#if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) && !defined(__INTEL_COMPILER)
|
||||
# define __GNUCLIKE_BUILTIN_VARARGS 1
|
||||
# define __GNUCLIKE_BUILTIN_STDARG 1
|
||||
# define __GNUCLIKE_BUILTIN_VAALIST 1
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__)
|
||||
# define __GNUC_VA_LIST_COMPATIBILITY 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Compiler memory barriers, specific to gcc and clang.
|
||||
*/
|
||||
#if defined(__GNUC__)
|
||||
#define __compiler_membar() __asm __volatile(" " : : : "memory")
|
||||
#endif
|
||||
|
||||
#ifndef __INTEL_COMPILER
|
||||
# define __GNUCLIKE_BUILTIN_NEXT_ARG 1
|
||||
# define __GNUCLIKE_MATH_BUILTIN_RELOPS
|
||||
#endif
|
||||
|
||||
#define __GNUCLIKE_BUILTIN_MEMCPY 1
|
||||
|
||||
/* XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced */
|
||||
#define __CC_SUPPORTS_INLINE 1
|
||||
#define __CC_SUPPORTS___INLINE 1
|
||||
#define __CC_SUPPORTS___INLINE__ 1
|
||||
|
||||
#define __CC_SUPPORTS___FUNC__ 1
|
||||
#define __CC_SUPPORTS_WARNING 1
|
||||
|
||||
#define __CC_SUPPORTS_VARADIC_XXX 1 /* see varargs.h */
|
||||
|
||||
#define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1
|
||||
|
||||
#endif /* __GNUC__ || __INTEL_COMPILER */
|
||||
|
||||
/*
|
||||
* The __CONCAT macro is used to concatenate parts of symbol names, e.g.
|
||||
* with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
|
||||
* The __CONCAT macro is a bit tricky to use if it must work in non-ANSI
|
||||
* mode -- there must be no spaces between its arguments, and for nested
|
||||
* __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also
|
||||
* concatenate double-quoted strings produced by the __STRING macro, but
|
||||
* this only works with ANSI C.
|
||||
*
|
||||
* __XSTRING is like __STRING, but it expands any macros in its argument
|
||||
* first. It is only available with ANSI C.
|
||||
*/
|
||||
#if defined(__STDC__) || defined(__cplusplus)
|
||||
#define __P(protos) protos /* full-blown ANSI C */
|
||||
#define __CONCAT1(x,y) x ## y
|
||||
#define __CONCAT(x,y) __CONCAT1(x,y)
|
||||
#define __STRING(x) #x /* stringify without expanding x */
|
||||
#define __XSTRING(x) __STRING(x) /* expand x, then stringify */
|
||||
|
||||
#define __const const /* define reserved names to standard */
|
||||
#define __signed signed
|
||||
#define __volatile volatile
|
||||
#if defined(__cplusplus)
|
||||
#define __inline inline /* convert to C++ keyword */
|
||||
#else
|
||||
#if !(defined(__CC_SUPPORTS___INLINE))
|
||||
#define __inline /* delete GCC keyword */
|
||||
#endif /* ! __CC_SUPPORTS___INLINE */
|
||||
#endif /* !__cplusplus */
|
||||
|
||||
#else /* !(__STDC__ || __cplusplus) */
|
||||
#define __P(protos) () /* traditional C preprocessor */
|
||||
#define __CONCAT(x,y) x/**/y
|
||||
#define __STRING(x) "x"
|
||||
|
||||
#if !defined(__CC_SUPPORTS___INLINE)
|
||||
#define __const /* delete pseudo-ANSI C keywords */
|
||||
#define __inline
|
||||
#define __signed
|
||||
#define __volatile
|
||||
/*
|
||||
* In non-ANSI C environments, new programs will want ANSI-only C keywords
|
||||
* deleted from the program and old programs will want them left alone.
|
||||
* When using a compiler other than gcc, programs using the ANSI C keywords
|
||||
* const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
|
||||
* When using "gcc -traditional", we assume that this is the intent; if
|
||||
* __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
|
||||
*/
|
||||
#ifndef NO_ANSI_KEYWORDS
|
||||
#define const /* delete ANSI C keywords */
|
||||
#define inline
|
||||
#define signed
|
||||
#define volatile
|
||||
#endif /* !NO_ANSI_KEYWORDS */
|
||||
#endif /* !__CC_SUPPORTS___INLINE */
|
||||
#endif /* !(__STDC__ || __cplusplus) */
|
||||
|
||||
/*
|
||||
* Compiler-dependent macros to help declare dead (non-returning) and
|
||||
* pure (no side effects) functions, and unused variables. They are
|
||||
* null except for versions of gcc that are known to support the features
|
||||
* properly (old versions of gcc-2 supported the dead and pure features
|
||||
* in a different (wrong) way). If we do not provide an implementation
|
||||
* for a given compiler, let the compile fail if it is told to use
|
||||
* a feature that we cannot live without.
|
||||
*/
|
||||
#ifdef lint
|
||||
#define __dead2
|
||||
#define __pure2
|
||||
#define __unused
|
||||
#define __packed
|
||||
#define __aligned(x)
|
||||
#define __section(x)
|
||||
#else
|
||||
#if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER)
|
||||
#define __dead2
|
||||
#define __pure2
|
||||
#define __unused
|
||||
#endif
|
||||
#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 && !defined(__INTEL_COMPILER)
|
||||
#define __dead2 __attribute__((__noreturn__))
|
||||
#define __pure2 __attribute__((__const__))
|
||||
#define __unused
|
||||
/* XXX Find out what to do for __packed, __aligned and __section */
|
||||
#endif
|
||||
#if __GNUC_PREREQ__(2, 7)
|
||||
#define __dead2 __attribute__((__noreturn__))
|
||||
#define __pure2 __attribute__((__const__))
|
||||
#define __unused __attribute__((__unused__))
|
||||
#define __used __attribute__((__used__))
|
||||
#define __packed __attribute__((__packed__))
|
||||
#define __aligned(x) __attribute__((__aligned__(x)))
|
||||
#define __section(x) __attribute__((__section__(x)))
|
||||
#endif
|
||||
#if defined(__INTEL_COMPILER)
|
||||
#define __dead2 __attribute__((__noreturn__))
|
||||
#define __pure2 __attribute__((__const__))
|
||||
#define __unused __attribute__((__unused__))
|
||||
#define __used __attribute__((__used__))
|
||||
#define __packed __attribute__((__packed__))
|
||||
#define __aligned(x) __attribute__((__aligned__(x)))
|
||||
#define __section(x) __attribute__((__section__(x)))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !__GNUC_PREREQ__(2, 95)
|
||||
#define __alignof(x) __offsetof(struct { char __a; x __b; }, __b)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Keywords added in C11.
|
||||
*/
|
||||
|
||||
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
|
||||
|
||||
#if !__has_extension(c_alignas)
|
||||
#if (defined(__cplusplus) && __cplusplus >= 201103L) || \
|
||||
__has_extension(cxx_alignas)
|
||||
#define _Alignas(x) alignas(x)
|
||||
#else
|
||||
/* XXX: Only emulates _Alignas(constant-expression); not _Alignas(type-name). */
|
||||
#define _Alignas(x) __aligned(x)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && __cplusplus >= 201103L
|
||||
#define _Alignof(x) alignof(x)
|
||||
#else
|
||||
#define _Alignof(x) __alignof(x)
|
||||
#endif
|
||||
|
||||
#if !__has_extension(c_atomic) && !__has_extension(cxx_atomic)
|
||||
/*
|
||||
* No native support for _Atomic(). Place object in structure to prevent
|
||||
* most forms of direct non-atomic access.
|
||||
*/
|
||||
#define _Atomic(T) struct { T volatile __val; }
|
||||
#endif
|
||||
|
||||
#if defined(__cplusplus) && __cplusplus >= 201103L
|
||||
#define _Noreturn __attribute__((__noreturn__))
|
||||
#else
|
||||
#define _Noreturn __dead2
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ__(4, 6) && !defined(__cplusplus)
|
||||
/* Do nothing: _Static_assert() works as per C11 */
|
||||
#elif !__has_extension(c_static_assert)
|
||||
#if (defined(__cplusplus) && __cplusplus >= 201103L) || \
|
||||
__has_extension(cxx_static_assert)
|
||||
#define _Static_assert(x, y) static_assert(x, y)
|
||||
#elif defined(__COUNTER__)
|
||||
#define _Static_assert(x, y) __Static_assert(x, __COUNTER__)
|
||||
#define __Static_assert(x, y) ___Static_assert(x, y)
|
||||
#define ___Static_assert(x, y) typedef char __assert_ ## y[(x) ? 1 : -1]
|
||||
#else
|
||||
#define _Static_assert(x, y) struct __hack
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !__has_extension(c_thread_local)
|
||||
/* XXX: Change this to test against C++11 when clang in base supports it. */
|
||||
#if /* (defined(__cplusplus) && __cplusplus >= 201103L) || */ \
|
||||
__has_extension(cxx_thread_local)
|
||||
#define _Thread_local thread_local
|
||||
#else
|
||||
#define _Thread_local __thread
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* __STDC_VERSION__ || __STDC_VERSION__ < 201112L */
|
||||
|
||||
/*
|
||||
* Emulation of C11 _Generic(). Unlike the previously defined C11
|
||||
* keywords, it is not possible to implement this using exactly the same
|
||||
* syntax. Therefore implement something similar under the name
|
||||
* __generic(). Unlike _Generic(), this macro can only distinguish
|
||||
* between a single type, so it requires nested invocations to
|
||||
* distinguish multiple cases.
|
||||
*/
|
||||
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||
#define __generic(expr, t, yes, no) \
|
||||
_Generic(expr, t: yes, default: no)
|
||||
#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus)
|
||||
#define __generic(expr, t, yes, no) \
|
||||
__builtin_choose_expr( \
|
||||
__builtin_types_compatible_p(__typeof(expr), t), yes, no)
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ__(2, 96)
|
||||
#define __malloc_like __attribute__((__malloc__))
|
||||
#define __pure __attribute__((__pure__))
|
||||
#else
|
||||
#define __malloc_like
|
||||
#define __pure
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ__(3, 1) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800)
|
||||
#define __always_inline __attribute__((__always_inline__))
|
||||
#else
|
||||
#define __always_inline
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ__(3, 1)
|
||||
#define __noinline __attribute__ ((__noinline__))
|
||||
#else
|
||||
#define __noinline
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ__(3, 3)
|
||||
#define __nonnull(x) __attribute__((__nonnull__(x)))
|
||||
#else
|
||||
#define __nonnull(x)
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ__(3, 4)
|
||||
#define __fastcall __attribute__((__fastcall__))
|
||||
#else
|
||||
#define __fastcall
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ__(4, 1)
|
||||
#define __returns_twice __attribute__((__returns_twice__))
|
||||
#else
|
||||
#define __returns_twice
|
||||
#endif
|
||||
|
||||
/* XXX: should use `#if __STDC_VERSION__ < 199901'. */
|
||||
#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER)
|
||||
#define __func__ NULL
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GCC 2.95 provides `__restrict' as an extension to C90 to support the
|
||||
* C99-specific `restrict' type qualifier. We happen to use `__restrict' as
|
||||
* a way to define the `restrict' type qualifier without disturbing older
|
||||
* software that is unaware of C99 keywords.
|
||||
*/
|
||||
#if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95)
|
||||
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 || defined(lint)
|
||||
#define __restrict
|
||||
#else
|
||||
#define __restrict restrict
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* GNU C version 2.96 adds explicit branch prediction so that
|
||||
* the CPU back-end can hint the processor and also so that
|
||||
* code blocks can be reordered such that the predicted path
|
||||
* sees a more linear flow, thus improving cache behavior, etc.
|
||||
*
|
||||
* The following two macros provide us with a way to utilize this
|
||||
* compiler feature. Use __predict_true() if you expect the expression
|
||||
* to evaluate to true, and __predict_false() if you expect the
|
||||
* expression to evaluate to false.
|
||||
*
|
||||
* A few notes about usage:
|
||||
*
|
||||
* * Generally, __predict_false() error condition checks (unless
|
||||
* you have some _strong_ reason to do otherwise, in which case
|
||||
* document it), and/or __predict_true() `no-error' condition
|
||||
* checks, assuming you want to optimize for the no-error case.
|
||||
*
|
||||
* * Other than that, if you don't know the likelihood of a test
|
||||
* succeeding from empirical or other `hard' evidence, don't
|
||||
* make predictions.
|
||||
*
|
||||
* * These are meant to be used in places that are run `a lot'.
|
||||
* It is wasteful to make predictions in code that is run
|
||||
* seldomly (e.g. at subsystem initialization time) as the
|
||||
* basic block reordering that this affects can often generate
|
||||
* larger code.
|
||||
*/
|
||||
#if __GNUC_PREREQ__(2, 96)
|
||||
#define __predict_true(exp) __builtin_expect((exp), 1)
|
||||
#define __predict_false(exp) __builtin_expect((exp), 0)
|
||||
#else
|
||||
#define __predict_true(exp) (exp)
|
||||
#define __predict_false(exp) (exp)
|
||||
#endif
|
||||
|
||||
#if __GNUC_PREREQ__(4, 2)
|
||||
#define __hidden __attribute__((__visibility__("hidden")))
|
||||
#define __exported __attribute__((__visibility__("default")))
|
||||
#else
|
||||
#define __hidden
|
||||
#define __exported
|
||||
#endif
|
||||
|
||||
#define __offsetof(type, field) offsetof(type, field)
|
||||
#define __rangeof(type, start, end) \
|
||||
(__offsetof(type, end) - __offsetof(type, start))
|
||||
|
||||
/*
|
||||
* Given the pointer x to the member m of the struct s, return
|
||||
* a pointer to the containing structure. When using GCC, we first
|
||||
* assign pointer x to a local variable, to check that its type is
|
||||
* compatible with member m.
|
||||
*/
|
||||
#if __GNUC_PREREQ__(3, 1)
|
||||
#define __containerof(x, s, m) ({ \
|
||||
const volatile __typeof__(((s *)0)->m) *__x = (x); \
|
||||
__DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, m));\
|
||||
})
|
||||
#else
|
||||
#define __containerof(x, s, m) \
|
||||
__DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Compiler-dependent macros to declare that functions take printf-like
|
||||
* or scanf-like arguments. They are null except for versions of gcc
|
||||
* that are known to support the features properly (old versions of gcc-2
|
||||
* didn't permit keeping the keywords out of the application namespace).
|
||||
*/
|
||||
#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER)
|
||||
#define __printflike(fmtarg, firstvararg)
|
||||
#define __scanflike(fmtarg, firstvararg)
|
||||
#define __format_arg(fmtarg)
|
||||
#define __strfmonlike(fmtarg, firstvararg)
|
||||
#define __strftimelike(fmtarg, firstvararg)
|
||||
#else
|
||||
#define __printflike(fmtarg, firstvararg) \
|
||||
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
|
||||
#define __scanflike(fmtarg, firstvararg) \
|
||||
__attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
|
||||
#define __format_arg(fmtarg) __attribute__((__format_arg__ (fmtarg)))
|
||||
#define __strfmonlike(fmtarg, firstvararg) \
|
||||
__attribute__((__format__ (__strfmon__, fmtarg, firstvararg)))
|
||||
#define __strftimelike(fmtarg, firstvararg) \
|
||||
__attribute__((__format__ (__strftime__, fmtarg, firstvararg)))
|
||||
#endif
|
||||
|
||||
/* Compiler-dependent macros that rely on FreeBSD-specific extensions. */
|
||||
#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \
|
||||
defined(__GNUC__) && !defined(__INTEL_COMPILER)
|
||||
#define __printf0like(fmtarg, firstvararg) \
|
||||
__attribute__((__format__ (__printf0__, fmtarg, firstvararg)))
|
||||
#else
|
||||
#define __printf0like(fmtarg, firstvararg)
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || defined(__INTEL_COMPILER)
|
||||
#ifndef __INTEL_COMPILER
|
||||
#define __strong_reference(sym,aliassym) \
|
||||
extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)))
|
||||
#endif
|
||||
#ifdef __ELF__
|
||||
#ifdef __STDC__
|
||||
#define __weak_reference(sym,alias) \
|
||||
__asm__(".weak " #alias); \
|
||||
__asm__(".equ " #alias ", " #sym)
|
||||
#define __warn_references(sym,msg) \
|
||||
__asm__(".section .gnu.warning." #sym); \
|
||||
__asm__(".asciz \"" msg "\""); \
|
||||
__asm__(".previous")
|
||||
#define __sym_compat(sym,impl,verid) \
|
||||
__asm__(".symver " #impl ", " #sym "@" #verid)
|
||||
#define __sym_default(sym,impl,verid) \
|
||||
__asm__(".symver " #impl ", " #sym "@@" #verid)
|
||||
#else
|
||||
#define __weak_reference(sym,alias) \
|
||||
__asm__(".weak alias"); \
|
||||
__asm__(".equ alias, sym")
|
||||
#define __warn_references(sym,msg) \
|
||||
__asm__(".section .gnu.warning.sym"); \
|
||||
__asm__(".asciz \"msg\""); \
|
||||
__asm__(".previous")
|
||||
#define __sym_compat(sym,impl,verid) \
|
||||
__asm__(".symver impl, sym@verid")
|
||||
#define __sym_default(impl,sym,verid) \
|
||||
__asm__(".symver impl, sym@@verid")
|
||||
#endif /* __STDC__ */
|
||||
#else /* !__ELF__ */
|
||||
#ifdef __STDC__
|
||||
#define __weak_reference(sym,alias) \
|
||||
__asm__(".stabs \"_" #alias "\",11,0,0,0"); \
|
||||
__asm__(".stabs \"_" #sym "\",1,0,0,0")
|
||||
#define __warn_references(sym,msg) \
|
||||
__asm__(".stabs \"" msg "\",30,0,0,0"); \
|
||||
__asm__(".stabs \"_" #sym "\",1,0,0,0")
|
||||
#else
|
||||
#define __weak_reference(sym,alias) \
|
||||
__asm__(".stabs \"_/**/alias\",11,0,0,0"); \
|
||||
__asm__(".stabs \"_/**/sym\",1,0,0,0")
|
||||
#define __warn_references(sym,msg) \
|
||||
__asm__(".stabs msg,30,0,0,0"); \
|
||||
__asm__(".stabs \"_/**/sym\",1,0,0,0")
|
||||
#endif /* __STDC__ */
|
||||
#endif /* __ELF__ */
|
||||
#endif /* __GNUC__ || __INTEL_COMPILER */
|
||||
|
||||
#ifndef __FBSDID
|
||||
#define __FBSDID(s) struct __hack
|
||||
#endif
|
||||
|
||||
#ifndef __RCSID
|
||||
#define __RCSID(s) struct __hack
|
||||
#endif
|
||||
|
||||
#ifndef __RCSID_SOURCE
|
||||
#define __RCSID_SOURCE(s) struct __hack
|
||||
#endif
|
||||
|
||||
#ifndef __SCCSID
|
||||
#define __SCCSID(s) struct __hack
|
||||
#endif
|
||||
|
||||
#ifndef __COPYRIGHT
|
||||
#define __COPYRIGHT(s) struct __hack
|
||||
#endif
|
||||
|
||||
#ifndef __DECONST
|
||||
#define __DECONST(type, var) ((type)(__uintptr_t)(const void *)(var))
|
||||
#endif
|
||||
|
||||
#ifndef __DEVOLATILE
|
||||
#define __DEVOLATILE(type, var) ((type)(__uintptr_t)(volatile void *)(var))
|
||||
#endif
|
||||
|
||||
#ifndef __DEQUALIFY
|
||||
#define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var))
|
||||
#endif
|
||||
|
||||
/*-
|
||||
* The following definitions are an extension of the behavior originally
|
||||
* implemented in <sys/_posix.h>, but with a different level of granularity.
|
||||
* POSIX.1 requires that the macros we test be defined before any standard
|
||||
* header file is included.
|
||||
*
|
||||
* Here's a quick run-down of the versions:
|
||||
* defined(_POSIX_SOURCE) 1003.1-1988
|
||||
* _POSIX_C_SOURCE == 1 1003.1-1990
|
||||
* _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option
|
||||
* _POSIX_C_SOURCE == 199309 1003.1b-1993
|
||||
* _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995,
|
||||
* and the omnibus ISO/IEC 9945-1: 1996
|
||||
* _POSIX_C_SOURCE == 200112 1003.1-2001
|
||||
* _POSIX_C_SOURCE == 200809 1003.1-2008
|
||||
*
|
||||
* In addition, the X/Open Portability Guide, which is now the Single UNIX
|
||||
* Specification, defines a feature-test macro which indicates the version of
|
||||
* that specification, and which subsumes _POSIX_C_SOURCE.
|
||||
*
|
||||
* Our macros begin with two underscores to avoid namespace screwage.
|
||||
*/
|
||||
|
||||
/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */
|
||||
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1
|
||||
#undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */
|
||||
#define _POSIX_C_SOURCE 199009
|
||||
#endif
|
||||
|
||||
/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */
|
||||
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2
|
||||
#undef _POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE 199209
|
||||
#endif
|
||||
|
||||
/* Deal with various X/Open Portability Guides and Single UNIX Spec. */
|
||||
#ifdef _XOPEN_SOURCE
|
||||
#if _XOPEN_SOURCE - 0 >= 700
|
||||
#define __XSI_VISIBLE 700
|
||||
#undef _POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE 200809
|
||||
#elif _XOPEN_SOURCE - 0 >= 600
|
||||
#define __XSI_VISIBLE 600
|
||||
#undef _POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE 200112
|
||||
#elif _XOPEN_SOURCE - 0 >= 500
|
||||
#define __XSI_VISIBLE 500
|
||||
#undef _POSIX_C_SOURCE
|
||||
#define _POSIX_C_SOURCE 199506
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Deal with all versions of POSIX. The ordering relative to the tests above is
|
||||
* important.
|
||||
*/
|
||||
#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
|
||||
#define _POSIX_C_SOURCE 198808
|
||||
#endif
|
||||
#ifdef _POSIX_C_SOURCE
|
||||
#if _POSIX_C_SOURCE >= 200809
|
||||
#define __POSIX_VISIBLE 200809
|
||||
#define __ISO_C_VISIBLE 1999
|
||||
#elif _POSIX_C_SOURCE >= 200112
|
||||
#define __POSIX_VISIBLE 200112
|
||||
#define __ISO_C_VISIBLE 1999
|
||||
#elif _POSIX_C_SOURCE >= 199506
|
||||
#define __POSIX_VISIBLE 199506
|
||||
#define __ISO_C_VISIBLE 1990
|
||||
#elif _POSIX_C_SOURCE >= 199309
|
||||
#define __POSIX_VISIBLE 199309
|
||||
#define __ISO_C_VISIBLE 1990
|
||||
#elif _POSIX_C_SOURCE >= 199209
|
||||
#define __POSIX_VISIBLE 199209
|
||||
#define __ISO_C_VISIBLE 1990
|
||||
#elif _POSIX_C_SOURCE >= 199009
|
||||
#define __POSIX_VISIBLE 199009
|
||||
#define __ISO_C_VISIBLE 1990
|
||||
#else
|
||||
#define __POSIX_VISIBLE 198808
|
||||
#define __ISO_C_VISIBLE 0
|
||||
#endif /* _POSIX_C_SOURCE */
|
||||
#else
|
||||
/*-
|
||||
* Deal with _ANSI_SOURCE:
|
||||
* If it is defined, and no other compilation environment is explicitly
|
||||
* requested, then define our internal feature-test macros to zero. This
|
||||
* makes no difference to the preprocessor (undefined symbols in preprocessing
|
||||
* expressions are defined to have value zero), but makes it more convenient for
|
||||
* a test program to print out the values.
|
||||
*
|
||||
* If a program mistakenly defines _ANSI_SOURCE and some other macro such as
|
||||
* _POSIX_C_SOURCE, we will assume that it wants the broader compilation
|
||||
* environment (and in fact we will never get here).
|
||||
*/
|
||||
#if defined(_ANSI_SOURCE) /* Hide almost everything. */
|
||||
#define __POSIX_VISIBLE 0
|
||||
#define __XSI_VISIBLE 0
|
||||
#define __BSD_VISIBLE 0
|
||||
#define __ISO_C_VISIBLE 1990
|
||||
#elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */
|
||||
#define __POSIX_VISIBLE 0
|
||||
#define __XSI_VISIBLE 0
|
||||
#define __BSD_VISIBLE 0
|
||||
#define __ISO_C_VISIBLE 1999
|
||||
#elif defined(_C11_SOURCE) /* Localism to specify strict C11 env. */
|
||||
#define __POSIX_VISIBLE 0
|
||||
#define __XSI_VISIBLE 0
|
||||
#define __BSD_VISIBLE 0
|
||||
#define __ISO_C_VISIBLE 2011
|
||||
#elif defined(_GNU_SOURCE) /* Everything and the kitchen sink. */
|
||||
#define __POSIX_VISIBLE 200809
|
||||
#define __XSI_VISIBLE 700
|
||||
#define __BSD_VISIBLE 1
|
||||
#define __ISO_C_VISIBLE 2011
|
||||
#define __GNU_VISIBLE 1
|
||||
#else /* Default: everything except __GNU_VISIBLE. */
|
||||
#define __POSIX_VISIBLE 200809
|
||||
#define __XSI_VISIBLE 700
|
||||
#define __BSD_VISIBLE 1
|
||||
#define __ISO_C_VISIBLE 2011
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* !_SYS_CDEFS_H_ */
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
/* syslimits.h stands for the system's own limits.h file.
|
||||
If we can use it ok unmodified, then we install this text.
|
||||
If fixincludes fixes it, then the fixed version is installed
|
||||
instead of this text. */
|
||||
|
||||
#define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */
|
||||
#include_next <limits.h>
|
||||
#undef _GCC_NEXT_LIMITS_H
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,277 @@
|
|||
/* Copyright (C) 2002-2013 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* ISO C Standard: 5.2.4.2.2 Characteristics of floating types <float.h>
|
||||
*/
|
||||
|
||||
#ifndef _FLOAT_H___
|
||||
#define _FLOAT_H___
|
||||
|
||||
/* Radix of exponent representation, b. */
|
||||
#undef FLT_RADIX
|
||||
#define FLT_RADIX __FLT_RADIX__
|
||||
|
||||
/* Number of base-FLT_RADIX digits in the significand, p. */
|
||||
#undef FLT_MANT_DIG
|
||||
#undef DBL_MANT_DIG
|
||||
#undef LDBL_MANT_DIG
|
||||
#define FLT_MANT_DIG __FLT_MANT_DIG__
|
||||
#define DBL_MANT_DIG __DBL_MANT_DIG__
|
||||
#define LDBL_MANT_DIG __LDBL_MANT_DIG__
|
||||
|
||||
/* 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
|
||||
*/
|
||||
#undef FLT_DIG
|
||||
#undef DBL_DIG
|
||||
#undef LDBL_DIG
|
||||
#define FLT_DIG __FLT_DIG__
|
||||
#define DBL_DIG __DBL_DIG__
|
||||
#define LDBL_DIG __LDBL_DIG__
|
||||
|
||||
/* Minimum int x such that FLT_RADIX**(x-1) is a normalized float, emin */
|
||||
#undef FLT_MIN_EXP
|
||||
#undef DBL_MIN_EXP
|
||||
#undef LDBL_MIN_EXP
|
||||
#define FLT_MIN_EXP __FLT_MIN_EXP__
|
||||
#define DBL_MIN_EXP __DBL_MIN_EXP__
|
||||
#define LDBL_MIN_EXP __LDBL_MIN_EXP__
|
||||
|
||||
/* Minimum negative integer such that 10 raised to that power is in the
|
||||
range of normalized floating-point numbers,
|
||||
|
||||
ceil(log10(b) * (emin - 1))
|
||||
*/
|
||||
#undef FLT_MIN_10_EXP
|
||||
#undef DBL_MIN_10_EXP
|
||||
#undef LDBL_MIN_10_EXP
|
||||
#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__
|
||||
#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
|
||||
#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
|
||||
|
||||
/* Maximum int x such that FLT_RADIX**(x-1) is a representable float, emax. */
|
||||
#undef FLT_MAX_EXP
|
||||
#undef DBL_MAX_EXP
|
||||
#undef LDBL_MAX_EXP
|
||||
#define FLT_MAX_EXP __FLT_MAX_EXP__
|
||||
#define DBL_MAX_EXP __DBL_MAX_EXP__
|
||||
#define LDBL_MAX_EXP __LDBL_MAX_EXP__
|
||||
|
||||
/* Maximum integer such that 10 raised to that power is in the range of
|
||||
representable finite floating-point numbers,
|
||||
|
||||
floor(log10((1 - b**-p) * b**emax))
|
||||
*/
|
||||
#undef FLT_MAX_10_EXP
|
||||
#undef DBL_MAX_10_EXP
|
||||
#undef LDBL_MAX_10_EXP
|
||||
#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__
|
||||
#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
|
||||
#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
|
||||
|
||||
/* Maximum representable finite floating-point number,
|
||||
|
||||
(1 - b**-p) * b**emax
|
||||
*/
|
||||
#undef FLT_MAX
|
||||
#undef DBL_MAX
|
||||
#undef LDBL_MAX
|
||||
#define FLT_MAX __FLT_MAX__
|
||||
#define DBL_MAX __DBL_MAX__
|
||||
#define LDBL_MAX __LDBL_MAX__
|
||||
|
||||
/* The difference between 1 and the least value greater than 1 that is
|
||||
representable in the given floating point type, b**1-p. */
|
||||
#undef FLT_EPSILON
|
||||
#undef DBL_EPSILON
|
||||
#undef LDBL_EPSILON
|
||||
#define FLT_EPSILON __FLT_EPSILON__
|
||||
#define DBL_EPSILON __DBL_EPSILON__
|
||||
#define LDBL_EPSILON __LDBL_EPSILON__
|
||||
|
||||
/* Minimum normalized positive floating-point number, b**(emin - 1). */
|
||||
#undef FLT_MIN
|
||||
#undef DBL_MIN
|
||||
#undef LDBL_MIN
|
||||
#define FLT_MIN __FLT_MIN__
|
||||
#define DBL_MIN __DBL_MIN__
|
||||
#define LDBL_MIN __LDBL_MIN__
|
||||
|
||||
/* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown. */
|
||||
/* ??? This is supposed to change with calls to fesetround in <fenv.h>. */
|
||||
#undef FLT_ROUNDS
|
||||
#define FLT_ROUNDS 1
|
||||
|
||||
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
/* The floating-point expression evaluation method.
|
||||
-1 indeterminate
|
||||
0 evaluate all operations and constants just to the range and
|
||||
precision of the type
|
||||
1 evaluate operations and constants of type float and double
|
||||
to the range and precision of the double type, evaluate
|
||||
long double operations and constants to the range and
|
||||
precision of the long double type
|
||||
2 evaluate all operations and constants to the range and
|
||||
precision of the long double type
|
||||
|
||||
??? This ought to change with the setting of the fp control word;
|
||||
the value provided by the compiler assumes the widest setting. */
|
||||
#undef FLT_EVAL_METHOD
|
||||
#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
|
||||
|
||||
/* Number of decimal digits, n, such that any floating-point number in the
|
||||
widest supported floating type with pmax radix b digits can be rounded
|
||||
to a floating-point number with n decimal digits and back again without
|
||||
change to the value,
|
||||
|
||||
pmax * log10(b) if b is a power of 10
|
||||
ceil(1 + pmax * log10(b)) otherwise
|
||||
*/
|
||||
#undef DECIMAL_DIG
|
||||
#define DECIMAL_DIG __DECIMAL_DIG__
|
||||
|
||||
#endif /* C99 */
|
||||
|
||||
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||
/* Versions of DECIMAL_DIG for each floating-point type. */
|
||||
#undef FLT_DECIMAL_DIG
|
||||
#undef DBL_DECIMAL_DIG
|
||||
#undef LDBL_DECIMAL_DIG
|
||||
#define FLT_DECIMAL_DIG __FLT_DECIMAL_DIG__
|
||||
#define DBL_DECIMAL_DIG __DBL_DECIMAL_DIG__
|
||||
#define LDBL_DECIMAL_DIG __DECIMAL_DIG__
|
||||
|
||||
/* Whether types support subnormal numbers. */
|
||||
#undef FLT_HAS_SUBNORM
|
||||
#undef DBL_HAS_SUBNORM
|
||||
#undef LDBL_HAS_SUBNORM
|
||||
#define FLT_HAS_SUBNORM __FLT_HAS_DENORM__
|
||||
#define DBL_HAS_SUBNORM __DBL_HAS_DENORM__
|
||||
#define LDBL_HAS_SUBNORM __LDBL_HAS_DENORM__
|
||||
|
||||
/* Minimum positive values, including subnormals. */
|
||||
#undef FLT_TRUE_MIN
|
||||
#undef DBL_TRUE_MIN
|
||||
#undef LDBL_TRUE_MIN
|
||||
#if __FLT_HAS_DENORM__
|
||||
#define FLT_TRUE_MIN __FLT_DENORM_MIN__
|
||||
#else
|
||||
#define FLT_TRUE_MIN __FLT_MIN__
|
||||
#endif
|
||||
#if __DBL_HAS_DENORM__
|
||||
#define DBL_TRUE_MIN __DBL_DENORM_MIN__
|
||||
#else
|
||||
#define DBL_TRUE_MIN __DBL_MIN__
|
||||
#endif
|
||||
#if __LDBL_HAS_DENORM__
|
||||
#define LDBL_TRUE_MIN __LDBL_DENORM_MIN__
|
||||
#else
|
||||
#define LDBL_TRUE_MIN __LDBL_MIN__
|
||||
#endif
|
||||
|
||||
#endif /* C11 */
|
||||
|
||||
#ifdef __STDC_WANT_DEC_FP__
|
||||
/* Draft Technical Report 24732, extension for decimal floating-point
|
||||
arithmetic: Characteristic of decimal floating types <float.h>. */
|
||||
|
||||
/* Number of base-FLT_RADIX digits in the significand, p. */
|
||||
#undef DEC32_MANT_DIG
|
||||
#undef DEC64_MANT_DIG
|
||||
#undef DEC128_MANT_DIG
|
||||
#define DEC32_MANT_DIG __DEC32_MANT_DIG__
|
||||
#define DEC64_MANT_DIG __DEC64_MANT_DIG__
|
||||
#define DEC128_MANT_DIG __DEC128_MANT_DIG__
|
||||
|
||||
/* Minimum exponent. */
|
||||
#undef DEC32_MIN_EXP
|
||||
#undef DEC64_MIN_EXP
|
||||
#undef DEC128_MIN_EXP
|
||||
#define DEC32_MIN_EXP __DEC32_MIN_EXP__
|
||||
#define DEC64_MIN_EXP __DEC64_MIN_EXP__
|
||||
#define DEC128_MIN_EXP __DEC128_MIN_EXP__
|
||||
|
||||
/* Maximum exponent. */
|
||||
#undef DEC32_MAX_EXP
|
||||
#undef DEC64_MAX_EXP
|
||||
#undef DEC128_MAX_EXP
|
||||
#define DEC32_MAX_EXP __DEC32_MAX_EXP__
|
||||
#define DEC64_MAX_EXP __DEC64_MAX_EXP__
|
||||
#define DEC128_MAX_EXP __DEC128_MAX_EXP__
|
||||
|
||||
/* Maximum representable finite decimal floating-point number
|
||||
(there are 6, 15, and 33 9s after the decimal points respectively). */
|
||||
#undef DEC32_MAX
|
||||
#undef DEC64_MAX
|
||||
#undef DEC128_MAX
|
||||
#define DEC32_MAX __DEC32_MAX__
|
||||
#define DEC64_MAX __DEC64_MAX__
|
||||
#define DEC128_MAX __DEC128_MAX__
|
||||
|
||||
/* The difference between 1 and the least value greater than 1 that is
|
||||
representable in the given floating point type. */
|
||||
#undef DEC32_EPSILON
|
||||
#undef DEC64_EPSILON
|
||||
#undef DEC128_EPSILON
|
||||
#define DEC32_EPSILON __DEC32_EPSILON__
|
||||
#define DEC64_EPSILON __DEC64_EPSILON__
|
||||
#define DEC128_EPSILON __DEC128_EPSILON__
|
||||
|
||||
/* Minimum normalized positive floating-point number. */
|
||||
#undef DEC32_MIN
|
||||
#undef DEC64_MIN
|
||||
#undef DEC128_MIN
|
||||
#define DEC32_MIN __DEC32_MIN__
|
||||
#define DEC64_MIN __DEC64_MIN__
|
||||
#define DEC128_MIN __DEC128_MIN__
|
||||
|
||||
/* Minimum subnormal positive floating-point number. */
|
||||
#undef DEC32_SUBNORMAL_MIN
|
||||
#undef DEC64_SUBNORMAL_MIN
|
||||
#undef DEC128_SUBNORMAL_MIN
|
||||
#define DEC32_SUBNORMAL_MIN __DEC32_SUBNORMAL_MIN__
|
||||
#define DEC64_SUBNORMAL_MIN __DEC64_SUBNORMAL_MIN__
|
||||
#define DEC128_SUBNORMAL_MIN __DEC128_SUBNORMAL_MIN__
|
||||
|
||||
/* The floating-point expression evaluation method.
|
||||
-1 indeterminate
|
||||
0 evaluate all operations and constants just to the range and
|
||||
precision of the type
|
||||
1 evaluate operations and constants of type _Decimal32
|
||||
and _Decimal64 to the range and precision of the _Decimal64
|
||||
type, evaluate _Decimal128 operations and constants to the
|
||||
range and precision of the _Decimal128 type;
|
||||
2 evaluate all operations and constants to the range and
|
||||
precision of the _Decimal128 type. */
|
||||
|
||||
#undef DEC_EVAL_METHOD
|
||||
#define DEC_EVAL_METHOD __DEC_EVAL_METHOD__
|
||||
|
||||
#endif /* __STDC_WANT_DEC_FP__ */
|
||||
|
||||
#endif /* _FLOAT_H___ */
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/* Copyright (C) 1997-2013 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* ISO C Standard: 7.9 Alternative spellings <iso646.h>
|
||||
*/
|
||||
|
||||
#ifndef _ISO646_H
|
||||
#define _ISO646_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
#define and &&
|
||||
#define and_eq &=
|
||||
#define bitand &
|
||||
#define bitor |
|
||||
#define compl ~
|
||||
#define not !
|
||||
#define not_eq !=
|
||||
#define or ||
|
||||
#define or_eq |=
|
||||
#define xor ^
|
||||
#define xor_eq ^=
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,39 @@
|
|||
/* Copyright (C) 2011-2013 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* ISO C1X: 7.15 Alignment <stdalign.h>. */
|
||||
|
||||
#ifndef _STDALIGN_H
|
||||
#define _STDALIGN_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#define alignas _Alignas
|
||||
#define alignof _Alignof
|
||||
|
||||
#define __alignas_is_defined 1
|
||||
#define __alignof_is_defined 1
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* stdalign.h */
|
||||
|
|
@ -0,0 +1,126 @@
|
|||
/* Copyright (C) 1989-2013 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* ISO C Standard: 7.15 Variable arguments <stdarg.h>
|
||||
*/
|
||||
|
||||
#ifndef _STDARG_H
|
||||
#ifndef _ANSI_STDARG_H_
|
||||
#ifndef __need___va_list
|
||||
#define _STDARG_H
|
||||
#define _ANSI_STDARG_H_
|
||||
#endif /* not __need___va_list */
|
||||
#undef __need___va_list
|
||||
|
||||
/* Define __gnuc_va_list. */
|
||||
|
||||
#ifndef __GNUC_VA_LIST
|
||||
#define __GNUC_VA_LIST
|
||||
typedef __builtin_va_list __gnuc_va_list;
|
||||
#endif
|
||||
|
||||
/* Define the standard macros for the user,
|
||||
if this invocation was from the user program. */
|
||||
#ifdef _STDARG_H
|
||||
|
||||
#define va_start(v,l) __builtin_va_start(v,l)
|
||||
#define va_end(v) __builtin_va_end(v)
|
||||
#define va_arg(v,l) __builtin_va_arg(v,l)
|
||||
#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ + 0 >= 199900L || defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
#define va_copy(d,s) __builtin_va_copy(d,s)
|
||||
#endif
|
||||
#define __va_copy(d,s) __builtin_va_copy(d,s)
|
||||
|
||||
/* Define va_list, if desired, from __gnuc_va_list. */
|
||||
/* We deliberately do not define va_list when called from
|
||||
stdio.h, because ANSI C says that stdio.h is not supposed to define
|
||||
va_list. stdio.h needs to have access to that data type,
|
||||
but must not use that name. It should use the name __gnuc_va_list,
|
||||
which is safe because it is reserved for the implementation. */
|
||||
|
||||
#ifdef _BSD_VA_LIST
|
||||
#undef _BSD_VA_LIST
|
||||
#endif
|
||||
|
||||
#if defined(__svr4__) || (defined(_SCO_DS) && !defined(__VA_LIST))
|
||||
/* SVR4.2 uses _VA_LIST for an internal alias for va_list,
|
||||
so we must avoid testing it and setting it here.
|
||||
SVR4 uses _VA_LIST as a flag in stdarg.h, but we should
|
||||
have no conflict with that. */
|
||||
#ifndef _VA_LIST_
|
||||
#define _VA_LIST_
|
||||
#ifdef __i860__
|
||||
#ifndef _VA_LIST
|
||||
#define _VA_LIST va_list
|
||||
#endif
|
||||
#endif /* __i860__ */
|
||||
typedef __gnuc_va_list va_list;
|
||||
#ifdef _SCO_DS
|
||||
#define __VA_LIST
|
||||
#endif
|
||||
#endif /* _VA_LIST_ */
|
||||
#else /* not __svr4__ || _SCO_DS */
|
||||
|
||||
/* The macro _VA_LIST_ is the same thing used by this file in Ultrix.
|
||||
But on BSD NET2 we must not test or define or undef it.
|
||||
(Note that the comments in NET 2's ansi.h
|
||||
are incorrect for _VA_LIST_--see stdio.h!) */
|
||||
#if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__) || defined(WINNT)
|
||||
/* The macro _VA_LIST_DEFINED is used in Windows NT 3.5 */
|
||||
#ifndef _VA_LIST_DEFINED
|
||||
/* The macro _VA_LIST is used in SCO Unix 3.2. */
|
||||
#ifndef _VA_LIST
|
||||
/* The macro _VA_LIST_T_H is used in the Bull dpx2 */
|
||||
#ifndef _VA_LIST_T_H
|
||||
/* The macro __va_list__ is used by BeOS. */
|
||||
#ifndef __va_list__
|
||||
typedef __gnuc_va_list va_list;
|
||||
#endif /* not __va_list__ */
|
||||
#endif /* not _VA_LIST_T_H */
|
||||
#endif /* not _VA_LIST */
|
||||
#endif /* not _VA_LIST_DEFINED */
|
||||
#if !(defined (__BSD_NET2__) || defined (____386BSD____) || defined (__bsdi__) || defined (__sequent__) || defined (__FreeBSD__))
|
||||
#define _VA_LIST_
|
||||
#endif
|
||||
#ifndef _VA_LIST
|
||||
#define _VA_LIST
|
||||
#endif
|
||||
#ifndef _VA_LIST_DEFINED
|
||||
#define _VA_LIST_DEFINED
|
||||
#endif
|
||||
#ifndef _VA_LIST_T_H
|
||||
#define _VA_LIST_T_H
|
||||
#endif
|
||||
#ifndef __va_list__
|
||||
#define __va_list__
|
||||
#endif
|
||||
|
||||
#endif /* not _VA_LIST_, except on certain systems */
|
||||
|
||||
#endif /* not __svr4__ */
|
||||
|
||||
#endif /* _STDARG_H */
|
||||
|
||||
#endif /* not _ANSI_STDARG_H_ */
|
||||
#endif /* not _STDARG_H */
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
/* Copyright (C) 1998-2013 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* ISO C Standard: 7.16 Boolean type and values <stdbool.h>
|
||||
*/
|
||||
|
||||
#ifndef _STDBOOL_H
|
||||
#define _STDBOOL_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#define bool _Bool
|
||||
#define true 1
|
||||
#define false 0
|
||||
|
||||
#else /* __cplusplus */
|
||||
|
||||
/* Supporting <stdbool.h> in C++ is a GCC extension. */
|
||||
#define _Bool bool
|
||||
#define bool bool
|
||||
#define false false
|
||||
#define true true
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Signal that all the definitions are present. */
|
||||
#define __bool_true_false_are_defined 1
|
||||
|
||||
#endif /* stdbool.h */
|
||||
|
|
@ -0,0 +1,439 @@
|
|||
/* Copyright (C) 1989-2013 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* ISO C Standard: 7.17 Common definitions <stddef.h>
|
||||
*/
|
||||
#if (!defined(_STDDEF_H) && !defined(_STDDEF_H_) && !defined(_ANSI_STDDEF_H) \
|
||||
&& !defined(__STDDEF_H__)) \
|
||||
|| defined(__need_wchar_t) || defined(__need_size_t) \
|
||||
|| defined(__need_ptrdiff_t) || defined(__need_NULL) \
|
||||
|| defined(__need_wint_t)
|
||||
|
||||
/* Any one of these symbols __need_* means that GNU libc
|
||||
wants us just to define one data type. So don't define
|
||||
the symbols that indicate this file's entire job has been done. */
|
||||
#if (!defined(__need_wchar_t) && !defined(__need_size_t) \
|
||||
&& !defined(__need_ptrdiff_t) && !defined(__need_NULL) \
|
||||
&& !defined(__need_wint_t))
|
||||
#define _STDDEF_H
|
||||
#define _STDDEF_H_
|
||||
/* snaroff@next.com says the NeXT needs this. */
|
||||
#define _ANSI_STDDEF_H
|
||||
#endif
|
||||
|
||||
#ifndef __sys_stdtypes_h
|
||||
/* This avoids lossage on SunOS but only if stdtypes.h comes first.
|
||||
There's no way to win with the other order! Sun lossage. */
|
||||
|
||||
/* On 4.3bsd-net2, make sure ansi.h is included, so we have
|
||||
one less case to deal with in the following. */
|
||||
#if defined (__BSD_NET2__) || defined (____386BSD____) || (defined (__FreeBSD__) && (__FreeBSD__ < 5)) || defined(__NetBSD__)
|
||||
#include <machine/ansi.h>
|
||||
#endif
|
||||
/* On FreeBSD 5, machine/ansi.h does not exist anymore... */
|
||||
#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
|
||||
#include <sys/_types.h>
|
||||
#endif
|
||||
|
||||
/* In 4.3bsd-net2, machine/ansi.h defines these symbols, which are
|
||||
defined if the corresponding type is *not* defined.
|
||||
FreeBSD-2.1 defines _MACHINE_ANSI_H_ instead of _ANSI_H_.
|
||||
NetBSD defines _I386_ANSI_H_ and _X86_64_ANSI_H_ instead of _ANSI_H_ */
|
||||
#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_)
|
||||
#if !defined(_SIZE_T_) && !defined(_BSD_SIZE_T_)
|
||||
#define _SIZE_T
|
||||
#endif
|
||||
#if !defined(_PTRDIFF_T_) && !defined(_BSD_PTRDIFF_T_)
|
||||
#define _PTRDIFF_T
|
||||
#endif
|
||||
/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
|
||||
instead of _WCHAR_T_. */
|
||||
#if !defined(_WCHAR_T_) && !defined(_BSD_WCHAR_T_)
|
||||
#ifndef _BSD_WCHAR_T_
|
||||
#define _WCHAR_T
|
||||
#endif
|
||||
#endif
|
||||
/* Undef _FOO_T_ if we are supposed to define foo_t. */
|
||||
#if defined (__need_ptrdiff_t) || defined (_STDDEF_H_)
|
||||
#undef _PTRDIFF_T_
|
||||
#undef _BSD_PTRDIFF_T_
|
||||
#endif
|
||||
#if defined (__need_size_t) || defined (_STDDEF_H_)
|
||||
#undef _SIZE_T_
|
||||
#undef _BSD_SIZE_T_
|
||||
#endif
|
||||
#if defined (__need_wchar_t) || defined (_STDDEF_H_)
|
||||
#undef _WCHAR_T_
|
||||
#undef _BSD_WCHAR_T_
|
||||
#endif
|
||||
#endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_) */
|
||||
|
||||
/* Sequent's header files use _PTRDIFF_T_ in some conflicting way.
|
||||
Just ignore it. */
|
||||
#if defined (__sequent__) && defined (_PTRDIFF_T_)
|
||||
#undef _PTRDIFF_T_
|
||||
#endif
|
||||
|
||||
/* On VxWorks, <type/vxTypesBase.h> may have defined macros like
|
||||
_TYPE_size_t which will typedef size_t. fixincludes patched the
|
||||
vxTypesBase.h so that this macro is only defined if _GCC_SIZE_T is
|
||||
not defined, and so that defining this macro defines _GCC_SIZE_T.
|
||||
If we find that the macros are still defined at this point, we must
|
||||
invoke them so that the type is defined as expected. */
|
||||
#if defined (_TYPE_ptrdiff_t) && (defined (__need_ptrdiff_t) || defined (_STDDEF_H_))
|
||||
_TYPE_ptrdiff_t;
|
||||
#undef _TYPE_ptrdiff_t
|
||||
#endif
|
||||
#if defined (_TYPE_size_t) && (defined (__need_size_t) || defined (_STDDEF_H_))
|
||||
_TYPE_size_t;
|
||||
#undef _TYPE_size_t
|
||||
#endif
|
||||
#if defined (_TYPE_wchar_t) && (defined (__need_wchar_t) || defined (_STDDEF_H_))
|
||||
_TYPE_wchar_t;
|
||||
#undef _TYPE_wchar_t
|
||||
#endif
|
||||
|
||||
/* In case nobody has defined these types, but we aren't running under
|
||||
GCC 2.00, make sure that __PTRDIFF_TYPE__, __SIZE_TYPE__, and
|
||||
__WCHAR_TYPE__ have reasonable values. This can happen if the
|
||||
parts of GCC is compiled by an older compiler, that actually
|
||||
include gstddef.h, such as collect2. */
|
||||
|
||||
/* Signed type of difference of two pointers. */
|
||||
|
||||
/* Define this type if we are doing the whole job,
|
||||
or if we want this type in particular. */
|
||||
#if defined (_STDDEF_H) || defined (__need_ptrdiff_t)
|
||||
#ifndef _PTRDIFF_T /* in case <sys/types.h> has defined it. */
|
||||
#ifndef _T_PTRDIFF_
|
||||
#ifndef _T_PTRDIFF
|
||||
#ifndef __PTRDIFF_T
|
||||
#ifndef _PTRDIFF_T_
|
||||
#ifndef _BSD_PTRDIFF_T_
|
||||
#ifndef ___int_ptrdiff_t_h
|
||||
#ifndef _GCC_PTRDIFF_T
|
||||
#define _PTRDIFF_T
|
||||
#define _T_PTRDIFF_
|
||||
#define _T_PTRDIFF
|
||||
#define __PTRDIFF_T
|
||||
#define _PTRDIFF_T_
|
||||
#define _BSD_PTRDIFF_T_
|
||||
#define ___int_ptrdiff_t_h
|
||||
#define _GCC_PTRDIFF_T
|
||||
#ifndef __PTRDIFF_TYPE__
|
||||
#define __PTRDIFF_TYPE__ long int
|
||||
#endif
|
||||
typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
||||
#endif /* _GCC_PTRDIFF_T */
|
||||
#endif /* ___int_ptrdiff_t_h */
|
||||
#endif /* _BSD_PTRDIFF_T_ */
|
||||
#endif /* _PTRDIFF_T_ */
|
||||
#endif /* __PTRDIFF_T */
|
||||
#endif /* _T_PTRDIFF */
|
||||
#endif /* _T_PTRDIFF_ */
|
||||
#endif /* _PTRDIFF_T */
|
||||
|
||||
/* If this symbol has done its job, get rid of it. */
|
||||
#undef __need_ptrdiff_t
|
||||
|
||||
#endif /* _STDDEF_H or __need_ptrdiff_t. */
|
||||
|
||||
/* Unsigned type of `sizeof' something. */
|
||||
|
||||
/* Define this type if we are doing the whole job,
|
||||
or if we want this type in particular. */
|
||||
#if defined (_STDDEF_H) || defined (__need_size_t)
|
||||
#ifndef __size_t__ /* BeOS */
|
||||
#ifndef __SIZE_T__ /* Cray Unicos/Mk */
|
||||
#ifndef _SIZE_T /* in case <sys/types.h> has defined it. */
|
||||
#ifndef _SYS_SIZE_T_H
|
||||
#ifndef _T_SIZE_
|
||||
#ifndef _T_SIZE
|
||||
#ifndef __SIZE_T
|
||||
#ifndef _SIZE_T_
|
||||
#ifndef _BSD_SIZE_T_
|
||||
#ifndef _SIZE_T_DEFINED_
|
||||
#ifndef _SIZE_T_DEFINED
|
||||
#ifndef _BSD_SIZE_T_DEFINED_ /* Darwin */
|
||||
#ifndef _SIZE_T_DECLARED /* FreeBSD 5 */
|
||||
#ifndef ___int_size_t_h
|
||||
#ifndef _GCC_SIZE_T
|
||||
#ifndef _SIZET_
|
||||
#ifndef __size_t
|
||||
#define __size_t__ /* BeOS */
|
||||
#define __SIZE_T__ /* Cray Unicos/Mk */
|
||||
#define _SIZE_T
|
||||
#define _SYS_SIZE_T_H
|
||||
#define _T_SIZE_
|
||||
#define _T_SIZE
|
||||
#define __SIZE_T
|
||||
#define _SIZE_T_
|
||||
#define _BSD_SIZE_T_
|
||||
#define _SIZE_T_DEFINED_
|
||||
#define _SIZE_T_DEFINED
|
||||
#define _BSD_SIZE_T_DEFINED_ /* Darwin */
|
||||
#define _SIZE_T_DECLARED /* FreeBSD 5 */
|
||||
#define ___int_size_t_h
|
||||
#define _GCC_SIZE_T
|
||||
#define _SIZET_
|
||||
#if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
|
||||
|| defined(__FreeBSD_kernel__)
|
||||
/* __size_t is a typedef on FreeBSD 5, must not trash it. */
|
||||
#elif defined (__VMS__)
|
||||
/* __size_t is also a typedef on VMS. */
|
||||
#else
|
||||
#define __size_t
|
||||
#endif
|
||||
#ifndef __SIZE_TYPE__
|
||||
#define __SIZE_TYPE__ long unsigned int
|
||||
#endif
|
||||
#if !(defined (__GNUG__) && defined (size_t))
|
||||
typedef __SIZE_TYPE__ size_t;
|
||||
#ifdef __BEOS__
|
||||
typedef long ssize_t;
|
||||
#endif /* __BEOS__ */
|
||||
#endif /* !(defined (__GNUG__) && defined (size_t)) */
|
||||
#endif /* __size_t */
|
||||
#endif /* _SIZET_ */
|
||||
#endif /* _GCC_SIZE_T */
|
||||
#endif /* ___int_size_t_h */
|
||||
#endif /* _SIZE_T_DECLARED */
|
||||
#endif /* _BSD_SIZE_T_DEFINED_ */
|
||||
#endif /* _SIZE_T_DEFINED */
|
||||
#endif /* _SIZE_T_DEFINED_ */
|
||||
#endif /* _BSD_SIZE_T_ */
|
||||
#endif /* _SIZE_T_ */
|
||||
#endif /* __SIZE_T */
|
||||
#endif /* _T_SIZE */
|
||||
#endif /* _T_SIZE_ */
|
||||
#endif /* _SYS_SIZE_T_H */
|
||||
#endif /* _SIZE_T */
|
||||
#endif /* __SIZE_T__ */
|
||||
#endif /* __size_t__ */
|
||||
#undef __need_size_t
|
||||
#endif /* _STDDEF_H or __need_size_t. */
|
||||
|
||||
|
||||
/* Wide character type.
|
||||
Locale-writers should change this as necessary to
|
||||
be big enough to hold unique values not between 0 and 127,
|
||||
and not (wchar_t) -1, for each defined multibyte character. */
|
||||
|
||||
/* Define this type if we are doing the whole job,
|
||||
or if we want this type in particular. */
|
||||
#if defined (_STDDEF_H) || defined (__need_wchar_t)
|
||||
#ifndef __wchar_t__ /* BeOS */
|
||||
#ifndef __WCHAR_T__ /* Cray Unicos/Mk */
|
||||
#ifndef _WCHAR_T
|
||||
#ifndef _T_WCHAR_
|
||||
#ifndef _T_WCHAR
|
||||
#ifndef __WCHAR_T
|
||||
#ifndef _WCHAR_T_
|
||||
#ifndef _BSD_WCHAR_T_
|
||||
#ifndef _BSD_WCHAR_T_DEFINED_ /* Darwin */
|
||||
#ifndef _BSD_RUNE_T_DEFINED_ /* Darwin */
|
||||
#ifndef _WCHAR_T_DECLARED /* FreeBSD 5 */
|
||||
#ifndef _WCHAR_T_DEFINED_
|
||||
#ifndef _WCHAR_T_DEFINED
|
||||
#ifndef _WCHAR_T_H
|
||||
#ifndef ___int_wchar_t_h
|
||||
#ifndef __INT_WCHAR_T_H
|
||||
#ifndef _GCC_WCHAR_T
|
||||
#define __wchar_t__ /* BeOS */
|
||||
#define __WCHAR_T__ /* Cray Unicos/Mk */
|
||||
#define _WCHAR_T
|
||||
#define _T_WCHAR_
|
||||
#define _T_WCHAR
|
||||
#define __WCHAR_T
|
||||
#define _WCHAR_T_
|
||||
#define _BSD_WCHAR_T_
|
||||
#define _WCHAR_T_DEFINED_
|
||||
#define _WCHAR_T_DEFINED
|
||||
#define _WCHAR_T_H
|
||||
#define ___int_wchar_t_h
|
||||
#define __INT_WCHAR_T_H
|
||||
#define _GCC_WCHAR_T
|
||||
#define _WCHAR_T_DECLARED
|
||||
|
||||
/* On BSD/386 1.1, at least, machine/ansi.h defines _BSD_WCHAR_T_
|
||||
instead of _WCHAR_T_, and _BSD_RUNE_T_ (which, unlike the other
|
||||
symbols in the _FOO_T_ family, stays defined even after its
|
||||
corresponding type is defined). If we define wchar_t, then we
|
||||
must undef _WCHAR_T_; for BSD/386 1.1 (and perhaps others), if
|
||||
we undef _WCHAR_T_, then we must also define rune_t, since
|
||||
headers like runetype.h assume that if machine/ansi.h is included,
|
||||
and _BSD_WCHAR_T_ is not defined, then rune_t is available.
|
||||
machine/ansi.h says, "Note that _WCHAR_T_ and _RUNE_T_ must be of
|
||||
the same type." */
|
||||
#ifdef _BSD_WCHAR_T_
|
||||
#undef _BSD_WCHAR_T_
|
||||
#ifdef _BSD_RUNE_T_
|
||||
#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
|
||||
typedef _BSD_RUNE_T_ rune_t;
|
||||
#define _BSD_WCHAR_T_DEFINED_
|
||||
#define _BSD_RUNE_T_DEFINED_ /* Darwin */
|
||||
#if defined (__FreeBSD__) && (__FreeBSD__ < 5)
|
||||
/* Why is this file so hard to maintain properly? In contrast to
|
||||
the comment above regarding BSD/386 1.1, on FreeBSD for as long
|
||||
as the symbol has existed, _BSD_RUNE_T_ must not stay defined or
|
||||
redundant typedefs will occur when stdlib.h is included after this file. */
|
||||
#undef _BSD_RUNE_T_
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
/* FreeBSD 5 can't be handled well using "traditional" logic above
|
||||
since it no longer defines _BSD_RUNE_T_ yet still desires to export
|
||||
rune_t in some cases... */
|
||||
#if defined (__FreeBSD__) && (__FreeBSD__ >= 5)
|
||||
#if !defined (_ANSI_SOURCE) && !defined (_POSIX_SOURCE)
|
||||
#if __BSD_VISIBLE
|
||||
#ifndef _RUNE_T_DECLARED
|
||||
typedef __rune_t rune_t;
|
||||
#define _RUNE_T_DECLARED
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __WCHAR_TYPE__
|
||||
#define __WCHAR_TYPE__ int
|
||||
#endif
|
||||
#ifndef __cplusplus
|
||||
typedef __WCHAR_TYPE__ wchar_t;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif /* _WCHAR_T_DECLARED */
|
||||
#endif /* _BSD_RUNE_T_DEFINED_ */
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif /* __WCHAR_T__ */
|
||||
#endif /* __wchar_t__ */
|
||||
#undef __need_wchar_t
|
||||
#endif /* _STDDEF_H or __need_wchar_t. */
|
||||
|
||||
#if defined (__need_wint_t)
|
||||
#ifndef _WINT_T
|
||||
#define _WINT_T
|
||||
|
||||
#ifndef __WINT_TYPE__
|
||||
#define __WINT_TYPE__ unsigned int
|
||||
#endif
|
||||
typedef __WINT_TYPE__ wint_t;
|
||||
#endif
|
||||
#undef __need_wint_t
|
||||
#endif
|
||||
|
||||
/* In 4.3bsd-net2, leave these undefined to indicate that size_t, etc.
|
||||
are already defined. */
|
||||
/* BSD/OS 3.1 and FreeBSD [23].x require the MACHINE_ANSI_H check here. */
|
||||
/* NetBSD 5 requires the I386_ANSI_H and X86_64_ANSI_H checks here. */
|
||||
#if defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) || defined(_X86_64_ANSI_H_) || defined(_I386_ANSI_H_)
|
||||
/* The references to _GCC_PTRDIFF_T_, _GCC_SIZE_T_, and _GCC_WCHAR_T_
|
||||
are probably typos and should be removed before 2.8 is released. */
|
||||
#ifdef _GCC_PTRDIFF_T_
|
||||
#undef _PTRDIFF_T_
|
||||
#undef _BSD_PTRDIFF_T_
|
||||
#endif
|
||||
#ifdef _GCC_SIZE_T_
|
||||
#undef _SIZE_T_
|
||||
#undef _BSD_SIZE_T_
|
||||
#endif
|
||||
#ifdef _GCC_WCHAR_T_
|
||||
#undef _WCHAR_T_
|
||||
#undef _BSD_WCHAR_T_
|
||||
#endif
|
||||
/* The following ones are the real ones. */
|
||||
#ifdef _GCC_PTRDIFF_T
|
||||
#undef _PTRDIFF_T_
|
||||
#undef _BSD_PTRDIFF_T_
|
||||
#endif
|
||||
#ifdef _GCC_SIZE_T
|
||||
#undef _SIZE_T_
|
||||
#undef _BSD_SIZE_T_
|
||||
#endif
|
||||
#ifdef _GCC_WCHAR_T
|
||||
#undef _WCHAR_T_
|
||||
#undef _BSD_WCHAR_T_
|
||||
#endif
|
||||
#endif /* _ANSI_H_ || _MACHINE_ANSI_H_ || _X86_64_ANSI_H_ || _I386_ANSI_H_ */
|
||||
|
||||
#endif /* __sys_stdtypes_h */
|
||||
|
||||
/* A null pointer constant. */
|
||||
|
||||
#if defined (_STDDEF_H) || defined (__need_NULL)
|
||||
#undef NULL /* in case <stdio.h> has defined it. */
|
||||
#ifdef __GNUG__
|
||||
#define NULL __null
|
||||
#else /* G++ */
|
||||
#ifndef __cplusplus
|
||||
#define NULL ((void *)0)
|
||||
#else /* C++ */
|
||||
#define NULL 0
|
||||
#endif /* C++ */
|
||||
#endif /* G++ */
|
||||
#endif /* NULL not defined and <stddef.h> or need NULL. */
|
||||
#undef __need_NULL
|
||||
|
||||
#ifdef _STDDEF_H
|
||||
|
||||
/* Offset of member MEMBER in a struct of type TYPE. */
|
||||
#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
|
||||
|
||||
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \
|
||||
|| (defined(__cplusplus) && __cplusplus >= 201103L)
|
||||
#ifndef _GCC_MAX_ALIGN_T
|
||||
#define _GCC_MAX_ALIGN_T
|
||||
/* Type whose alignment is supported in every context and is at least
|
||||
as great as that of any standard type not using alignment
|
||||
specifiers. */
|
||||
typedef struct {
|
||||
long long __max_align_ll __attribute__((__aligned__(__alignof__(long long))));
|
||||
long double __max_align_ld __attribute__((__aligned__(__alignof__(long double))));
|
||||
} max_align_t;
|
||||
#endif
|
||||
#endif /* C11 or C++11. */
|
||||
|
||||
#if defined(__cplusplus) && __cplusplus >= 201103L
|
||||
#ifndef _GXX_NULLPTR_T
|
||||
#define _GXX_NULLPTR_T
|
||||
typedef decltype(nullptr) nullptr_t;
|
||||
#endif
|
||||
#endif /* C++11. */
|
||||
|
||||
#endif /* _STDDEF_H was defined this time */
|
||||
|
||||
#endif /* !_STDDEF_H && !_STDDEF_H_ && !_ANSI_STDDEF_H && !__STDDEF_H__
|
||||
|| __need_XXX was not defined before */
|
||||
|
|
@ -0,0 +1,204 @@
|
|||
/* Copyright (C) 2007-2013 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* ISO/IEC JTC1 SC22 WG14 N1169
|
||||
* Date: 2006-04-04
|
||||
* ISO/IEC TR 18037
|
||||
* Programming languages - C - Extensions to support embedded processors
|
||||
*/
|
||||
|
||||
#ifndef _STDFIX_H
|
||||
#define _STDFIX_H
|
||||
|
||||
/* 7.18a.1 Introduction. */
|
||||
|
||||
#undef fract
|
||||
#undef accum
|
||||
#undef sat
|
||||
#define fract _Fract
|
||||
#define accum _Accum
|
||||
#define sat _Sat
|
||||
|
||||
/* 7.18a.3 Precision macros. */
|
||||
|
||||
#undef SFRACT_FBIT
|
||||
#undef SFRACT_MIN
|
||||
#undef SFRACT_MAX
|
||||
#undef SFRACT_EPSILON
|
||||
#define SFRACT_FBIT __SFRACT_FBIT__
|
||||
#define SFRACT_MIN __SFRACT_MIN__
|
||||
#define SFRACT_MAX __SFRACT_MAX__
|
||||
#define SFRACT_EPSILON __SFRACT_EPSILON__
|
||||
|
||||
#undef USFRACT_FBIT
|
||||
#undef USFRACT_MIN
|
||||
#undef USFRACT_MAX
|
||||
#undef USFRACT_EPSILON
|
||||
#define USFRACT_FBIT __USFRACT_FBIT__
|
||||
#define USFRACT_MIN __USFRACT_MIN__ /* GCC extension. */
|
||||
#define USFRACT_MAX __USFRACT_MAX__
|
||||
#define USFRACT_EPSILON __USFRACT_EPSILON__
|
||||
|
||||
#undef FRACT_FBIT
|
||||
#undef FRACT_MIN
|
||||
#undef FRACT_MAX
|
||||
#undef FRACT_EPSILON
|
||||
#define FRACT_FBIT __FRACT_FBIT__
|
||||
#define FRACT_MIN __FRACT_MIN__
|
||||
#define FRACT_MAX __FRACT_MAX__
|
||||
#define FRACT_EPSILON __FRACT_EPSILON__
|
||||
|
||||
#undef UFRACT_FBIT
|
||||
#undef UFRACT_MIN
|
||||
#undef UFRACT_MAX
|
||||
#undef UFRACT_EPSILON
|
||||
#define UFRACT_FBIT __UFRACT_FBIT__
|
||||
#define UFRACT_MIN __UFRACT_MIN__ /* GCC extension. */
|
||||
#define UFRACT_MAX __UFRACT_MAX__
|
||||
#define UFRACT_EPSILON __UFRACT_EPSILON__
|
||||
|
||||
#undef LFRACT_FBIT
|
||||
#undef LFRACT_MIN
|
||||
#undef LFRACT_MAX
|
||||
#undef LFRACT_EPSILON
|
||||
#define LFRACT_FBIT __LFRACT_FBIT__
|
||||
#define LFRACT_MIN __LFRACT_MIN__
|
||||
#define LFRACT_MAX __LFRACT_MAX__
|
||||
#define LFRACT_EPSILON __LFRACT_EPSILON__
|
||||
|
||||
#undef ULFRACT_FBIT
|
||||
#undef ULFRACT_MIN
|
||||
#undef ULFRACT_MAX
|
||||
#undef ULFRACT_EPSILON
|
||||
#define ULFRACT_FBIT __ULFRACT_FBIT__
|
||||
#define ULFRACT_MIN __ULFRACT_MIN__ /* GCC extension. */
|
||||
#define ULFRACT_MAX __ULFRACT_MAX__
|
||||
#define ULFRACT_EPSILON __ULFRACT_EPSILON__
|
||||
|
||||
#undef LLFRACT_FBIT
|
||||
#undef LLFRACT_MIN
|
||||
#undef LLFRACT_MAX
|
||||
#undef LLFRACT_EPSILON
|
||||
#define LLFRACT_FBIT __LLFRACT_FBIT__ /* GCC extension. */
|
||||
#define LLFRACT_MIN __LLFRACT_MIN__ /* GCC extension. */
|
||||
#define LLFRACT_MAX __LLFRACT_MAX__ /* GCC extension. */
|
||||
#define LLFRACT_EPSILON __LLFRACT_EPSILON__ /* GCC extension. */
|
||||
|
||||
#undef ULLFRACT_FBIT
|
||||
#undef ULLFRACT_MIN
|
||||
#undef ULLFRACT_MAX
|
||||
#undef ULLFRACT_EPSILON
|
||||
#define ULLFRACT_FBIT __ULLFRACT_FBIT__ /* GCC extension. */
|
||||
#define ULLFRACT_MIN __ULLFRACT_MIN__ /* GCC extension. */
|
||||
#define ULLFRACT_MAX __ULLFRACT_MAX__ /* GCC extension. */
|
||||
#define ULLFRACT_EPSILON __ULLFRACT_EPSILON__ /* GCC extension. */
|
||||
|
||||
#undef SACCUM_FBIT
|
||||
#undef SACCUM_IBIT
|
||||
#undef SACCUM_MIN
|
||||
#undef SACCUM_MAX
|
||||
#undef SACCUM_EPSILON
|
||||
#define SACCUM_FBIT __SACCUM_FBIT__
|
||||
#define SACCUM_IBIT __SACCUM_IBIT__
|
||||
#define SACCUM_MIN __SACCUM_MIN__
|
||||
#define SACCUM_MAX __SACCUM_MAX__
|
||||
#define SACCUM_EPSILON __SACCUM_EPSILON__
|
||||
|
||||
#undef USACCUM_FBIT
|
||||
#undef USACCUM_IBIT
|
||||
#undef USACCUM_MIN
|
||||
#undef USACCUM_MAX
|
||||
#undef USACCUM_EPSILON
|
||||
#define USACCUM_FBIT __USACCUM_FBIT__
|
||||
#define USACCUM_IBIT __USACCUM_IBIT__
|
||||
#define USACCUM_MIN __USACCUM_MIN__ /* GCC extension. */
|
||||
#define USACCUM_MAX __USACCUM_MAX__
|
||||
#define USACCUM_EPSILON __USACCUM_EPSILON__
|
||||
|
||||
#undef ACCUM_FBIT
|
||||
#undef ACCUM_IBIT
|
||||
#undef ACCUM_MIN
|
||||
#undef ACCUM_MAX
|
||||
#undef ACCUM_EPSILON
|
||||
#define ACCUM_FBIT __ACCUM_FBIT__
|
||||
#define ACCUM_IBIT __ACCUM_IBIT__
|
||||
#define ACCUM_MIN __ACCUM_MIN__
|
||||
#define ACCUM_MAX __ACCUM_MAX__
|
||||
#define ACCUM_EPSILON __ACCUM_EPSILON__
|
||||
|
||||
#undef UACCUM_FBIT
|
||||
#undef UACCUM_IBIT
|
||||
#undef UACCUM_MIN
|
||||
#undef UACCUM_MAX
|
||||
#undef UACCUM_EPSILON
|
||||
#define UACCUM_FBIT __UACCUM_FBIT__
|
||||
#define UACCUM_IBIT __UACCUM_IBIT__
|
||||
#define UACCUM_MIN __UACCUM_MIN__ /* GCC extension. */
|
||||
#define UACCUM_MAX __UACCUM_MAX__
|
||||
#define UACCUM_EPSILON __UACCUM_EPSILON__
|
||||
|
||||
#undef LACCUM_FBIT
|
||||
#undef LACCUM_IBIT
|
||||
#undef LACCUM_MIN
|
||||
#undef LACCUM_MAX
|
||||
#undef LACCUM_EPSILON
|
||||
#define LACCUM_FBIT __LACCUM_FBIT__
|
||||
#define LACCUM_IBIT __LACCUM_IBIT__
|
||||
#define LACCUM_MIN __LACCUM_MIN__
|
||||
#define LACCUM_MAX __LACCUM_MAX__
|
||||
#define LACCUM_EPSILON __LACCUM_EPSILON__
|
||||
|
||||
#undef ULACCUM_FBIT
|
||||
#undef ULACCUM_IBIT
|
||||
#undef ULACCUM_MIN
|
||||
#undef ULACCUM_MAX
|
||||
#undef ULACCUM_EPSILON
|
||||
#define ULACCUM_FBIT __ULACCUM_FBIT__
|
||||
#define ULACCUM_IBIT __ULACCUM_IBIT__
|
||||
#define ULACCUM_MIN __ULACCUM_MIN__ /* GCC extension. */
|
||||
#define ULACCUM_MAX __ULACCUM_MAX__
|
||||
#define ULACCUM_EPSILON __ULACCUM_EPSILON__
|
||||
|
||||
#undef LLACCUM_FBIT
|
||||
#undef LLACCUM_IBIT
|
||||
#undef LLACCUM_MIN
|
||||
#undef LLACCUM_MAX
|
||||
#undef LLACCUM_EPSILON
|
||||
#define LLACCUM_FBIT __LLACCUM_FBIT__ /* GCC extension. */
|
||||
#define LLACCUM_IBIT __LLACCUM_IBIT__ /* GCC extension. */
|
||||
#define LLACCUM_MIN __LLACCUM_MIN__ /* GCC extension. */
|
||||
#define LLACCUM_MAX __LLACCUM_MAX__ /* GCC extension. */
|
||||
#define LLACCUM_EPSILON __LLACCUM_EPSILON__ /* GCC extension. */
|
||||
|
||||
#undef ULLACCUM_FBIT
|
||||
#undef ULLACCUM_IBIT
|
||||
#undef ULLACCUM_MIN
|
||||
#undef ULLACCUM_MAX
|
||||
#undef ULLACCUM_EPSILON
|
||||
#define ULLACCUM_FBIT __ULLACCUM_FBIT__ /* GCC extension. */
|
||||
#define ULLACCUM_IBIT __ULLACCUM_IBIT__ /* GCC extension. */
|
||||
#define ULLACCUM_MIN __ULLACCUM_MIN__ /* GCC extension. */
|
||||
#define ULLACCUM_MAX __ULLACCUM_MAX__ /* GCC extension. */
|
||||
#define ULLACCUM_EPSILON __ULLACCUM_EPSILON__ /* GCC extension. */
|
||||
|
||||
#endif /* _STDFIX_H */
|
||||
|
|
@ -0,0 +1,263 @@
|
|||
/* Copyright (C) 2008-2013 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* ISO C Standard: 7.18 Integer types <stdint.h>
|
||||
*/
|
||||
|
||||
#ifndef _GCC_STDINT_H
|
||||
#define _GCC_STDINT_H
|
||||
|
||||
/* 7.8.1.1 Exact-width integer types */
|
||||
|
||||
#ifdef __INT8_TYPE__
|
||||
typedef __INT8_TYPE__ int8_t;
|
||||
#endif
|
||||
#ifdef __INT16_TYPE__
|
||||
typedef __INT16_TYPE__ int16_t;
|
||||
#endif
|
||||
#ifdef __INT32_TYPE__
|
||||
typedef __INT32_TYPE__ int32_t;
|
||||
#endif
|
||||
#ifdef __INT64_TYPE__
|
||||
typedef __INT64_TYPE__ int64_t;
|
||||
#endif
|
||||
#ifdef __UINT8_TYPE__
|
||||
typedef __UINT8_TYPE__ uint8_t;
|
||||
#endif
|
||||
#ifdef __UINT16_TYPE__
|
||||
typedef __UINT16_TYPE__ uint16_t;
|
||||
#endif
|
||||
#ifdef __UINT32_TYPE__
|
||||
typedef __UINT32_TYPE__ uint32_t;
|
||||
#endif
|
||||
#ifdef __UINT64_TYPE__
|
||||
typedef __UINT64_TYPE__ uint64_t;
|
||||
#endif
|
||||
|
||||
/* 7.8.1.2 Minimum-width integer types */
|
||||
|
||||
typedef __INT_LEAST8_TYPE__ int_least8_t;
|
||||
typedef __INT_LEAST16_TYPE__ int_least16_t;
|
||||
typedef __INT_LEAST32_TYPE__ int_least32_t;
|
||||
typedef __INT_LEAST64_TYPE__ int_least64_t;
|
||||
typedef __UINT_LEAST8_TYPE__ uint_least8_t;
|
||||
typedef __UINT_LEAST16_TYPE__ uint_least16_t;
|
||||
typedef __UINT_LEAST32_TYPE__ uint_least32_t;
|
||||
typedef __UINT_LEAST64_TYPE__ uint_least64_t;
|
||||
|
||||
/* 7.8.1.3 Fastest minimum-width integer types */
|
||||
|
||||
typedef __INT_FAST8_TYPE__ int_fast8_t;
|
||||
typedef __INT_FAST16_TYPE__ int_fast16_t;
|
||||
typedef __INT_FAST32_TYPE__ int_fast32_t;
|
||||
typedef __INT_FAST64_TYPE__ int_fast64_t;
|
||||
typedef __UINT_FAST8_TYPE__ uint_fast8_t;
|
||||
typedef __UINT_FAST16_TYPE__ uint_fast16_t;
|
||||
typedef __UINT_FAST32_TYPE__ uint_fast32_t;
|
||||
typedef __UINT_FAST64_TYPE__ uint_fast64_t;
|
||||
|
||||
/* 7.8.1.4 Integer types capable of holding object pointers */
|
||||
|
||||
#ifdef __INTPTR_TYPE__
|
||||
typedef __INTPTR_TYPE__ intptr_t;
|
||||
#endif
|
||||
#ifdef __UINTPTR_TYPE__
|
||||
typedef __UINTPTR_TYPE__ uintptr_t;
|
||||
#endif
|
||||
|
||||
/* 7.8.1.5 Greatest-width integer types */
|
||||
|
||||
typedef __INTMAX_TYPE__ intmax_t;
|
||||
typedef __UINTMAX_TYPE__ uintmax_t;
|
||||
|
||||
#if (!defined __cplusplus || __cplusplus >= 201103L \
|
||||
|| defined __STDC_LIMIT_MACROS)
|
||||
|
||||
/* 7.18.2 Limits of specified-width integer types */
|
||||
|
||||
#ifdef __INT8_MAX__
|
||||
# undef INT8_MAX
|
||||
# define INT8_MAX __INT8_MAX__
|
||||
# undef INT8_MIN
|
||||
# define INT8_MIN (-INT8_MAX - 1)
|
||||
#endif
|
||||
#ifdef __UINT8_MAX__
|
||||
# undef UINT8_MAX
|
||||
# define UINT8_MAX __UINT8_MAX__
|
||||
#endif
|
||||
#ifdef __INT16_MAX__
|
||||
# undef INT16_MAX
|
||||
# define INT16_MAX __INT16_MAX__
|
||||
# undef INT16_MIN
|
||||
# define INT16_MIN (-INT16_MAX - 1)
|
||||
#endif
|
||||
#ifdef __UINT16_MAX__
|
||||
# undef UINT16_MAX
|
||||
# define UINT16_MAX __UINT16_MAX__
|
||||
#endif
|
||||
#ifdef __INT32_MAX__
|
||||
# undef INT32_MAX
|
||||
# define INT32_MAX __INT32_MAX__
|
||||
# undef INT32_MIN
|
||||
# define INT32_MIN (-INT32_MAX - 1)
|
||||
#endif
|
||||
#ifdef __UINT32_MAX__
|
||||
# undef UINT32_MAX
|
||||
# define UINT32_MAX __UINT32_MAX__
|
||||
#endif
|
||||
#ifdef __INT64_MAX__
|
||||
# undef INT64_MAX
|
||||
# define INT64_MAX __INT64_MAX__
|
||||
# undef INT64_MIN
|
||||
# define INT64_MIN (-INT64_MAX - 1)
|
||||
#endif
|
||||
#ifdef __UINT64_MAX__
|
||||
# undef UINT64_MAX
|
||||
# define UINT64_MAX __UINT64_MAX__
|
||||
#endif
|
||||
|
||||
#undef INT_LEAST8_MAX
|
||||
#define INT_LEAST8_MAX __INT_LEAST8_MAX__
|
||||
#undef INT_LEAST8_MIN
|
||||
#define INT_LEAST8_MIN (-INT_LEAST8_MAX - 1)
|
||||
#undef UINT_LEAST8_MAX
|
||||
#define UINT_LEAST8_MAX __UINT_LEAST8_MAX__
|
||||
#undef INT_LEAST16_MAX
|
||||
#define INT_LEAST16_MAX __INT_LEAST16_MAX__
|
||||
#undef INT_LEAST16_MIN
|
||||
#define INT_LEAST16_MIN (-INT_LEAST16_MAX - 1)
|
||||
#undef UINT_LEAST16_MAX
|
||||
#define UINT_LEAST16_MAX __UINT_LEAST16_MAX__
|
||||
#undef INT_LEAST32_MAX
|
||||
#define INT_LEAST32_MAX __INT_LEAST32_MAX__
|
||||
#undef INT_LEAST32_MIN
|
||||
#define INT_LEAST32_MIN (-INT_LEAST32_MAX - 1)
|
||||
#undef UINT_LEAST32_MAX
|
||||
#define UINT_LEAST32_MAX __UINT_LEAST32_MAX__
|
||||
#undef INT_LEAST64_MAX
|
||||
#define INT_LEAST64_MAX __INT_LEAST64_MAX__
|
||||
#undef INT_LEAST64_MIN
|
||||
#define INT_LEAST64_MIN (-INT_LEAST64_MAX - 1)
|
||||
#undef UINT_LEAST64_MAX
|
||||
#define UINT_LEAST64_MAX __UINT_LEAST64_MAX__
|
||||
|
||||
#undef INT_FAST8_MAX
|
||||
#define INT_FAST8_MAX __INT_FAST8_MAX__
|
||||
#undef INT_FAST8_MIN
|
||||
#define INT_FAST8_MIN (-INT_FAST8_MAX - 1)
|
||||
#undef UINT_FAST8_MAX
|
||||
#define UINT_FAST8_MAX __UINT_FAST8_MAX__
|
||||
#undef INT_FAST16_MAX
|
||||
#define INT_FAST16_MAX __INT_FAST16_MAX__
|
||||
#undef INT_FAST16_MIN
|
||||
#define INT_FAST16_MIN (-INT_FAST16_MAX - 1)
|
||||
#undef UINT_FAST16_MAX
|
||||
#define UINT_FAST16_MAX __UINT_FAST16_MAX__
|
||||
#undef INT_FAST32_MAX
|
||||
#define INT_FAST32_MAX __INT_FAST32_MAX__
|
||||
#undef INT_FAST32_MIN
|
||||
#define INT_FAST32_MIN (-INT_FAST32_MAX - 1)
|
||||
#undef UINT_FAST32_MAX
|
||||
#define UINT_FAST32_MAX __UINT_FAST32_MAX__
|
||||
#undef INT_FAST64_MAX
|
||||
#define INT_FAST64_MAX __INT_FAST64_MAX__
|
||||
#undef INT_FAST64_MIN
|
||||
#define INT_FAST64_MIN (-INT_FAST64_MAX - 1)
|
||||
#undef UINT_FAST64_MAX
|
||||
#define UINT_FAST64_MAX __UINT_FAST64_MAX__
|
||||
|
||||
#ifdef __INTPTR_MAX__
|
||||
# undef INTPTR_MAX
|
||||
# define INTPTR_MAX __INTPTR_MAX__
|
||||
# undef INTPTR_MIN
|
||||
# define INTPTR_MIN (-INTPTR_MAX - 1)
|
||||
#endif
|
||||
#ifdef __UINTPTR_MAX__
|
||||
# undef UINTPTR_MAX
|
||||
# define UINTPTR_MAX __UINTPTR_MAX__
|
||||
#endif
|
||||
|
||||
#undef INTMAX_MAX
|
||||
#define INTMAX_MAX __INTMAX_MAX__
|
||||
#undef INTMAX_MIN
|
||||
#define INTMAX_MIN (-INTMAX_MAX - 1)
|
||||
#undef UINTMAX_MAX
|
||||
#define UINTMAX_MAX __UINTMAX_MAX__
|
||||
|
||||
/* 7.18.3 Limits of other integer types */
|
||||
|
||||
#undef PTRDIFF_MAX
|
||||
#define PTRDIFF_MAX __PTRDIFF_MAX__
|
||||
#undef PTRDIFF_MIN
|
||||
#define PTRDIFF_MIN (-PTRDIFF_MAX - 1)
|
||||
|
||||
#undef SIG_ATOMIC_MAX
|
||||
#define SIG_ATOMIC_MAX __SIG_ATOMIC_MAX__
|
||||
#undef SIG_ATOMIC_MIN
|
||||
#define SIG_ATOMIC_MIN __SIG_ATOMIC_MIN__
|
||||
|
||||
#undef SIZE_MAX
|
||||
#define SIZE_MAX __SIZE_MAX__
|
||||
|
||||
#undef WCHAR_MAX
|
||||
#define WCHAR_MAX __WCHAR_MAX__
|
||||
#undef WCHAR_MIN
|
||||
#define WCHAR_MIN __WCHAR_MIN__
|
||||
|
||||
#undef WINT_MAX
|
||||
#define WINT_MAX __WINT_MAX__
|
||||
#undef WINT_MIN
|
||||
#define WINT_MIN __WINT_MIN__
|
||||
|
||||
#endif /* (!defined __cplusplus || __cplusplus >= 201103L
|
||||
|| defined __STDC_LIMIT_MACROS) */
|
||||
|
||||
#if (!defined __cplusplus || __cplusplus >= 201103L \
|
||||
|| defined __STDC_CONSTANT_MACROS)
|
||||
|
||||
#undef INT8_C
|
||||
#define INT8_C(c) __INT8_C(c)
|
||||
#undef INT16_C
|
||||
#define INT16_C(c) __INT16_C(c)
|
||||
#undef INT32_C
|
||||
#define INT32_C(c) __INT32_C(c)
|
||||
#undef INT64_C
|
||||
#define INT64_C(c) __INT64_C(c)
|
||||
#undef UINT8_C
|
||||
#define UINT8_C(c) __UINT8_C(c)
|
||||
#undef UINT16_C
|
||||
#define UINT16_C(c) __UINT16_C(c)
|
||||
#undef UINT32_C
|
||||
#define UINT32_C(c) __UINT32_C(c)
|
||||
#undef UINT64_C
|
||||
#define UINT64_C(c) __UINT64_C(c)
|
||||
#undef INTMAX_C
|
||||
#define INTMAX_C(c) __INTMAX_C(c)
|
||||
#undef UINTMAX_C
|
||||
#define UINTMAX_C(c) __UINTMAX_C(c)
|
||||
|
||||
#endif /* (!defined __cplusplus || __cplusplus >= 201103L
|
||||
|| defined __STDC_CONSTANT_MACROS) */
|
||||
|
||||
#endif /* _GCC_STDINT_H */
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
#ifndef _GCC_WRAP_STDINT_H
|
||||
#if __STDC_HOSTED__
|
||||
# if defined __cplusplus && __cplusplus >= 201103L
|
||||
# undef __STDC_LIMIT_MACROS
|
||||
# define __STDC_LIMIT_MACROS
|
||||
# undef __STDC_CONSTANT_MACROS
|
||||
# define __STDC_CONSTANT_MACROS
|
||||
# endif
|
||||
# include_next <stdint.h>
|
||||
#else
|
||||
# include "stdint-gcc.h"
|
||||
#endif
|
||||
#define _GCC_WRAP_STDINT_H
|
||||
#endif
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/* Copyright (C) 2011-2013 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* ISO C1X: 7.23 _Noreturn <stdnoreturn.h>. */
|
||||
|
||||
#ifndef _STDNORETURN_H
|
||||
#define _STDNORETURN_H
|
||||
|
||||
#ifndef __cplusplus
|
||||
|
||||
#define noreturn _Noreturn
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* stdnoreturn.h */
|
||||
|
|
@ -0,0 +1,171 @@
|
|||
/* Copyright (C) 2004-2013 Free Software Foundation, Inc.
|
||||
Contributed by Apple, 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/*
|
||||
* ISO C Standard: 7.22 Type-generic math <tgmath.h>
|
||||
*/
|
||||
|
||||
#ifndef _TGMATH_H
|
||||
#define _TGMATH_H
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#ifndef __cplusplus
|
||||
#include <complex.h>
|
||||
|
||||
/* Naming convention: generic macros are defining using
|
||||
__TGMATH_CPLX*, __TGMATH_REAL*, and __TGMATH_CPLX_ONLY. _CPLX
|
||||
means the generic argument(s) may be real or complex, _REAL means
|
||||
real only, _CPLX means complex only. If there is no suffix, we are
|
||||
defining a function of one generic argument. If the suffix is _n
|
||||
it is a function of n generic arguments. If the suffix is _m_n it
|
||||
is a function of n arguments, the first m of which are generic. We
|
||||
only define these macros for values of n and/or m that are needed. */
|
||||
|
||||
/* The general rules for generic macros are given in 7.22 paragraphs 1 and 2.
|
||||
If any generic parameter is complex, we use a complex version. Otherwise
|
||||
we use a real version. If the real part of any generic parameter is long
|
||||
double, we use the long double version. Otherwise if the real part of any
|
||||
generic parameter is double or of integer type, we use the double version.
|
||||
Otherwise we use the float version. */
|
||||
|
||||
#define __tg_cplx(expr) \
|
||||
__builtin_classify_type(expr) == 9
|
||||
|
||||
#define __tg_ldbl(expr) \
|
||||
__builtin_types_compatible_p(__typeof__(expr), long double)
|
||||
|
||||
#define __tg_dbl(expr) \
|
||||
(__builtin_types_compatible_p(__typeof__(expr), double) \
|
||||
|| __builtin_classify_type(expr) == 1)
|
||||
|
||||
#define __tg_choose(x,f,d,l) \
|
||||
__builtin_choose_expr(__tg_ldbl(x), l, \
|
||||
__builtin_choose_expr(__tg_dbl(x), d, \
|
||||
f))
|
||||
|
||||
#define __tg_choose_2(x,y,f,d,l) \
|
||||
__builtin_choose_expr(__tg_ldbl(x) || __tg_ldbl(y), l, \
|
||||
__builtin_choose_expr(__tg_dbl(x) || __tg_dbl(y), d, \
|
||||
f))
|
||||
|
||||
#define __tg_choose_3(x,y,z,f,d,l) \
|
||||
__builtin_choose_expr(__tg_ldbl(x) || __tg_ldbl(y) || __tg_ldbl(z), l, \
|
||||
__builtin_choose_expr(__tg_dbl(x) || __tg_dbl(y) \
|
||||
|| __tg_dbl(z), d, \
|
||||
f))
|
||||
|
||||
#define __TGMATH_CPLX(z,R,C) \
|
||||
__builtin_choose_expr (__tg_cplx(z), \
|
||||
__tg_choose (__real__(z), C##f(z), (C)(z), C##l(z)), \
|
||||
__tg_choose (z, R##f(z), (R)(z), R##l(z)))
|
||||
|
||||
#define __TGMATH_CPLX_2(z1,z2,R,C) \
|
||||
__builtin_choose_expr (__tg_cplx(z1) || __tg_cplx(z2), \
|
||||
__tg_choose_2 (__real__(z1), __real__(z2), \
|
||||
C##f(z1,z2), (C)(z1,z2), C##l(z1,z2)), \
|
||||
__tg_choose_2 (z1, z2, \
|
||||
R##f(z1,z2), (R)(z1,z2), R##l(z1,z2)))
|
||||
|
||||
#define __TGMATH_REAL(x,R) \
|
||||
__tg_choose (x, R##f(x), (R)(x), R##l(x))
|
||||
#define __TGMATH_REAL_2(x,y,R) \
|
||||
__tg_choose_2 (x, y, R##f(x,y), (R)(x,y), R##l(x,y))
|
||||
#define __TGMATH_REAL_3(x,y,z,R) \
|
||||
__tg_choose_3 (x, y, z, R##f(x,y,z), (R)(x,y,z), R##l(x,y,z))
|
||||
#define __TGMATH_REAL_1_2(x,y,R) \
|
||||
__tg_choose (x, R##f(x,y), (R)(x,y), R##l(x,y))
|
||||
#define __TGMATH_REAL_2_3(x,y,z,R) \
|
||||
__tg_choose_2 (x, y, R##f(x,y,z), (R)(x,y,z), R##l(x,y,z))
|
||||
#define __TGMATH_CPLX_ONLY(z,C) \
|
||||
__tg_choose (__real__(z), C##f(z), (C)(z), C##l(z))
|
||||
|
||||
/* Functions defined in both <math.h> and <complex.h> (7.22p4) */
|
||||
#define acos(z) __TGMATH_CPLX(z, acos, cacos)
|
||||
#define asin(z) __TGMATH_CPLX(z, asin, casin)
|
||||
#define atan(z) __TGMATH_CPLX(z, atan, catan)
|
||||
#define acosh(z) __TGMATH_CPLX(z, acosh, cacosh)
|
||||
#define asinh(z) __TGMATH_CPLX(z, asinh, casinh)
|
||||
#define atanh(z) __TGMATH_CPLX(z, atanh, catanh)
|
||||
#define cos(z) __TGMATH_CPLX(z, cos, ccos)
|
||||
#define sin(z) __TGMATH_CPLX(z, sin, csin)
|
||||
#define tan(z) __TGMATH_CPLX(z, tan, ctan)
|
||||
#define cosh(z) __TGMATH_CPLX(z, cosh, ccosh)
|
||||
#define sinh(z) __TGMATH_CPLX(z, sinh, csinh)
|
||||
#define tanh(z) __TGMATH_CPLX(z, tanh, ctanh)
|
||||
#define exp(z) __TGMATH_CPLX(z, exp, cexp)
|
||||
#define log(z) __TGMATH_CPLX(z, log, clog)
|
||||
#define pow(z1,z2) __TGMATH_CPLX_2(z1, z2, pow, cpow)
|
||||
#define sqrt(z) __TGMATH_CPLX(z, sqrt, csqrt)
|
||||
#define fabs(z) __TGMATH_CPLX(z, fabs, cabs)
|
||||
|
||||
/* Functions defined in <math.h> only (7.22p5) */
|
||||
#define atan2(x,y) __TGMATH_REAL_2(x, y, atan2)
|
||||
#define cbrt(x) __TGMATH_REAL(x, cbrt)
|
||||
#define ceil(x) __TGMATH_REAL(x, ceil)
|
||||
#define copysign(x,y) __TGMATH_REAL_2(x, y, copysign)
|
||||
#define erf(x) __TGMATH_REAL(x, erf)
|
||||
#define erfc(x) __TGMATH_REAL(x, erfc)
|
||||
#define exp2(x) __TGMATH_REAL(x, exp2)
|
||||
#define expm1(x) __TGMATH_REAL(x, expm1)
|
||||
#define fdim(x,y) __TGMATH_REAL_2(x, y, fdim)
|
||||
#define floor(x) __TGMATH_REAL(x, floor)
|
||||
#define fma(x,y,z) __TGMATH_REAL_3(x, y, z, fma)
|
||||
#define fmax(x,y) __TGMATH_REAL_2(x, y, fmax)
|
||||
#define fmin(x,y) __TGMATH_REAL_2(x, y, fmin)
|
||||
#define fmod(x,y) __TGMATH_REAL_2(x, y, fmod)
|
||||
#define frexp(x,y) __TGMATH_REAL_1_2(x, y, frexp)
|
||||
#define hypot(x,y) __TGMATH_REAL_2(x, y, hypot)
|
||||
#define ilogb(x) __TGMATH_REAL(x, ilogb)
|
||||
#define ldexp(x,y) __TGMATH_REAL_1_2(x, y, ldexp)
|
||||
#define lgamma(x) __TGMATH_REAL(x, lgamma)
|
||||
#define llrint(x) __TGMATH_REAL(x, llrint)
|
||||
#define llround(x) __TGMATH_REAL(x, llround)
|
||||
#define log10(x) __TGMATH_REAL(x, log10)
|
||||
#define log1p(x) __TGMATH_REAL(x, log1p)
|
||||
#define log2(x) __TGMATH_REAL(x, log2)
|
||||
#define logb(x) __TGMATH_REAL(x, logb)
|
||||
#define lrint(x) __TGMATH_REAL(x, lrint)
|
||||
#define lround(x) __TGMATH_REAL(x, lround)
|
||||
#define nearbyint(x) __TGMATH_REAL(x, nearbyint)
|
||||
#define nextafter(x,y) __TGMATH_REAL_2(x, y, nextafter)
|
||||
#define nexttoward(x,y) __TGMATH_REAL_1_2(x, y, nexttoward)
|
||||
#define remainder(x,y) __TGMATH_REAL_2(x, y, remainder)
|
||||
#define remquo(x,y,z) __TGMATH_REAL_2_3(x, y, z, remquo)
|
||||
#define rint(x) __TGMATH_REAL(x, rint)
|
||||
#define round(x) __TGMATH_REAL(x, round)
|
||||
#define scalbn(x,y) __TGMATH_REAL_1_2(x, y, scalbn)
|
||||
#define scalbln(x,y) __TGMATH_REAL_1_2(x, y, scalbln)
|
||||
#define tgamma(x) __TGMATH_REAL(x, tgamma)
|
||||
#define trunc(x) __TGMATH_REAL(x, trunc)
|
||||
|
||||
/* Functions defined in <complex.h> only (7.22p6) */
|
||||
#define carg(z) __TGMATH_CPLX_ONLY(z, carg)
|
||||
#define cimag(z) __TGMATH_CPLX_ONLY(z, cimag)
|
||||
#define conj(z) __TGMATH_CPLX_ONLY(z, conj)
|
||||
#define cproj(z) __TGMATH_CPLX_ONLY(z, cproj)
|
||||
#define creal(z) __TGMATH_CPLX_ONLY(z, creal)
|
||||
|
||||
#endif /* __cplusplus */
|
||||
#endif /* _TGMATH_H */
|
||||
|
|
@ -0,0 +1,250 @@
|
|||
/* Header file for the ARM EABI and C6X unwinders
|
||||
Copyright (C) 2003-2013 Free Software Foundation, Inc.
|
||||
Contributed by Paul Brook
|
||||
|
||||
This file is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 3, or (at your option) any
|
||||
later version.
|
||||
|
||||
This file 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.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Language-independent unwinder header public defines. This contains both
|
||||
ABI defined objects, and GNU support routines. */
|
||||
|
||||
#ifndef UNWIND_ARM_COMMON_H
|
||||
#define UNWIND_ARM_COMMON_H
|
||||
|
||||
#define __ARM_EABI_UNWINDER__ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
typedef unsigned _Unwind_Word __attribute__((__mode__(__word__)));
|
||||
typedef signed _Unwind_Sword __attribute__((__mode__(__word__)));
|
||||
typedef unsigned _Unwind_Ptr __attribute__((__mode__(__pointer__)));
|
||||
typedef unsigned _Unwind_Internal_Ptr __attribute__((__mode__(__pointer__)));
|
||||
typedef _Unwind_Word _uw;
|
||||
typedef unsigned _uw64 __attribute__((mode(__DI__)));
|
||||
typedef unsigned _uw16 __attribute__((mode(__HI__)));
|
||||
typedef unsigned _uw8 __attribute__((mode(__QI__)));
|
||||
|
||||
typedef enum
|
||||
{
|
||||
_URC_OK = 0, /* operation completed successfully */
|
||||
_URC_FOREIGN_EXCEPTION_CAUGHT = 1,
|
||||
_URC_END_OF_STACK = 5,
|
||||
_URC_HANDLER_FOUND = 6,
|
||||
_URC_INSTALL_CONTEXT = 7,
|
||||
_URC_CONTINUE_UNWIND = 8,
|
||||
_URC_FAILURE = 9 /* unspecified failure of some kind */
|
||||
}
|
||||
_Unwind_Reason_Code;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
_US_VIRTUAL_UNWIND_FRAME = 0,
|
||||
_US_UNWIND_FRAME_STARTING = 1,
|
||||
_US_UNWIND_FRAME_RESUME = 2,
|
||||
_US_ACTION_MASK = 3,
|
||||
_US_FORCE_UNWIND = 8,
|
||||
_US_END_OF_STACK = 16
|
||||
}
|
||||
_Unwind_State;
|
||||
|
||||
/* Provided only for compatibility with existing code. */
|
||||
typedef int _Unwind_Action;
|
||||
#define _UA_SEARCH_PHASE 1
|
||||
#define _UA_CLEANUP_PHASE 2
|
||||
#define _UA_HANDLER_FRAME 4
|
||||
#define _UA_FORCE_UNWIND 8
|
||||
#define _UA_END_OF_STACK 16
|
||||
#define _URC_NO_REASON _URC_OK
|
||||
|
||||
typedef struct _Unwind_Control_Block _Unwind_Control_Block;
|
||||
typedef struct _Unwind_Context _Unwind_Context;
|
||||
typedef _uw _Unwind_EHT_Header;
|
||||
|
||||
|
||||
/* UCB: */
|
||||
|
||||
struct _Unwind_Control_Block
|
||||
{
|
||||
char exception_class[8];
|
||||
void (*exception_cleanup)(_Unwind_Reason_Code, _Unwind_Control_Block *);
|
||||
/* Unwinder cache, private fields for the unwinder's use */
|
||||
struct
|
||||
{
|
||||
_uw reserved1; /* Forced unwind stop fn, 0 if not forced */
|
||||
_uw reserved2; /* Personality routine address */
|
||||
_uw reserved3; /* Saved callsite address */
|
||||
_uw reserved4; /* Forced unwind stop arg */
|
||||
_uw reserved5;
|
||||
}
|
||||
unwinder_cache;
|
||||
/* Propagation barrier cache (valid after phase 1): */
|
||||
struct
|
||||
{
|
||||
_uw sp;
|
||||
_uw bitpattern[5];
|
||||
}
|
||||
barrier_cache;
|
||||
/* Cleanup cache (preserved over cleanup): */
|
||||
struct
|
||||
{
|
||||
_uw bitpattern[4];
|
||||
}
|
||||
cleanup_cache;
|
||||
/* Pr cache (for pr's benefit): */
|
||||
struct
|
||||
{
|
||||
_uw fnstart; /* function start address */
|
||||
_Unwind_EHT_Header *ehtp; /* pointer to EHT entry header word */
|
||||
_uw additional; /* additional data */
|
||||
_uw reserved1;
|
||||
}
|
||||
pr_cache;
|
||||
long long int :0; /* Force alignment to 8-byte boundary */
|
||||
};
|
||||
|
||||
/* Virtual Register Set*/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
_UVRSC_CORE = 0, /* integer register */
|
||||
_UVRSC_VFP = 1, /* vfp */
|
||||
_UVRSC_FPA = 2, /* fpa */
|
||||
_UVRSC_WMMXD = 3, /* Intel WMMX data register */
|
||||
_UVRSC_WMMXC = 4 /* Intel WMMX control register */
|
||||
}
|
||||
_Unwind_VRS_RegClass;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
_UVRSD_UINT32 = 0,
|
||||
_UVRSD_VFPX = 1,
|
||||
_UVRSD_FPAX = 2,
|
||||
_UVRSD_UINT64 = 3,
|
||||
_UVRSD_FLOAT = 4,
|
||||
_UVRSD_DOUBLE = 5
|
||||
}
|
||||
_Unwind_VRS_DataRepresentation;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
_UVRSR_OK = 0,
|
||||
_UVRSR_NOT_IMPLEMENTED = 1,
|
||||
_UVRSR_FAILED = 2
|
||||
}
|
||||
_Unwind_VRS_Result;
|
||||
|
||||
/* Frame unwinding state. */
|
||||
typedef struct
|
||||
{
|
||||
/* The current word (bytes packed msb first). */
|
||||
_uw data;
|
||||
/* Pointer to the next word of data. */
|
||||
_uw *next;
|
||||
/* The number of bytes left in this word. */
|
||||
_uw8 bytes_left;
|
||||
/* The number of words pointed to by ptr. */
|
||||
_uw8 words_left;
|
||||
}
|
||||
__gnu_unwind_state;
|
||||
|
||||
typedef _Unwind_Reason_Code (*personality_routine) (_Unwind_State,
|
||||
_Unwind_Control_Block *, _Unwind_Context *);
|
||||
|
||||
_Unwind_VRS_Result _Unwind_VRS_Set(_Unwind_Context *, _Unwind_VRS_RegClass,
|
||||
_uw, _Unwind_VRS_DataRepresentation,
|
||||
void *);
|
||||
|
||||
_Unwind_VRS_Result _Unwind_VRS_Get(_Unwind_Context *, _Unwind_VRS_RegClass,
|
||||
_uw, _Unwind_VRS_DataRepresentation,
|
||||
void *);
|
||||
|
||||
_Unwind_VRS_Result _Unwind_VRS_Pop(_Unwind_Context *, _Unwind_VRS_RegClass,
|
||||
_uw, _Unwind_VRS_DataRepresentation);
|
||||
|
||||
|
||||
/* Support functions for the PR. */
|
||||
#define _Unwind_Exception _Unwind_Control_Block
|
||||
typedef char _Unwind_Exception_Class[8];
|
||||
|
||||
void * _Unwind_GetLanguageSpecificData (_Unwind_Context *);
|
||||
_Unwind_Ptr _Unwind_GetRegionStart (_Unwind_Context *);
|
||||
|
||||
_Unwind_Ptr _Unwind_GetDataRelBase (_Unwind_Context *);
|
||||
/* This should never be used. */
|
||||
_Unwind_Ptr _Unwind_GetTextRelBase (_Unwind_Context *);
|
||||
|
||||
/* Interface functions: */
|
||||
_Unwind_Reason_Code _Unwind_RaiseException(_Unwind_Control_Block *ucbp);
|
||||
void __attribute__((noreturn)) _Unwind_Resume(_Unwind_Control_Block *ucbp);
|
||||
_Unwind_Reason_Code _Unwind_Resume_or_Rethrow (_Unwind_Control_Block *ucbp);
|
||||
|
||||
typedef _Unwind_Reason_Code (*_Unwind_Stop_Fn)
|
||||
(int, _Unwind_Action, _Unwind_Exception_Class,
|
||||
_Unwind_Control_Block *, struct _Unwind_Context *, void *);
|
||||
_Unwind_Reason_Code _Unwind_ForcedUnwind (_Unwind_Control_Block *,
|
||||
_Unwind_Stop_Fn, void *);
|
||||
/* @@@ Use unwind data to perform a stack backtrace. The trace callback
|
||||
is called for every stack frame in the call chain, but no cleanup
|
||||
actions are performed. */
|
||||
typedef _Unwind_Reason_Code (*_Unwind_Trace_Fn) (_Unwind_Context *, void *);
|
||||
_Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn,
|
||||
void*);
|
||||
|
||||
_Unwind_Word _Unwind_GetCFA (struct _Unwind_Context *);
|
||||
void _Unwind_Complete(_Unwind_Control_Block *ucbp);
|
||||
void _Unwind_DeleteException (_Unwind_Exception *);
|
||||
|
||||
_Unwind_Reason_Code __gnu_unwind_frame (_Unwind_Control_Block *,
|
||||
_Unwind_Context *);
|
||||
_Unwind_Reason_Code __gnu_unwind_execute (_Unwind_Context *,
|
||||
__gnu_unwind_state *);
|
||||
|
||||
static inline _Unwind_Word
|
||||
_Unwind_GetGR (_Unwind_Context *context, int regno)
|
||||
{
|
||||
_uw val;
|
||||
_Unwind_VRS_Get (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val);
|
||||
return val;
|
||||
}
|
||||
|
||||
#define _Unwind_GetIPInfo(context, ip_before_insn) \
|
||||
(*ip_before_insn = 0, _Unwind_GetIP (context))
|
||||
|
||||
static inline void
|
||||
_Unwind_SetGR (_Unwind_Context *context, int regno, _Unwind_Word val)
|
||||
{
|
||||
_Unwind_VRS_Set (context, _UVRSC_CORE, regno, _UVRSD_UINT32, &val);
|
||||
}
|
||||
|
||||
_Unwind_Ptr _Unwind_GetRegionStart (_Unwind_Context *);
|
||||
void * _Unwind_GetLanguageSpecificData (_Unwind_Context *);
|
||||
|
||||
/* leb128 type numbers have a potentially unlimited size.
|
||||
The target of the following definitions of _sleb128_t and _uleb128_t
|
||||
is to have efficient data types large enough to hold the leb128 type
|
||||
numbers used in the unwind code. */
|
||||
typedef long _sleb128_t;
|
||||
typedef unsigned long _uleb128_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* defined UNWIND_ARM_COMMON_H */
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
/* Header file for the ARM EABI unwinder
|
||||
Copyright (C) 2003-2013 Free Software Foundation, Inc.
|
||||
Contributed by Paul Brook
|
||||
|
||||
This file is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 3, or (at your option) any
|
||||
later version.
|
||||
|
||||
This file 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.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Language-independent unwinder header public defines. This contains both
|
||||
ABI defined objects, and GNU support routines. */
|
||||
|
||||
#ifndef UNWIND_ARM_H
|
||||
#define UNWIND_ARM_H
|
||||
|
||||
#include "unwind-arm-common.h"
|
||||
|
||||
#define UNWIND_STACK_REG 13
|
||||
/* Use IP as a scratch register within the personality routine. */
|
||||
#define UNWIND_POINTER_REG 12
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/* Decode an R_ARM_TARGET2 relocation. */
|
||||
static inline _Unwind_Word
|
||||
_Unwind_decode_typeinfo_ptr (_Unwind_Word base __attribute__ ((unused)),
|
||||
_Unwind_Word ptr)
|
||||
{
|
||||
_Unwind_Word tmp;
|
||||
|
||||
tmp = *(_Unwind_Word *) ptr;
|
||||
/* Zero values are always NULL. */
|
||||
if (!tmp)
|
||||
return 0;
|
||||
|
||||
#if (defined(linux) && !defined(__uClinux__)) || defined(__NetBSD__)
|
||||
/* Pc-relative indirect. */
|
||||
#define _GLIBCXX_OVERRIDE_TTYPE_ENCODING (DW_EH_PE_pcrel | DW_EH_PE_indirect)
|
||||
tmp += ptr;
|
||||
tmp = *(_Unwind_Word *) tmp;
|
||||
#elif defined(__symbian__) || defined(__uClinux__)
|
||||
#define _GLIBCXX_OVERRIDE_TTYPE_ENCODING (DW_EH_PE_absptr)
|
||||
/* Absolute pointer. Nothing more to do. */
|
||||
#else
|
||||
#define _GLIBCXX_OVERRIDE_TTYPE_ENCODING (DW_EH_PE_pcrel)
|
||||
/* Pc-relative pointer. */
|
||||
tmp += ptr;
|
||||
#endif
|
||||
return tmp;
|
||||
}
|
||||
|
||||
static inline _Unwind_Reason_Code
|
||||
__gnu_unwind_24bit (_Unwind_Context * context __attribute__ ((unused)),
|
||||
_uw data __attribute__ ((unused)),
|
||||
int compact __attribute__ ((unused)))
|
||||
{
|
||||
return _URC_FAILURE;
|
||||
}
|
||||
/* Return the address of the instruction, not the actual IP value. */
|
||||
#define _Unwind_GetIP(context) \
|
||||
(_Unwind_GetGR (context, 15) & ~(_Unwind_Word)1)
|
||||
|
||||
#define _Unwind_SetIP(context, val) \
|
||||
_Unwind_SetGR (context, 15, val | (_Unwind_GetGR (context, 15) & 1))
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* defined UNWIND_ARM_H */
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#ifndef _VARARGS_H
|
||||
#define _VARARGS_H
|
||||
|
||||
#error "GCC no longer implements <varargs.h>."
|
||||
#error "Revise your code to use <stdarg.h>."
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,514 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Install modified versions of certain ANSI-incompatible system header
|
||||
# files which are fixed to work correctly with ANSI C and placed in a
|
||||
# directory that GCC will search.
|
||||
#
|
||||
# See README-fixinc for more information.
|
||||
#
|
||||
# fixincludes copyright (c) 1998, 1999, 2000, 2002, 2009
|
||||
# The Free Software Foundation, Inc.
|
||||
#
|
||||
# fixincludes is free software.
|
||||
#
|
||||
# You may redistribute it and/or modify it under the terms of the
|
||||
# GNU General Public License, as published by the Free Software
|
||||
# Foundation; either version 3, or (at your option) any later version.
|
||||
#
|
||||
# fixincludes 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 fixincludes; see the file COPYING3. If not see
|
||||
# <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# # # # # # # # # # # # # # # # # # # # #
|
||||
|
||||
# Usage: fixinc.sh output-dir input-dir
|
||||
#
|
||||
# Directory in which to store the results.
|
||||
# Fail if no arg to specify a directory for the output.
|
||||
if [ "x$1" = "x" ]
|
||||
then
|
||||
echo fixincludes: no output directory specified
|
||||
exit 1
|
||||
fi
|
||||
|
||||
LIB=${1}
|
||||
shift
|
||||
|
||||
# Make sure it exists.
|
||||
if [ ! -d $LIB ]; then
|
||||
mkdir $LIB || {
|
||||
echo fixincludes: output dir '`'$LIB"' cannot be created"
|
||||
exit 1
|
||||
}
|
||||
else
|
||||
( cd $LIB && touch DONE && rm DONE ) || {
|
||||
echo fixincludes: output dir '`'$LIB"' is an invalid directory"
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
|
||||
if test -z "$VERBOSE"
|
||||
then
|
||||
VERBOSE=2
|
||||
export VERBOSE
|
||||
else
|
||||
case "$VERBOSE" in
|
||||
[0-9] ) : ;;
|
||||
* ) VERBOSE=3 ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Define what target system we're fixing.
|
||||
#
|
||||
if test -r ./Makefile; then
|
||||
target_canonical="`sed -n -e 's,^target[ ]*=[ ]*\(.*\)$,\1,p' < Makefile`"
|
||||
fi
|
||||
|
||||
# If not from the Makefile, then try config.guess
|
||||
#
|
||||
if test -z "${target_canonical}" ; then
|
||||
if test -x ./config.guess ; then
|
||||
target_canonical="`config.guess`" ; fi
|
||||
test -z "${target_canonical}" && target_canonical=unknown
|
||||
fi
|
||||
export target_canonical
|
||||
|
||||
# # # # # # # # # # # # # # # # # # # # #
|
||||
#
|
||||
# Define PWDCMD as a command to use to get the working dir
|
||||
# in the form that we want.
|
||||
PWDCMD=${PWDCMD-pwd}
|
||||
|
||||
case "`$PWDCMD`" in
|
||||
//*)
|
||||
# On an Apollo, discard everything before `/usr'.
|
||||
PWDCMD="eval pwd | sed -e 's,.*/usr/,/usr/,'"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Original directory.
|
||||
ORIGDIR=`${PWDCMD}`
|
||||
export ORIGDIR
|
||||
FIXINCL=`${PWDCMD}`/fixincl
|
||||
if [ ! -x $FIXINCL ] ; then
|
||||
echo "Cannot find fixincl" >&2
|
||||
exit 1
|
||||
fi
|
||||
export FIXINCL
|
||||
|
||||
# Make LIB absolute only if needed to avoid problems with the amd.
|
||||
case $LIB in
|
||||
/*)
|
||||
;;
|
||||
*)
|
||||
cd $LIB; LIB=`${PWDCMD}`
|
||||
;;
|
||||
esac
|
||||
|
||||
if test $VERBOSE -gt 0
|
||||
then echo Fixing headers into ${LIB} for ${target_canonical} target ; fi
|
||||
|
||||
# Determine whether this system has symbolic links.
|
||||
if test -n "$DJDIR"; then
|
||||
LINKS=false
|
||||
elif ln -s X $LIB/ShouldNotExist 2>/dev/null; then
|
||||
rm -f $LIB/ShouldNotExist
|
||||
LINKS=true
|
||||
elif ln -s X /tmp/ShouldNotExist 2>/dev/null; then
|
||||
rm -f /tmp/ShouldNotExist
|
||||
LINKS=true
|
||||
else
|
||||
LINKS=false
|
||||
fi
|
||||
|
||||
# # # # # # # # # # # # # # # # # # # # #
|
||||
#
|
||||
# Check to see if the machine_name fix needs to be disabled.
|
||||
#
|
||||
# On some platforms, machine_name doesn't work properly and
|
||||
# breaks some of the header files. Since everything works
|
||||
# properly without it, just wipe the macro list to
|
||||
# disable the fix.
|
||||
|
||||
case "${target_canonical}" in
|
||||
*-*-vxworks*)
|
||||
test -f ${MACRO_LIST} && echo > ${MACRO_LIST}
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
# # # # # # # # # # # # # # # # # # # # #
|
||||
#
|
||||
# In the file macro_list are listed all the predefined
|
||||
# macros that are not in the C89 reserved namespace (the reserved
|
||||
# namespace is all identifiers beginnning with two underscores or one
|
||||
# underscore followed by a capital letter). A regular expression to find
|
||||
# any of those macros in a header file is written to MN_NAME_PAT.
|
||||
#
|
||||
# Note dependency on ASCII. \012 = newline.
|
||||
# tr ' ' '\n' is, alas, not portable.
|
||||
|
||||
if test -s ${MACRO_LIST}
|
||||
then
|
||||
if test $VERBOSE -gt 0; then
|
||||
echo "Forbidden identifiers: `tr '\012' ' ' < ${MACRO_LIST}`"
|
||||
fi
|
||||
MN_NAME_PAT="`sed 's/^/\\\\</; s/$/\\\\>/; $!s/$/|/' \
|
||||
< ${MACRO_LIST} | tr -d '\012'`"
|
||||
export MN_NAME_PAT
|
||||
else
|
||||
if test $VERBOSE -gt 0
|
||||
then echo "No forbidden identifiers defined by this target" ; fi
|
||||
fi
|
||||
|
||||
# # # # # # # # # # # # # # # # # # # # #
|
||||
#
|
||||
# Search each input directory for broken header files.
|
||||
# This loop ends near the end of the file.
|
||||
#
|
||||
if test $# -eq 0
|
||||
then
|
||||
INPUTLIST="/usr/include"
|
||||
else
|
||||
INPUTLIST="$@"
|
||||
fi
|
||||
|
||||
for INPUT in ${INPUTLIST} ; do
|
||||
|
||||
cd ${ORIGDIR}
|
||||
|
||||
# Make sure a directory exists before changing into it,
|
||||
# otherwise Solaris2 will fail-exit the script.
|
||||
#
|
||||
if [ ! -d ${INPUT} ]; then
|
||||
continue
|
||||
fi
|
||||
cd ${INPUT}
|
||||
|
||||
INPUT=`${PWDCMD}`
|
||||
export INPUT
|
||||
|
||||
#
|
||||
# # # # # # # # # # # # # # # # # # # # #
|
||||
#
|
||||
if test $VERBOSE -gt 1
|
||||
then echo Finding directories and links to directories ; fi
|
||||
|
||||
# Find all directories and all symlinks that point to directories.
|
||||
# Put the list in $all_dirs.
|
||||
# Each time we find a symlink, add it to newdirs
|
||||
# so that we do another find within the dir the link points to.
|
||||
# Note that $all_dirs may have duplicates in it;
|
||||
# later parts of this file are supposed to ignore them.
|
||||
dirs="."
|
||||
levels=2
|
||||
all_dirs=""
|
||||
search_dirs=""
|
||||
|
||||
while [ -n "$dirs" ] && [ $levels -gt 0 ]
|
||||
do
|
||||
levels=`expr $levels - 1`
|
||||
newdirs=
|
||||
for d in $dirs
|
||||
do
|
||||
if test $VERBOSE -gt 1
|
||||
then echo " Searching $INPUT/$d" ; fi
|
||||
|
||||
# Find all directories under $d, relative to $d, excluding $d itself.
|
||||
# (The /. is needed after $d in case $d is a symlink.)
|
||||
all_dirs="$all_dirs `find $d/. -type d -print | \
|
||||
sed -e '/\/\.$/d' -e 's@/./@/@g'`"
|
||||
# Find all links to directories.
|
||||
# Using `-exec test -d' in find fails on some systems,
|
||||
# and trying to run test via sh fails on others,
|
||||
# so this is the simplest alternative left.
|
||||
# First find all the links, then test each one.
|
||||
theselinks=
|
||||
$LINKS && \
|
||||
theselinks=`find $d/. -type l -print | sed -e 's@/./@/@g'`
|
||||
for d1 in $theselinks --dummy--
|
||||
do
|
||||
# If the link points to a directory,
|
||||
# add that dir to $newdirs
|
||||
if [ -d $d1 ]
|
||||
then
|
||||
all_dirs="$all_dirs $d1"
|
||||
if [ "`ls -ld $d1 | sed -n 's/.*-> //p'`" != "." ]
|
||||
then
|
||||
newdirs="$newdirs $d1"
|
||||
search_dirs="$search_dirs $d1"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
dirs="$newdirs"
|
||||
done
|
||||
|
||||
# # # # # # # # # # # # # # # # # # # # #
|
||||
#
|
||||
dirs=
|
||||
if test $VERBOSE -gt 2
|
||||
then echo "All directories (including links to directories):"
|
||||
echo $all_dirs
|
||||
fi
|
||||
|
||||
for file in $all_dirs; do
|
||||
rm -rf $LIB/$file
|
||||
if [ ! -d $LIB/$file ]
|
||||
then mkdir $LIB/$file
|
||||
fi
|
||||
done
|
||||
mkdir $LIB/root
|
||||
|
||||
# # # # # # # # # # # # # # # # # # # # #
|
||||
#
|
||||
# treetops gets an alternating list
|
||||
# of old directories to copy
|
||||
# and the new directories to copy to.
|
||||
treetops=". ${LIB}"
|
||||
|
||||
if $LINKS; then
|
||||
if test $VERBOSE -gt 1
|
||||
then echo 'Making symbolic directory links' ; fi
|
||||
cwd=`${PWDCMD}`
|
||||
|
||||
for sym_link in $search_dirs; do
|
||||
cd ${INPUT}
|
||||
dest=`ls -ld ${sym_link} | sed -n 's/.*-> //p'`
|
||||
|
||||
# In case $dest is relative, get to ${sym_link}'s dir first.
|
||||
#
|
||||
cd ./`echo ${sym_link} | sed 's;/[^/]*$;;'`
|
||||
|
||||
# Check that the target directory exists.
|
||||
# Redirections changed to avoid bug in sh on Ultrix.
|
||||
#
|
||||
(cd $dest) > /dev/null 2>&1
|
||||
if [ $? = 0 ]; then
|
||||
cd $dest
|
||||
|
||||
# full_dest_dir gets the dir that the link actually leads to.
|
||||
#
|
||||
full_dest_dir=`${PWDCMD}`
|
||||
|
||||
# Canonicalize ${INPUT} now to minimize the time an
|
||||
# automounter has to change the result of ${PWDCMD}.
|
||||
#
|
||||
cinput=`cd ${INPUT}; ${PWDCMD}`
|
||||
|
||||
# If a link points to ., make a similar link to .
|
||||
#
|
||||
if [ ${full_dest_dir} = ${cinput} ]; then
|
||||
if test $VERBOSE -gt 2
|
||||
then echo ${sym_link} '->' . ': Making self link' ; fi
|
||||
rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
|
||||
ln -s . ${LIB}/${sym_link} > /dev/null 2>&1
|
||||
|
||||
# If link leads back into ${INPUT},
|
||||
# make a similar link here.
|
||||
#
|
||||
elif expr ${full_dest_dir} : "${cinput}/.*" > /dev/null; then
|
||||
# Y gets the actual target dir name, relative to ${INPUT}.
|
||||
y=`echo ${full_dest_dir} | sed -n "s&${cinput}/&&p"`
|
||||
# DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}.
|
||||
dots=`echo "${sym_link}" |
|
||||
sed -e 's@^./@@' -e 's@/./@/@g' -e 's@[^/][^/]*@..@g' -e 's@..$@@'`
|
||||
if test $VERBOSE -gt 2
|
||||
then echo ${sym_link} '->' $dots$y ': Making local link' ; fi
|
||||
rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
|
||||
ln -s $dots$y ${LIB}/${sym_link} > /dev/null 2>&1
|
||||
|
||||
else
|
||||
# If the link is to a dir $target outside ${INPUT},
|
||||
# repoint the link at ${INPUT}/root$target
|
||||
# and process $target into ${INPUT}/root$target
|
||||
# treat this directory as if it actually contained the files.
|
||||
#
|
||||
if test $VERBOSE -gt 2
|
||||
then echo ${sym_link} '->' root${full_dest_dir} ': Making rooted link'
|
||||
fi
|
||||
if [ -d $LIB/root${full_dest_dir} ]
|
||||
then true
|
||||
else
|
||||
dirname=root${full_dest_dir}/
|
||||
dirmade=.
|
||||
cd $LIB
|
||||
while [ x$dirname != x ]; do
|
||||
component=`echo $dirname | sed -e 's|/.*$||'`
|
||||
mkdir $component >/dev/null 2>&1
|
||||
cd $component
|
||||
dirmade=$dirmade/$component
|
||||
dirname=`echo $dirname | sed -e 's|[^/]*/||'`
|
||||
done
|
||||
fi
|
||||
|
||||
# Duplicate directory structure created in ${LIB}/${sym_link} in new
|
||||
# root area.
|
||||
#
|
||||
for file2 in $all_dirs; do
|
||||
case $file2 in
|
||||
${sym_link}/*)
|
||||
dupdir=${LIB}/root${full_dest_dir}/`echo $file2 |
|
||||
sed -n "s|^${sym_link}/||p"`
|
||||
if test $VERBOSE -gt 2
|
||||
then echo "Duplicating ${sym_link}'s ${dupdir}" ; fi
|
||||
if [ -d ${dupdir} ]
|
||||
then true
|
||||
else
|
||||
mkdir ${dupdir}
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Get the path from ${LIB} to ${sym_link}, accounting for symlinks.
|
||||
#
|
||||
parent=`echo "${sym_link}" | sed -e 's@/[^/]*$@@'`
|
||||
libabs=`cd ${LIB}; ${PWDCMD}`
|
||||
file2=`cd ${LIB}; cd $parent; ${PWDCMD} | sed -e "s@^${libabs}@@"`
|
||||
|
||||
# DOTS is the relative path from ${LIB}/${sym_link} back to ${LIB}.
|
||||
#
|
||||
dots=`echo "$file2" | sed -e 's@/[^/]*@../@g'`
|
||||
rm -fr ${LIB}/${sym_link} > /dev/null 2>&1
|
||||
ln -s ${dots}root${full_dest_dir} ${LIB}/${sym_link} > /dev/null 2>&1
|
||||
treetops="$treetops ${sym_link} ${LIB}/root${full_dest_dir}"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# # # # # # # # # # # # # # # # # # # # #
|
||||
#
|
||||
required=
|
||||
set x $treetops
|
||||
shift
|
||||
while [ $# != 0 ]; do
|
||||
# $1 is an old directory to copy, and $2 is the new directory to copy to.
|
||||
#
|
||||
SRCDIR=`cd ${INPUT} ; cd $1 ; ${PWDCMD}`
|
||||
export SRCDIR
|
||||
|
||||
FIND_BASE=$1
|
||||
export FIND_BASE
|
||||
shift
|
||||
|
||||
DESTDIR=`cd $1;${PWDCMD}`
|
||||
export DESTDIR
|
||||
shift
|
||||
|
||||
# The same dir can appear more than once in treetops.
|
||||
# There's no need to scan it more than once.
|
||||
#
|
||||
if [ -f ${DESTDIR}/DONE ]
|
||||
then continue ; fi
|
||||
|
||||
touch ${DESTDIR}/DONE
|
||||
if test $VERBOSE -gt 1
|
||||
then echo Fixing directory ${SRCDIR} into ${DESTDIR} ; fi
|
||||
|
||||
# Check files which are symlinks as well as those which are files.
|
||||
#
|
||||
cd ${INPUT}
|
||||
required="$required `if $LINKS; then
|
||||
find ${FIND_BASE}/. -name '*.h' \( -type f -o -type l \) -print
|
||||
else
|
||||
find ${FIND_BASE}/. -name '*.h' -type f -print
|
||||
fi | \
|
||||
sed -e 's;/\./;/;g' -e 's;//*;/;g' | \
|
||||
${FIXINCL}`"
|
||||
done
|
||||
|
||||
## Make sure that any include files referenced using double quotes
|
||||
## exist in the fixed directory. This comes last since otherwise
|
||||
## we might end up deleting some of these files "because they don't
|
||||
## need any change."
|
||||
set x `echo $required`
|
||||
shift
|
||||
while [ $# != 0 ]; do
|
||||
newreq=
|
||||
while [ $# != 0 ]; do
|
||||
# $1 is the directory to copy from,
|
||||
# $2 is the unfixed file,
|
||||
# $3 is the fixed file name.
|
||||
#
|
||||
cd ${INPUT}
|
||||
cd $1
|
||||
if [ -f $2 ] ; then
|
||||
if [ -r $2 ] && [ ! -r $3 ]; then
|
||||
cp $2 $3 >/dev/null 2>&1 || echo "Can't copy $2" >&2
|
||||
chmod +w $3 2>/dev/null
|
||||
chmod a+r $3 2>/dev/null
|
||||
if test $VERBOSE -gt 2
|
||||
then echo Copied $2 ; fi
|
||||
for include in `egrep '^[ ]*#[ ]*include[ ]*"[^/]' $3 |
|
||||
sed -e 's/^[ ]*#[ ]*include[ ]*"\([^"]*\)".*$/\1/'`
|
||||
do
|
||||
dir=`echo $2 | sed -e s'|/[^/]*$||'`
|
||||
dir2=`echo $3 | sed -e s'|/[^/]*$||'`
|
||||
newreq="$newreq $1 $dir/$include $dir2/$include"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
shift; shift; shift
|
||||
done
|
||||
set x $newreq
|
||||
shift
|
||||
done
|
||||
|
||||
if test $VERBOSE -gt 2
|
||||
then echo 'Cleaning up DONE files.' ; fi
|
||||
cd $LIB
|
||||
# Look for files case-insensitively, for the benefit of
|
||||
# DOS/Windows filesystems.
|
||||
find . -name '[Dd][Oo][Nn][Ee]' -exec rm -f '{}' ';'
|
||||
|
||||
if test $VERBOSE -gt 1
|
||||
then echo 'Cleaning up unneeded directories:' ; fi
|
||||
cd $LIB
|
||||
all_dirs=`find . -type d \! -name '.' -print | sort -r`
|
||||
for file in $all_dirs; do
|
||||
if rmdir $LIB/$file > /dev/null
|
||||
then
|
||||
test $VERBOSE -gt 3 && echo " removed $file"
|
||||
fi
|
||||
done 2> /dev/null
|
||||
|
||||
# On systems which don't support symlinks, `find' may barf
|
||||
# if called with "-type l" predicate. So only use that if
|
||||
# we know we should look for symlinks.
|
||||
if $LINKS; then
|
||||
test $VERBOSE -gt 2 && echo "Removing unused symlinks"
|
||||
|
||||
all_dirs=`find . -type l -print`
|
||||
for file in $all_dirs
|
||||
do
|
||||
if test ! -d $file
|
||||
then
|
||||
rm -f $file
|
||||
test $VERBOSE -gt 3 && echo " removed $file"
|
||||
rmdir `dirname $file` > /dev/null && \
|
||||
test $VERBOSE -gt 3 && \
|
||||
echo " removed `dirname $file`"
|
||||
fi
|
||||
done 2> /dev/null
|
||||
fi
|
||||
|
||||
if test $VERBOSE -gt 0
|
||||
then echo fixincludes is done ; fi
|
||||
|
||||
# # # # # # # # # # # # # # # # # # # # #
|
||||
#
|
||||
# End of for INPUT directories
|
||||
#
|
||||
done
|
||||
#
|
||||
# # # # # # # # # # # # # # # # # # # # #
|
||||
|
|
@ -0,0 +1 @@
|
|||
;
|
||||
Binary file not shown.
|
|
@ -0,0 +1,8 @@
|
|||
/* syslimits.h stands for the system's own limits.h file.
|
||||
If we can use it ok unmodified, then we install this text.
|
||||
If fixincludes fixes it, then the fixed version is installed
|
||||
instead of this text. */
|
||||
|
||||
#define _GCC_NEXT_LIMITS_H /* tell gcc's limits.h to recurse */
|
||||
#include_next <limits.h>
|
||||
#undef _GCC_NEXT_LIMITS_H
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
This README file is copied into the directory for GCC-only header files
|
||||
when fixincludes is run by the makefile for GCC.
|
||||
|
||||
Many of the files in this directory were automatically edited from the
|
||||
standard system header files by the fixincludes process. They are
|
||||
system-specific, and will not work on any other kind of system. They
|
||||
are also not part of GCC. The reason we have to do this is because
|
||||
GCC requires ANSI C headers and many vendors supply ANSI-incompatible
|
||||
headers.
|
||||
|
||||
Because this is an automated process, sometimes headers get "fixed"
|
||||
that do not, strictly speaking, need a fix. As long as nothing is broken
|
||||
by the process, it is just an unfortunate collateral inconvenience.
|
||||
We would like to rectify it, if it is not "too inconvenient".
|
||||
|
|
@ -0,0 +1,171 @@
|
|||
/* Copyright (C) 1992-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This administrivia gets added to the beginning of limits.h
|
||||
if the system has its own version of limits.h. */
|
||||
|
||||
/* We use _GCC_LIMITS_H_ because we want this not to match
|
||||
any macros that the system's limits.h uses for its own purposes. */
|
||||
#ifndef _GCC_LIMITS_H_ /* Terminated in limity.h. */
|
||||
#define _GCC_LIMITS_H_
|
||||
|
||||
#ifndef _LIBC_LIMITS_H_
|
||||
/* Use "..." so that we find syslimits.h only in this same directory. */
|
||||
#include "syslimits.h"
|
||||
#endif
|
||||
/* Copyright (C) 1991-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _LIMITS_H___
|
||||
#define _LIMITS_H___
|
||||
|
||||
/* Number of bits in a `char'. */
|
||||
#undef CHAR_BIT
|
||||
#define CHAR_BIT __CHAR_BIT__
|
||||
|
||||
/* Maximum length of a multibyte character. */
|
||||
#ifndef MB_LEN_MAX
|
||||
#define MB_LEN_MAX 1
|
||||
#endif
|
||||
|
||||
/* Minimum and maximum values a `signed char' can hold. */
|
||||
#undef SCHAR_MIN
|
||||
#define SCHAR_MIN (-SCHAR_MAX - 1)
|
||||
#undef SCHAR_MAX
|
||||
#define SCHAR_MAX __SCHAR_MAX__
|
||||
|
||||
/* Maximum value an `unsigned char' can hold. (Minimum is 0). */
|
||||
#undef UCHAR_MAX
|
||||
#if __SCHAR_MAX__ == __INT_MAX__
|
||||
# define UCHAR_MAX (SCHAR_MAX * 2U + 1U)
|
||||
#else
|
||||
# define UCHAR_MAX (SCHAR_MAX * 2 + 1)
|
||||
#endif
|
||||
|
||||
/* Minimum and maximum values a `char' can hold. */
|
||||
#ifdef __CHAR_UNSIGNED__
|
||||
# undef CHAR_MIN
|
||||
# if __SCHAR_MAX__ == __INT_MAX__
|
||||
# define CHAR_MIN 0U
|
||||
# else
|
||||
# define CHAR_MIN 0
|
||||
# endif
|
||||
# undef CHAR_MAX
|
||||
# define CHAR_MAX UCHAR_MAX
|
||||
#else
|
||||
# undef CHAR_MIN
|
||||
# define CHAR_MIN SCHAR_MIN
|
||||
# undef CHAR_MAX
|
||||
# define CHAR_MAX SCHAR_MAX
|
||||
#endif
|
||||
|
||||
/* Minimum and maximum values a `signed short int' can hold. */
|
||||
#undef SHRT_MIN
|
||||
#define SHRT_MIN (-SHRT_MAX - 1)
|
||||
#undef SHRT_MAX
|
||||
#define SHRT_MAX __SHRT_MAX__
|
||||
|
||||
/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */
|
||||
#undef USHRT_MAX
|
||||
#if __SHRT_MAX__ == __INT_MAX__
|
||||
# define USHRT_MAX (SHRT_MAX * 2U + 1U)
|
||||
#else
|
||||
# define USHRT_MAX (SHRT_MAX * 2 + 1)
|
||||
#endif
|
||||
|
||||
/* Minimum and maximum values a `signed int' can hold. */
|
||||
#undef INT_MIN
|
||||
#define INT_MIN (-INT_MAX - 1)
|
||||
#undef INT_MAX
|
||||
#define INT_MAX __INT_MAX__
|
||||
|
||||
/* Maximum value an `unsigned int' can hold. (Minimum is 0). */
|
||||
#undef UINT_MAX
|
||||
#define UINT_MAX (INT_MAX * 2U + 1U)
|
||||
|
||||
/* Minimum and maximum values a `signed long int' can hold.
|
||||
(Same as `int'). */
|
||||
#undef LONG_MIN
|
||||
#define LONG_MIN (-LONG_MAX - 1L)
|
||||
#undef LONG_MAX
|
||||
#define LONG_MAX __LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */
|
||||
#undef ULONG_MAX
|
||||
#define ULONG_MAX (LONG_MAX * 2UL + 1UL)
|
||||
|
||||
#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
/* Minimum and maximum values a `signed long long int' can hold. */
|
||||
# undef LLONG_MIN
|
||||
# define LLONG_MIN (-LLONG_MAX - 1LL)
|
||||
# undef LLONG_MAX
|
||||
# define LLONG_MAX __LONG_LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
|
||||
# undef ULLONG_MAX
|
||||
# define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
|
||||
#endif
|
||||
|
||||
#if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__)
|
||||
/* Minimum and maximum values a `signed long long int' can hold. */
|
||||
# undef LONG_LONG_MIN
|
||||
# define LONG_LONG_MIN (-LONG_LONG_MAX - 1LL)
|
||||
# undef LONG_LONG_MAX
|
||||
# define LONG_LONG_MAX __LONG_LONG_MAX__
|
||||
|
||||
/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */
|
||||
# undef ULONG_LONG_MAX
|
||||
# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1ULL)
|
||||
#endif
|
||||
|
||||
#endif /* _LIMITS_H___ */
|
||||
/* This administrivia gets added to the end of limits.h
|
||||
if the system has its own version of limits.h. */
|
||||
|
||||
#else /* not _GCC_LIMITS_H_ */
|
||||
|
||||
#ifdef _GCC_NEXT_LIMITS_H
|
||||
#include_next <limits.h> /* recurse down to the real one */
|
||||
#endif
|
||||
|
||||
#endif /* not _GCC_LIMITS_H_ */
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2002, 2007, 2009 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 3, or (at your option) any later
|
||||
#version.
|
||||
|
||||
#GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
#ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
#FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
#for more details.
|
||||
|
||||
#You should have received a copy of the GNU General Public License
|
||||
#along with GCC; see the file COPYING3. If not see
|
||||
#<http://www.gnu.org/licenses/>.
|
||||
|
||||
# Basic information
|
||||
target=arm-none-eabi
|
||||
target_noncanonical=arm-none-eabi
|
||||
version=4.8.3
|
||||
|
||||
VERBOSE=0
|
||||
while [ x$1 = x-v ] ; do
|
||||
shift
|
||||
VERBOSE=`expr $VERBOSE + 1`
|
||||
done
|
||||
export VERBOSE
|
||||
|
||||
if [ x$1 = x--help ] ; then
|
||||
echo "Usage: mkheaders [options] [prefix [isysroot]]"
|
||||
echo "Options:"
|
||||
echo " -v Print more output (may be repeated for even more output)"
|
||||
echo " --help This help"
|
||||
echo " --version Print version information"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ x$1 = x--version ] ; then
|
||||
echo "mkheaders (GCC) version $version"
|
||||
echo "Copyright 2002, 2007, 2009 Free Software Foundation, Inc."
|
||||
echo "This program is free software; you may redistribute it under the"
|
||||
echo "terms of the GNU General Public License. This program has"
|
||||
echo "absolutely no warranty."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Common prefix for installation directories.
|
||||
if [ x$1 != x ] ; then
|
||||
prefix=$1
|
||||
shift
|
||||
else
|
||||
prefix=/home/build/work/GCC-4-8-build/install-native
|
||||
fi
|
||||
|
||||
# Allow for alternate isysroot in which to find headers
|
||||
if [ x$1 != x ] ; then
|
||||
isysroot=$1
|
||||
shift
|
||||
else
|
||||
isysroot=
|
||||
fi
|
||||
|
||||
# Directory in which to put host dependent programs and libraries
|
||||
exec_prefix=${prefix}
|
||||
# Directory in which to put the directories used by the compiler.
|
||||
libdir=${exec_prefix}/lib
|
||||
libexecdir=/home/build/work/GCC-4-8-build/install-native/lib
|
||||
# Directory in which the compiler finds libraries, etc.
|
||||
libsubdir=${libdir}/gcc/${target_noncanonical}/${version}
|
||||
# Directory in which the compiler finds executables
|
||||
libexecsubdir=${libexecdir}/gcc/${target_noncanonical}/${version}
|
||||
|
||||
itoolsdir=${libexecsubdir}/install-tools
|
||||
itoolsdatadir=${libsubdir}/install-tools
|
||||
incdir=${libsubdir}/include-fixed
|
||||
mkinstalldirs="/bin/sh ${itoolsdir}/mkinstalldirs"
|
||||
|
||||
cd ${itoolsdir}
|
||||
rm -rf ${incdir}/*
|
||||
|
||||
for ml in `cat ${itoolsdatadir}/fixinc_list`; do
|
||||
sysroot_headers_suffix=`echo ${ml} | sed -e 's/;.*$//'`
|
||||
multi_dir=`echo ${ml} | sed -e 's/^[^;]*;//'`
|
||||
subincdir=${incdir}${multi_dir}
|
||||
. ${itoolsdatadir}/mkheaders.conf
|
||||
if [ x${STMP_FIXINC} != x ] ; then
|
||||
TARGET_MACHINE="${target}" target_canonical="${target}" \
|
||||
MACRO_LIST="${itoolsdatadir}/macro_list" \
|
||||
/bin/sh ./fixinc.sh ${subincdir} \
|
||||
${isysroot}${SYSTEM_HEADER_DIR} ${OTHER_FIXINCLUDES_DIRS}
|
||||
rm -f ${subincdir}/syslimits.h
|
||||
if [ -f ${subincdir}/limits.h ]; then
|
||||
mv ${subincdir}/limits.h ${subincdir}/syslimits.h
|
||||
else
|
||||
cp ${itoolsdatadir}/gsyslimits.h ${subincdir}/syslimits.h
|
||||
fi
|
||||
fi
|
||||
|
||||
cp ${itoolsdatadir}/include${multi_dir}/limits.h ${subincdir}
|
||||
done
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
SYSTEM_HEADER_DIR="/home/build/work/GCC-4-8-build/install-native/arm-none-eabi${sysroot_headers_suffix}/usr/include"
|
||||
OTHER_FIXINCLUDES_DIRS=""
|
||||
STMP_FIXINC="stmp-fixinc"
|
||||
|
|
@ -0,0 +1,162 @@
|
|||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
|
||||
scriptversion=2009-04-28.21; # UTC
|
||||
|
||||
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Public domain.
|
||||
#
|
||||
# This file is maintained in Automake, please report
|
||||
# bugs to <bug-automake@gnu.org> or send patches to
|
||||
# <automake-patches@gnu.org>.
|
||||
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
errstatus=0
|
||||
dirmode=
|
||||
|
||||
usage="\
|
||||
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
|
||||
|
||||
Create each directory DIR (with mode MODE, if specified), including all
|
||||
leading file name components.
|
||||
|
||||
Report bugs to <bug-automake@gnu.org>."
|
||||
|
||||
# process command line arguments
|
||||
while test $# -gt 0 ; do
|
||||
case $1 in
|
||||
-h | --help | --h*) # -h for help
|
||||
echo "$usage"
|
||||
exit $?
|
||||
;;
|
||||
-m) # -m PERM arg
|
||||
shift
|
||||
test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
|
||||
dirmode=$1
|
||||
shift
|
||||
;;
|
||||
--version)
|
||||
echo "$0 $scriptversion"
|
||||
exit $?
|
||||
;;
|
||||
--) # stop option processing
|
||||
shift
|
||||
break
|
||||
;;
|
||||
-*) # unknown option
|
||||
echo "$usage" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
*) # first non-opt arg
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
for file
|
||||
do
|
||||
if test -d "$file"; then
|
||||
shift
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
case $# in
|
||||
0) exit 0 ;;
|
||||
esac
|
||||
|
||||
# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
|
||||
# mkdir -p a/c at the same time, both will detect that a is missing,
|
||||
# one will create a, then the other will try to create a and die with
|
||||
# a "File exists" error. This is a problem when calling mkinstalldirs
|
||||
# from a parallel make. We use --version in the probe to restrict
|
||||
# ourselves to GNU mkdir, which is thread-safe.
|
||||
case $dirmode in
|
||||
'')
|
||||
if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
|
||||
echo "mkdir -p -- $*"
|
||||
exec mkdir -p -- "$@"
|
||||
else
|
||||
# On NextStep and OpenStep, the `mkdir' command does not
|
||||
# recognize any option. It will interpret all options as
|
||||
# directories to create, and then abort because `.' already
|
||||
# exists.
|
||||
test -d ./-p && rmdir ./-p
|
||||
test -d ./--version && rmdir ./--version
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
|
||||
test ! -d ./--version; then
|
||||
echo "mkdir -m $dirmode -p -- $*"
|
||||
exec mkdir -m "$dirmode" -p -- "$@"
|
||||
else
|
||||
# Clean up after NextStep and OpenStep mkdir.
|
||||
for d in ./-m ./-p ./--version "./$dirmode";
|
||||
do
|
||||
test -d $d && rmdir $d
|
||||
done
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
for file
|
||||
do
|
||||
case $file in
|
||||
/*) pathcomp=/ ;;
|
||||
*) pathcomp= ;;
|
||||
esac
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
set fnord $file
|
||||
shift
|
||||
IFS=$oIFS
|
||||
|
||||
for d
|
||||
do
|
||||
test "x$d" = x && continue
|
||||
|
||||
pathcomp=$pathcomp$d
|
||||
case $pathcomp in
|
||||
-*) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp"
|
||||
|
||||
mkdir "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
else
|
||||
if test ! -z "$dirmode"; then
|
||||
echo "chmod $dirmode $pathcomp"
|
||||
lasterr=
|
||||
chmod "$dirmode" "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -z "$lasterr"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
pathcomp=$pathcomp/
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# Local Variables:
|
||||
# mode: shell-script
|
||||
# sh-indentation: 2
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,74 @@
|
|||
/****************************************************************************
|
||||
* *
|
||||
* GNAT COMPILER COMPONENTS *
|
||||
* *
|
||||
* GNAT-SPECIFIC GCC TREE CODES *
|
||||
* *
|
||||
* Specification *
|
||||
* *
|
||||
* Copyright (C) 1992-2009, Free Software Foundation, Inc. *
|
||||
* *
|
||||
* GNAT is free software; you can redistribute it and/or modify it under *
|
||||
* terms of the GNU General Public License as published by the Free Soft- *
|
||||
* ware Foundation; either version 3, or (at your option) any later ver- *
|
||||
* sion. GNAT is distributed in the hope that it will be useful, but WITH- *
|
||||
* OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
|
||||
* for more details. You should have received a copy of the GNU General *
|
||||
* Public License along with GCC; see the file COPYING3. If not see *
|
||||
* <http://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
* GNAT was originally developed by the GNAT team at New York University. *
|
||||
* Extensive contributions were provided by Ada Core Technologies Inc. *
|
||||
* *
|
||||
****************************************************************************/
|
||||
|
||||
/* A type that is an unconstrained array. This node is never passed to GCC.
|
||||
TREE_TYPE is the type of the fat pointer and TYPE_OBJECT_RECORD_TYPE is
|
||||
the type of a record containing the template and data. */
|
||||
DEFTREECODE (UNCONSTRAINED_ARRAY_TYPE, "unconstrained_array_type", tcc_type, 0)
|
||||
|
||||
/* A reference to an unconstrained array. This node only exists as an
|
||||
intermediate node during the translation of a GNAT tree to a GCC tree;
|
||||
it is never passed to GCC. The only field used is operand 0, which
|
||||
is the fat pointer object. */
|
||||
DEFTREECODE (UNCONSTRAINED_ARRAY_REF, "unconstrained_array_ref",
|
||||
tcc_reference, 1)
|
||||
|
||||
/* An expression that returns an RTL suitable for its type. Operand 0
|
||||
is an expression to be evaluated for side effects only. */
|
||||
DEFTREECODE (NULL_EXPR, "null_expr", tcc_expression, 1)
|
||||
|
||||
/* Same as PLUS_EXPR, except that no modulo reduction is applied.
|
||||
This is used for loops and never shows up in the tree. */
|
||||
DEFTREECODE (PLUS_NOMOD_EXPR, "plus_nomod_expr", tcc_binary, 2)
|
||||
|
||||
/* Same as MINUS_EXPR, except that no modulo reduction is applied.
|
||||
This is used for loops and never shows up in the tree. */
|
||||
DEFTREECODE (MINUS_NOMOD_EXPR, "minus_nomod_expr", tcc_binary, 2)
|
||||
|
||||
/* Same as ADDR_EXPR, except that if the operand represents a bit field,
|
||||
return the address of the byte containing the bit. This is used
|
||||
for the Address attribute and never shows up in the tree. */
|
||||
DEFTREECODE (ATTR_ADDR_EXPR, "attr_addr_expr", tcc_reference, 1)
|
||||
|
||||
/* Here are the tree codes for the statement types known to Ada. These
|
||||
must be at the end of this file to allow IS_ADA_STMT to work. */
|
||||
|
||||
/* This is how record_code_position and insert_code_for work. The former
|
||||
makes this tree node, whose operand is a statement. The latter inserts
|
||||
the actual statements into this node. Gimplification consists of
|
||||
just returning the inner statement. */
|
||||
DEFTREECODE (STMT_STMT, "stmt_stmt", tcc_statement, 1)
|
||||
|
||||
/* A loop. LOOP_STMT_COND is the test to exit the loop. LOOP_STMT_UPDATE
|
||||
is the statement to update the loop iteration variable at the continue
|
||||
point. LOOP_STMT_BODY are the statements in the body of the loop. And
|
||||
LOOP_STMT_LABEL points to the LABEL_DECL of the end label of the loop. */
|
||||
DEFTREECODE (LOOP_STMT, "loop_stmt", tcc_statement, 4)
|
||||
|
||||
/* Conditionally exit a loop. EXIT_STMT_COND is the condition, which, if
|
||||
true, will cause the loop to be exited. If no condition is specified,
|
||||
the loop is unconditionally exited. EXIT_STMT_LABEL is the end label
|
||||
corresponding to the loop to exit. */
|
||||
DEFTREECODE (EXIT_STMT, "exit_stmt", tcc_statement, 2)
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
/* Exported functions from alias.c
|
||||
Copyright (C) 2004-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_ALIAS_H
|
||||
#define GCC_ALIAS_H
|
||||
|
||||
/* The type of an alias set. Code currently assumes that variables of
|
||||
this type can take the values 0 (the alias set which aliases
|
||||
everything) and -1 (sometimes indicating that the alias set is
|
||||
unknown, sometimes indicating a memory barrier) and -2 (indicating
|
||||
that the alias set should be set to a unique value but has not been
|
||||
set yet). */
|
||||
typedef int alias_set_type;
|
||||
|
||||
extern alias_set_type new_alias_set (void);
|
||||
extern alias_set_type get_alias_set (tree);
|
||||
extern alias_set_type get_deref_alias_set (tree);
|
||||
extern alias_set_type get_varargs_alias_set (void);
|
||||
extern alias_set_type get_frame_alias_set (void);
|
||||
extern bool component_uses_parent_alias_set (const_tree);
|
||||
extern bool alias_set_subset_of (alias_set_type, alias_set_type);
|
||||
extern void record_alias_subset (alias_set_type, alias_set_type);
|
||||
extern void record_component_aliases (tree);
|
||||
extern int alias_sets_conflict_p (alias_set_type, alias_set_type);
|
||||
extern int alias_sets_must_conflict_p (alias_set_type, alias_set_type);
|
||||
extern int objects_must_conflict_p (tree, tree);
|
||||
extern int nonoverlapping_memrefs_p (const_rtx, const_rtx, bool);
|
||||
|
||||
/* 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 ((alias_set_type) -1)
|
||||
|
||||
#endif /* GCC_ALIAS_H */
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#include "tree.def"
|
||||
END_OF_BASE_TREE_CODES
|
||||
#include "c-family/c-common.def"
|
||||
#include "ada/gcc-interface/ada-tree.def"
|
||||
#include "cp/cp-tree.def"
|
||||
#include "java/java-tree.def"
|
||||
#include "objc/objc-tree.def"
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
/* Functions to support a pool of allocatable objects
|
||||
Copyright (C) 1997-2013 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
#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;
|
||||
|
||||
/* These are the elements that have been allocated at least once and freed. */
|
||||
alloc_pool_list returned_free_list;
|
||||
|
||||
/* These are the elements that have not yet been allocated out of
|
||||
the last block obtained from XNEWVEC. */
|
||||
char* virgin_free_list;
|
||||
|
||||
/* The number of elements in the virgin_free_list that can be
|
||||
allocated before needing another block. */
|
||||
size_t virgin_elts_remaining;
|
||||
|
||||
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 empty_alloc_pool (alloc_pool);
|
||||
extern void free_alloc_pool_if_empty (alloc_pool *);
|
||||
extern void *pool_alloc (alloc_pool) ATTRIBUTE_MALLOC;
|
||||
extern void pool_free (alloc_pool, void *);
|
||||
extern void dump_alloc_pool_statistics (void);
|
||||
#endif
|
||||
|
|
@ -0,0 +1,441 @@
|
|||
/* ANSI and traditional C compatability macros
|
||||
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
||||
2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010
|
||||
Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
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. */
|
||||
|
||||
/* ANSI and traditional C compatibility macros
|
||||
|
||||
ANSI C is assumed if __STDC__ is #defined.
|
||||
|
||||
Macro ANSI C definition Traditional C definition
|
||||
----- ---- - ---------- ----------- - ----------
|
||||
ANSI_PROTOTYPES 1 not defined
|
||||
PTR `void *' `char *'
|
||||
PTRCONST `void *const' `char *'
|
||||
LONG_DOUBLE `long double' `double'
|
||||
const not defined `'
|
||||
volatile not defined `'
|
||||
signed not defined `'
|
||||
VA_START(ap, var) va_start(ap, var) va_start(ap)
|
||||
|
||||
Note that it is safe to write "void foo();" indicating a function
|
||||
with no return value, in all K+R compilers we have been able to test.
|
||||
|
||||
For declaring functions with prototypes, we also provide these:
|
||||
|
||||
PARAMS ((prototype))
|
||||
-- for functions which take a fixed number of arguments. Use this
|
||||
when declaring the function. When defining the function, write a
|
||||
K+R style argument list. For example:
|
||||
|
||||
char *strcpy PARAMS ((char *dest, char *source));
|
||||
...
|
||||
char *
|
||||
strcpy (dest, source)
|
||||
char *dest;
|
||||
char *source;
|
||||
{ ... }
|
||||
|
||||
|
||||
VPARAMS ((prototype, ...))
|
||||
-- for functions which take a variable number of arguments. Use
|
||||
PARAMS to declare the function, VPARAMS to define it. For example:
|
||||
|
||||
int printf PARAMS ((const char *format, ...));
|
||||
...
|
||||
int
|
||||
printf VPARAMS ((const char *format, ...))
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
For writing functions which take variable numbers of arguments, we
|
||||
also provide the VA_OPEN, VA_CLOSE, and VA_FIXEDARG macros. These
|
||||
hide the differences between K+R <varargs.h> and C89 <stdarg.h> more
|
||||
thoroughly than the simple VA_START() macro mentioned above.
|
||||
|
||||
VA_OPEN and VA_CLOSE are used *instead of* va_start and va_end.
|
||||
Immediately after VA_OPEN, put a sequence of VA_FIXEDARG calls
|
||||
corresponding to the list of fixed arguments. Then use va_arg
|
||||
normally to get the variable arguments, or pass your va_list object
|
||||
around. You do not declare the va_list yourself; VA_OPEN does it
|
||||
for you.
|
||||
|
||||
Here is a complete example:
|
||||
|
||||
int
|
||||
printf VPARAMS ((const char *format, ...))
|
||||
{
|
||||
int result;
|
||||
|
||||
VA_OPEN (ap, format);
|
||||
VA_FIXEDARG (ap, const char *, format);
|
||||
|
||||
result = vfprintf (stdout, format, ap);
|
||||
VA_CLOSE (ap);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
You can declare variables either before or after the VA_OPEN,
|
||||
VA_FIXEDARG sequence. Also, VA_OPEN and VA_CLOSE are the beginning
|
||||
and end of a block. They must appear at the same nesting level,
|
||||
and any variables declared after VA_OPEN go out of scope at
|
||||
VA_CLOSE. Unfortunately, with a K+R compiler, that includes the
|
||||
argument list. You can have multiple instances of VA_OPEN/VA_CLOSE
|
||||
pairs in a single function in case you need to traverse the
|
||||
argument list more than once.
|
||||
|
||||
For ease of writing code which uses GCC extensions but needs to be
|
||||
portable to other compilers, we provide the GCC_VERSION macro that
|
||||
simplifies testing __GNUC__ and __GNUC_MINOR__ together, and various
|
||||
wrappers around __attribute__. Also, __extension__ will be #defined
|
||||
to nothing if it doesn't work. See below.
|
||||
|
||||
This header also defines a lot of obsolete macros:
|
||||
CONST, VOLATILE, SIGNED, PROTO, EXFUN, DEFUN, DEFUN_VOID,
|
||||
AND, DOTS, NOARGS. Don't use them. */
|
||||
|
||||
#ifndef _ANSIDECL_H
|
||||
#define _ANSIDECL_H 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Every source file includes this file,
|
||||
so they will all get the switch for lint. */
|
||||
/* LINTLIBRARY */
|
||||
|
||||
/* Using MACRO(x,y) in cpp #if conditionals does not work with some
|
||||
older preprocessors. Thus we can't define something like this:
|
||||
|
||||
#define HAVE_GCC_VERSION(MAJOR, MINOR) \
|
||||
(__GNUC__ > (MAJOR) || (__GNUC__ == (MAJOR) && __GNUC_MINOR__ >= (MINOR)))
|
||||
|
||||
and then test "#if HAVE_GCC_VERSION(2,7)".
|
||||
|
||||
So instead we use the macro below and test it against specific values. */
|
||||
|
||||
/* This macro simplifies testing whether we are using gcc, and if it
|
||||
is of a particular minimum version. (Both major & minor numbers are
|
||||
significant.) This macro will evaluate to 0 if we are not using
|
||||
gcc at all. */
|
||||
#ifndef GCC_VERSION
|
||||
#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
|
||||
#endif /* GCC_VERSION */
|
||||
|
||||
#if defined (__STDC__) || defined(__cplusplus) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(_WIN32)
|
||||
/* All known AIX compilers implement these things (but don't always
|
||||
define __STDC__). The RISC/OS MIPS compiler defines these things
|
||||
in SVR4 mode, but does not define __STDC__. */
|
||||
/* eraxxon@alumni.rice.edu: The Compaq C++ compiler, unlike many other
|
||||
C++ compilers, does not define __STDC__, though it acts as if this
|
||||
was so. (Verified versions: 5.7, 6.2, 6.3, 6.5) */
|
||||
|
||||
#define ANSI_PROTOTYPES 1
|
||||
#define PTR void *
|
||||
#define PTRCONST void *const
|
||||
#define LONG_DOUBLE long double
|
||||
|
||||
/* PARAMS is often defined elsewhere (e.g. by libintl.h), so wrap it in
|
||||
a #ifndef. */
|
||||
#ifndef PARAMS
|
||||
#define PARAMS(ARGS) ARGS
|
||||
#endif
|
||||
|
||||
#define VPARAMS(ARGS) ARGS
|
||||
#define VA_START(VA_LIST, VAR) va_start(VA_LIST, VAR)
|
||||
|
||||
/* variadic function helper macros */
|
||||
/* "struct Qdmy" swallows the semicolon after VA_OPEN/VA_FIXEDARG's
|
||||
use without inhibiting further decls and without declaring an
|
||||
actual variable. */
|
||||
#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP, VAR); { struct Qdmy
|
||||
#define VA_CLOSE(AP) } va_end(AP); }
|
||||
#define VA_FIXEDARG(AP, T, N) struct Qdmy
|
||||
|
||||
#undef const
|
||||
#undef volatile
|
||||
#undef signed
|
||||
|
||||
/* inline requires special treatment; it's in C99, and GCC >=2.7 supports
|
||||
it too, but it's not in C89. */
|
||||
#undef inline
|
||||
#if __STDC_VERSION__ >= 199901L || defined(__cplusplus) || (defined(__SUNPRO_C) && defined(__C99FEATURES__))
|
||||
/* it's a keyword */
|
||||
#else
|
||||
# if GCC_VERSION >= 2007
|
||||
# define inline __inline__ /* __inline__ prevents -pedantic warnings */
|
||||
# else
|
||||
# define inline /* nothing */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* These are obsolete. Do not use. */
|
||||
#ifndef IN_GCC
|
||||
#define CONST const
|
||||
#define VOLATILE volatile
|
||||
#define SIGNED signed
|
||||
|
||||
#define PROTO(type, name, arglist) type name arglist
|
||||
#define EXFUN(name, proto) name proto
|
||||
#define DEFUN(name, arglist, args) name(args)
|
||||
#define DEFUN_VOID(name) name(void)
|
||||
#define AND ,
|
||||
#define DOTS , ...
|
||||
#define NOARGS void
|
||||
#endif /* ! IN_GCC */
|
||||
|
||||
#else /* Not ANSI C. */
|
||||
|
||||
#undef ANSI_PROTOTYPES
|
||||
#define PTR char *
|
||||
#define PTRCONST PTR
|
||||
#define LONG_DOUBLE double
|
||||
|
||||
#define PARAMS(args) ()
|
||||
#define VPARAMS(args) (va_alist) va_dcl
|
||||
#define VA_START(va_list, var) va_start(va_list)
|
||||
|
||||
#define VA_OPEN(AP, VAR) { va_list AP; va_start(AP); { struct Qdmy
|
||||
#define VA_CLOSE(AP) } va_end(AP); }
|
||||
#define VA_FIXEDARG(AP, TYPE, NAME) TYPE NAME = va_arg(AP, TYPE)
|
||||
|
||||
/* some systems define these in header files for non-ansi mode */
|
||||
#undef const
|
||||
#undef volatile
|
||||
#undef signed
|
||||
#undef inline
|
||||
#define const
|
||||
#define volatile
|
||||
#define signed
|
||||
#define inline
|
||||
|
||||
#ifndef IN_GCC
|
||||
#define CONST
|
||||
#define VOLATILE
|
||||
#define SIGNED
|
||||
|
||||
#define PROTO(type, name, arglist) type name ()
|
||||
#define EXFUN(name, proto) name()
|
||||
#define DEFUN(name, arglist, args) name arglist args;
|
||||
#define DEFUN_VOID(name) name()
|
||||
#define AND ;
|
||||
#define DOTS
|
||||
#define NOARGS
|
||||
#endif /* ! IN_GCC */
|
||||
|
||||
#endif /* ANSI C. */
|
||||
|
||||
/* Define macros for some gcc attributes. This permits us to use the
|
||||
macros freely, and know that they will come into play for the
|
||||
version of gcc in which they are supported. */
|
||||
|
||||
#if (GCC_VERSION < 2007)
|
||||
# define __attribute__(x)
|
||||
#endif
|
||||
|
||||
/* Attribute __malloc__ on functions was valid as of gcc 2.96. */
|
||||
#ifndef ATTRIBUTE_MALLOC
|
||||
# if (GCC_VERSION >= 2096)
|
||||
# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
|
||||
# else
|
||||
# define ATTRIBUTE_MALLOC
|
||||
# endif /* GNUC >= 2.96 */
|
||||
#endif /* ATTRIBUTE_MALLOC */
|
||||
|
||||
/* Attributes on labels were valid as of gcc 2.93 and g++ 4.5. For
|
||||
g++ an attribute on a label must be followed by a semicolon. */
|
||||
#ifndef ATTRIBUTE_UNUSED_LABEL
|
||||
# ifndef __cplusplus
|
||||
# if GCC_VERSION >= 2093
|
||||
# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
|
||||
# else
|
||||
# define ATTRIBUTE_UNUSED_LABEL
|
||||
# endif
|
||||
# else
|
||||
# if GCC_VERSION >= 4005
|
||||
# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED ;
|
||||
# else
|
||||
# define ATTRIBUTE_UNUSED_LABEL
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Similarly to ARG_UNUSED below. Prior to GCC 3.4, the C++ frontend
|
||||
couldn't parse attributes placed after the identifier name, and now
|
||||
the entire compiler is built with C++. */
|
||||
#ifndef ATTRIBUTE_UNUSED
|
||||
#if GCC_VERSION >= 3004
|
||||
# define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
|
||||
#else
|
||||
#define ATTRIBUTE_UNUSED
|
||||
#endif
|
||||
#endif /* ATTRIBUTE_UNUSED */
|
||||
|
||||
/* Before GCC 3.4, the C++ frontend couldn't parse attributes placed after the
|
||||
identifier name. */
|
||||
#if ! defined(__cplusplus) || (GCC_VERSION >= 3004)
|
||||
# define ARG_UNUSED(NAME) NAME ATTRIBUTE_UNUSED
|
||||
#else /* !__cplusplus || GNUC >= 3.4 */
|
||||
# define ARG_UNUSED(NAME) NAME
|
||||
#endif /* !__cplusplus || GNUC >= 3.4 */
|
||||
|
||||
#ifndef ATTRIBUTE_NORETURN
|
||||
#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
|
||||
#endif /* ATTRIBUTE_NORETURN */
|
||||
|
||||
/* Attribute `nonnull' was valid as of gcc 3.3. */
|
||||
#ifndef ATTRIBUTE_NONNULL
|
||||
# if (GCC_VERSION >= 3003)
|
||||
# define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m)))
|
||||
# else
|
||||
# define ATTRIBUTE_NONNULL(m)
|
||||
# endif /* GNUC >= 3.3 */
|
||||
#endif /* ATTRIBUTE_NONNULL */
|
||||
|
||||
/* Attribute `pure' was valid as of gcc 3.0. */
|
||||
#ifndef ATTRIBUTE_PURE
|
||||
# if (GCC_VERSION >= 3000)
|
||||
# define ATTRIBUTE_PURE __attribute__ ((__pure__))
|
||||
# else
|
||||
# define ATTRIBUTE_PURE
|
||||
# endif /* GNUC >= 3.0 */
|
||||
#endif /* ATTRIBUTE_PURE */
|
||||
|
||||
/* Use ATTRIBUTE_PRINTF when the format specifier must not be NULL.
|
||||
This was the case for the `printf' format attribute by itself
|
||||
before GCC 3.3, but as of 3.3 we need to add the `nonnull'
|
||||
attribute to retain this behavior. */
|
||||
#ifndef ATTRIBUTE_PRINTF
|
||||
#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) ATTRIBUTE_NONNULL(m)
|
||||
#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
|
||||
#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
|
||||
#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
|
||||
#define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
|
||||
#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
|
||||
#endif /* ATTRIBUTE_PRINTF */
|
||||
|
||||
/* Use ATTRIBUTE_FPTR_PRINTF when the format attribute is to be set on
|
||||
a function pointer. Format attributes were allowed on function
|
||||
pointers as of gcc 3.1. */
|
||||
#ifndef ATTRIBUTE_FPTR_PRINTF
|
||||
# if (GCC_VERSION >= 3001)
|
||||
# define ATTRIBUTE_FPTR_PRINTF(m, n) ATTRIBUTE_PRINTF(m, n)
|
||||
# else
|
||||
# define ATTRIBUTE_FPTR_PRINTF(m, n)
|
||||
# endif /* GNUC >= 3.1 */
|
||||
# define ATTRIBUTE_FPTR_PRINTF_1 ATTRIBUTE_FPTR_PRINTF(1, 2)
|
||||
# define ATTRIBUTE_FPTR_PRINTF_2 ATTRIBUTE_FPTR_PRINTF(2, 3)
|
||||
# define ATTRIBUTE_FPTR_PRINTF_3 ATTRIBUTE_FPTR_PRINTF(3, 4)
|
||||
# define ATTRIBUTE_FPTR_PRINTF_4 ATTRIBUTE_FPTR_PRINTF(4, 5)
|
||||
# define ATTRIBUTE_FPTR_PRINTF_5 ATTRIBUTE_FPTR_PRINTF(5, 6)
|
||||
#endif /* ATTRIBUTE_FPTR_PRINTF */
|
||||
|
||||
/* Use ATTRIBUTE_NULL_PRINTF when the format specifier may be NULL. A
|
||||
NULL format specifier was allowed as of gcc 3.3. */
|
||||
#ifndef ATTRIBUTE_NULL_PRINTF
|
||||
# if (GCC_VERSION >= 3003)
|
||||
# define ATTRIBUTE_NULL_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
|
||||
# else
|
||||
# define ATTRIBUTE_NULL_PRINTF(m, n)
|
||||
# endif /* GNUC >= 3.3 */
|
||||
# define ATTRIBUTE_NULL_PRINTF_1 ATTRIBUTE_NULL_PRINTF(1, 2)
|
||||
# define ATTRIBUTE_NULL_PRINTF_2 ATTRIBUTE_NULL_PRINTF(2, 3)
|
||||
# define ATTRIBUTE_NULL_PRINTF_3 ATTRIBUTE_NULL_PRINTF(3, 4)
|
||||
# define ATTRIBUTE_NULL_PRINTF_4 ATTRIBUTE_NULL_PRINTF(4, 5)
|
||||
# define ATTRIBUTE_NULL_PRINTF_5 ATTRIBUTE_NULL_PRINTF(5, 6)
|
||||
#endif /* ATTRIBUTE_NULL_PRINTF */
|
||||
|
||||
/* Attribute `sentinel' was valid as of gcc 3.5. */
|
||||
#ifndef ATTRIBUTE_SENTINEL
|
||||
# if (GCC_VERSION >= 3005)
|
||||
# define ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__))
|
||||
# else
|
||||
# define ATTRIBUTE_SENTINEL
|
||||
# endif /* GNUC >= 3.5 */
|
||||
#endif /* ATTRIBUTE_SENTINEL */
|
||||
|
||||
|
||||
#ifndef ATTRIBUTE_ALIGNED_ALIGNOF
|
||||
# if (GCC_VERSION >= 3000)
|
||||
# define ATTRIBUTE_ALIGNED_ALIGNOF(m) __attribute__ ((__aligned__ (__alignof__ (m))))
|
||||
# else
|
||||
# define ATTRIBUTE_ALIGNED_ALIGNOF(m)
|
||||
# endif /* GNUC >= 3.0 */
|
||||
#endif /* ATTRIBUTE_ALIGNED_ALIGNOF */
|
||||
|
||||
/* Useful for structures whose layout must much some binary specification
|
||||
regardless of the alignment and padding qualities of the compiler. */
|
||||
#ifndef ATTRIBUTE_PACKED
|
||||
# define ATTRIBUTE_PACKED __attribute__ ((packed))
|
||||
#endif
|
||||
|
||||
/* Attribute `hot' and `cold' was valid as of gcc 4.3. */
|
||||
#ifndef ATTRIBUTE_COLD
|
||||
# if (GCC_VERSION >= 4003)
|
||||
# define ATTRIBUTE_COLD __attribute__ ((__cold__))
|
||||
# else
|
||||
# define ATTRIBUTE_COLD
|
||||
# endif /* GNUC >= 4.3 */
|
||||
#endif /* ATTRIBUTE_COLD */
|
||||
#ifndef ATTRIBUTE_HOT
|
||||
# if (GCC_VERSION >= 4003)
|
||||
# define ATTRIBUTE_HOT __attribute__ ((__hot__))
|
||||
# else
|
||||
# define ATTRIBUTE_HOT
|
||||
# endif /* GNUC >= 4.3 */
|
||||
#endif /* ATTRIBUTE_HOT */
|
||||
|
||||
/* We use __extension__ in some places to suppress -pedantic warnings
|
||||
about GCC extensions. This feature didn't work properly before
|
||||
gcc 2.8. */
|
||||
#if GCC_VERSION < 2008
|
||||
#define __extension__
|
||||
#endif
|
||||
|
||||
/* This is used to declare a const variable which should be visible
|
||||
outside of the current compilation unit. Use it as
|
||||
EXPORTED_CONST int i = 1;
|
||||
This is because the semantics of const are different in C and C++.
|
||||
"extern const" is permitted in C but it looks strange, and gcc
|
||||
warns about it when -Wc++-compat is not used. */
|
||||
#ifdef __cplusplus
|
||||
#define EXPORTED_CONST extern const
|
||||
#else
|
||||
#define EXPORTED_CONST const
|
||||
#endif
|
||||
|
||||
/* Be conservative and only use enum bitfields with C++ or GCC.
|
||||
FIXME: provide a complete autoconf test for buggy enum bitfields. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define ENUM_BITFIELD(TYPE) enum TYPE
|
||||
#elif (GCC_VERSION > 2000)
|
||||
#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE
|
||||
#else
|
||||
#define ENUM_BITFIELD(TYPE) unsigned int
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ansidecl.h */
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,121 @@
|
|||
USER_H=unwind-arm-common.h
|
||||
HASHTAB_H=hashtab.h
|
||||
OBSTACK_H=obstack.h
|
||||
SPLAY_TREE_H=splay-tree.h
|
||||
FIBHEAP_H=fibheap.h
|
||||
PARTITION_H=partition.h
|
||||
DWARF2_H=dwarf2.def
|
||||
XREGEX_H=xregex.h
|
||||
FNMATCH_H=fnmatch.h
|
||||
LINKER_PLUGIN_API_H=plugin-api.h
|
||||
LTO_SYMTAB_H=lto-symtab.h
|
||||
BCONFIG_H=bconfig.h auto-host.h ansidecl.h
|
||||
CONFIG_H=config.h auto-host.h ansidecl.h
|
||||
TCONFIG_H=tconfig.h auto-host.h ansidecl.h
|
||||
TM_P_H=tm_p.h config/arm/arm-protos.h aarch-common-protos.h tm-preds.h
|
||||
GTM_H=tm.h options.h config/dbxelf.h defaults.h insn-constants.h
|
||||
TM_H=tm.h options.h config/dbxelf.h arm-cores.def
|
||||
VEC_H=vec.h statistics.h ggc.h gtype-desc.h statistics.h
|
||||
HASH_TABLE_H=hashtab.h hash-table.h
|
||||
EXCEPT_H=except.h hashtab.h
|
||||
TARGET_H=tm.h options.h config/dbxelf.h arm-cores.def target.h target.def target-hooks-macros.h insn-modes.h
|
||||
C_TARGET_H=c-family/c-target.h c-family/c-target.def target-hooks-macros.h
|
||||
COMMON_TARGET_H=common/common-target.h common-target.def target-hooks-macros.h
|
||||
MACHMODE_H=machmode.h mode-classes.def insn-modes.h
|
||||
HOOKS_H=hooks.h machmode.h mode-classes.def insn-modes.h
|
||||
HOSTHOOKS_DEF_H=hosthooks-def.h hooks.h machmode.h mode-classes.def insn-modes.h
|
||||
LANGHOOKS_DEF_H=langhooks-def.h hooks.h machmode.h mode-classes.def insn-modes.h
|
||||
TARGET_DEF_H=target-def.h target-hooks-def.h hooks.h machmode.h mode-classes.def insn-modes.h targhooks.h
|
||||
C_TARGET_DEF_H=c-family/c-target-def.h c-family/c-target-hooks-def.h coretypes.h tree.h all-tree.def tree.def c-family/c-common.def common-targhooks.h
|
||||
COMMON_TARGET_DEF_H=common/common-target-def.h common/common-target-hooks-def.h hooks.h machmode.h mode-classes.def insn-modes.h
|
||||
RTL_BASE_H=coretypes.h rtl.h rtl.def machmode.h mode-classes.def insn-modes.h reg-notes.def insn-notes.def hashtab.h
|
||||
FIXED_VALUE_H=fixed-value.h machmode.h mode-classes.def insn-modes.h double-int.h
|
||||
RTL_H=coretypes.h rtl.h rtl.def machmode.h mode-classes.def insn-modes.h reg-notes.def insn-notes.def arm-cores.def genrtl.h
|
||||
RTL_ERROR_H=rtl-error.h coretypes.h rtl.h rtl.def machmode.h mode-classes.def insn-modes.h reg-notes.def insn-notes.def line-map.h input.h bversion.h diagnostic.def
|
||||
READ_MD_H=hashtab.h read-md.h
|
||||
PARAMS_H=params.h params.def
|
||||
INTERNAL_FN_H=internal-fn.h internal-fn.def
|
||||
TREE_H=coretypes.h tree.h all-tree.def tree.def c-family/c-common.def arm-cores.def real.h machmode.h mode-classes.def insn-modes.h fixed-value.h machmode.h mode-classes.def insn-modes.h double-int.h
|
||||
REGSET_H=regset.h bitmap.h hashtab.h statistics.h hard-reg-set.h
|
||||
BASIC_BLOCK_H=basic-block.h predict.h predict.def vec.h statistics.h ggc.h gtype-desc.h statistics.h function.h line-map.h input.h machmode.h mode-classes.def insn-modes.h cfg-flags.def cfghooks.h
|
||||
GIMPLE_H=gimple.h gimple.def gsstruct.def pointer-set.h vec.h statistics.h ggc.h gtype-desc.h statistics.h ggc.h gtype-desc.h statistics.h basic-block.h predict.h predict.def vec.h statistics.h ggc.h gtype-desc.h statistics.h function.h arm-cores.def real.h machmode.h mode-classes.def insn-modes.h fixed-value.h machmode.h mode-classes.def insn-modes.h double-int.h tree-ssa-operands.h tree-ssa-alias.h internal-fn.h internal-fn.def
|
||||
TRANS_MEM_H=trans-mem.h
|
||||
GCOV_IO_H=gcov-io.h gcov-iov.h auto-host.h
|
||||
COVERAGE_H=coverage.h gcov-io.h gcov-iov.h auto-host.h
|
||||
DEMANGLE_H=demangle.h
|
||||
RECOG_H=recog.h
|
||||
ALIAS_H=alias.h
|
||||
EMIT_RTL_H=emit-rtl.h
|
||||
FLAGS_H=flags.h flag-types.h options.h flag-types.h config/arm/arm-opts.h arm-cores.def
|
||||
OPTIONS_H=options.h flag-types.h config/arm/arm-opts.h arm-cores.def
|
||||
FUNCTION_H=function.h line-map.h input.h machmode.h mode-classes.def insn-modes.h
|
||||
EXPR_H=expr.h insn-config.h function.h arm-cores.def real.h machmode.h mode-classes.def insn-modes.h fixed-value.h machmode.h mode-classes.def insn-modes.h double-int.h machmode.h mode-classes.def insn-modes.h emit-rtl.h
|
||||
OPTABS_H=optabs.h insn-codes.h insn-opinit.h
|
||||
REGS_H=regs.h machmode.h mode-classes.def insn-modes.h hard-reg-set.h
|
||||
SCHED_INT_H=sched-int.h insn-attr.h insn-attr-common.h hashtab.h statistics.h hard-reg-set.h
|
||||
SEL_SCHED_IR_H=sel-sched-ir.h insn-attr.h insn-attr-common.h hashtab.h statistics.h hard-reg-set.h
|
||||
SEL_SCHED_DUMP_H=sel-sched-dump.h sel-sched-ir.h insn-attr.h insn-attr-common.h hashtab.h statistics.h hard-reg-set.h
|
||||
CFGLOOP_H=cfgloop.h basic-block.h predict.h predict.def vec.h statistics.h ggc.h gtype-desc.h statistics.h function.h hashtab.h statistics.h sbitmap.h
|
||||
IPA_UTILS_H=ipa-utils.h coretypes.h tree.h all-tree.def tree.def c-family/c-common.def plugin-api.h is-a.h
|
||||
IPA_REFERENCE_H=ipa-reference.h bitmap.h arm-cores.def real.h machmode.h mode-classes.def insn-modes.h fixed-value.h machmode.h mode-classes.def insn-modes.h double-int.h
|
||||
CGRAPH_H=cgraph.h vec.h statistics.h ggc.h gtype-desc.h statistics.h coretypes.h tree.h all-tree.def tree.def c-family/c-common.def plugin-api.h is-a.h
|
||||
DF_H=df.h bitmap.h line-map.h input.h machmode.h mode-classes.def insn-modes.h cfg-flags.def cfghooks.h alloc-pool.h timevar.h timevar.def
|
||||
VALTRACK_H=valtrack.h bitmap.h hashtab.h hash-table.h
|
||||
RESOURCE_H=resource.h hard-reg-set.h df.h bitmap.h line-map.h input.h machmode.h mode-classes.def insn-modes.h cfg-flags.def cfghooks.h alloc-pool.h timevar.h timevar.def
|
||||
DDG_H=ddg.h sbitmap.h df.h bitmap.h line-map.h input.h machmode.h mode-classes.def insn-modes.h cfg-flags.def cfghooks.h alloc-pool.h timevar.h timevar.def
|
||||
GCC_H=gcc.h version.h diagnostic-core.h line-map.h input.h bversion.h diagnostic.def
|
||||
GGC_H=ggc.h gtype-desc.h statistics.h
|
||||
GGC_INTERNAL_H=ggc-internal.h ggc.h gtype-desc.h statistics.h
|
||||
TIMEVAR_H=timevar.h timevar.def
|
||||
INSN_ATTR_H=insn-attr.h insn-attr-common.h insn-addr.h
|
||||
INSN_ADDR_H=insn-addr.h
|
||||
C_COMMON_H=c-family/c-common.h c-family/c-common.def coretypes.h tree.h all-tree.def tree.def c-family/c-common.def line-map.h input.h bversion.h diagnostic.def
|
||||
C_PRAGMA_H=c-family/c-pragma.h cpplib.h
|
||||
C_TREE_H=c/c-tree.h c-family/c-common.h c-family/c-common.def coretypes.h tree.h all-tree.def tree.def c-family/c-common.def obstack.h
|
||||
SYSTEM_H=system.h hwint.h filenames.h
|
||||
PREDICT_H=predict.h predict.def
|
||||
CPPLIB_H=cpplib.h
|
||||
INPUT_H=line-map.h input.h
|
||||
OPTS_H=obstack.h
|
||||
DECNUM_H=decimal128Local.h
|
||||
BACKTRACE_H=backtrace.h
|
||||
MKDEPS_H=mkdeps.h
|
||||
SYMTAB_H=obstack.h
|
||||
CPP_ID_DATA_H=cpp-id-data.h
|
||||
CPP_INTERNAL_H=cpp-id-data.h
|
||||
TREE_DUMP_H=tree-dump.h splay-tree.h dumpfile.h
|
||||
TREE_PASS_H=tree-pass.h timevar.h timevar.def dumpfile.h
|
||||
TREE_FLOW_H=tree-flow.h tree-flow-inline.h tree-ssa-operands.h bitmap.h arm-cores.def real.h machmode.h mode-classes.def insn-modes.h fixed-value.h machmode.h mode-classes.def insn-modes.h double-int.h tree-ssa-alias.h
|
||||
TREE_SSA_LIVE_H=tree-ssa-live.h partition.h
|
||||
SSAEXPAND_H=ssaexpand.h tree-ssa-live.h partition.h
|
||||
PRETTY_PRINT_H=pretty-print.h obstack.h
|
||||
TREE_PRETTY_PRINT_H=tree-pretty-print.h pretty-print.h obstack.h
|
||||
GIMPLE_PRETTY_PRINT_H=gimple-pretty-print.h tree-pretty-print.h pretty-print.h obstack.h
|
||||
DIAGNOSTIC_CORE_H=diagnostic-core.h line-map.h input.h bversion.h diagnostic.def
|
||||
DIAGNOSTIC_H=diagnostic.h diagnostic-core.h obstack.h
|
||||
DWARF2OUT_H=dwarf2out.h dwarf2.def
|
||||
C_PRETTY_PRINT_H=c-family/c-pretty-print.h pretty-print.h arm-cores.def real.h machmode.h mode-classes.def insn-modes.h fixed-value.h machmode.h mode-classes.def insn-modes.h double-int.h
|
||||
SCEV_H=tree-scalar-evolution.h ggc.h gtype-desc.h statistics.h tree-chrec.h params.h params.def
|
||||
OMEGA_H=omega.h params.h params.def
|
||||
TREE_DATA_REF_H=tree-data-ref.h omega.h params.h params.def graphds.h tree-scalar-evolution.h ggc.h gtype-desc.h statistics.h tree-chrec.h params.h params.def
|
||||
TREE_INLINE_H=tree-inline.h
|
||||
REAL_H=real.h machmode.h mode-classes.def insn-modes.h
|
||||
IRA_INT_H=ira.h ira-int.h cfgloop.h basic-block.h predict.h predict.def vec.h statistics.h ggc.h gtype-desc.h statistics.h function.h hashtab.h statistics.h sbitmap.h alloc-pool.h
|
||||
LRA_INT_H=lra.h bitmap.h insn-addr.h insn-codes.h lra-int.h
|
||||
DBGCNT_H=dbgcnt.h dbgcnt.def
|
||||
LTO_STREAMER_H=lto-streamer.h obstack.h alloc-pool.h
|
||||
DATA_STREAMER_H=data-streamer.h vec.h statistics.h ggc.h gtype-desc.h statistics.h lto-streamer.h obstack.h alloc-pool.h
|
||||
GIMPLE_STREAMER_H=gimple-streamer.h lto-streamer.h line-map.h input.h machmode.h mode-classes.def insn-modes.h
|
||||
TREE_STREAMER_H=tree-streamer.h coretypes.h tree.h all-tree.def tree.def c-family/c-common.def arm-cores.def real.h machmode.h mode-classes.def insn-modes.h fixed-value.h machmode.h mode-classes.def insn-modes.h double-int.h
|
||||
STREAMER_HOOKS_H=streamer-hooks.h coretypes.h tree.h all-tree.def tree.def c-family/c-common.def arm-cores.def real.h machmode.h mode-classes.def insn-modes.h fixed-value.h machmode.h mode-classes.def insn-modes.h double-int.h
|
||||
TREE_VECTORIZER_H=tree-vectorizer.h tree-data-ref.h omega.h params.h params.def graphds.h tree-scalar-evolution.h ggc.h gtype-desc.h statistics.h tree-chrec.h params.h params.def tm.h options.h config/dbxelf.h arm-cores.def target.h target.def target-hooks-macros.h insn-modes.h
|
||||
IPA_PROP_H=ipa-prop.h coretypes.h tree.h all-tree.def tree.def c-family/c-common.def arm-cores.def real.h machmode.h mode-classes.def insn-modes.h fixed-value.h machmode.h mode-classes.def insn-modes.h double-int.h tree-ssa-operands.h tree-ssa-alias.h internal-fn.h internal-fn.def alloc-pool.h
|
||||
IPA_INLINE_H=ipa-inline.h ipa-prop.h coretypes.h tree.h all-tree.def tree.def c-family/c-common.def arm-cores.def real.h machmode.h mode-classes.def insn-modes.h fixed-value.h machmode.h mode-classes.def insn-modes.h double-int.h tree-ssa-operands.h tree-ssa-alias.h internal-fn.h internal-fn.def alloc-pool.h
|
||||
GSTAB_H=gstab.h stab.def
|
||||
BITMAP_H=bitmap.h hashtab.h statistics.h
|
||||
GCC_PLUGIN_H=gcc-plugin.h highlev-plugin-common.h plugin.def config.h auto-host.h hashtab.h
|
||||
PLUGIN_H=plugin.h gcc-plugin.h highlev-plugin-common.h plugin.def config.h auto-host.h hashtab.h
|
||||
PLUGIN_VERSION_H=plugin-version.h configargs.h
|
||||
LIBFUNCS_H=libfuncs.h hashtab.h
|
||||
GTFILES_H=gt-coverage.h gt-caller-save.h gt-symtab.h gt-alias.h gt-bitmap.h gt-cselib.h gt-cgraph.h gt-ipa-prop.h gt-ipa-cp.h gt-dbxout.h gt-dwarf2asm.h gt-dwarf2cfi.h gt-dwarf2out.h gt-tree-vect-generic.h gt-dojump.h gt-emit-rtl.h gt-explow.h gt-expr.h gt-function.h gt-except.h gt-gcse.h gt-godump.h gt-lists.h gt-optabs.h gt-profile.h gt-mcf.h gt-reg-stack.h gt-cfgrtl.h gt-sdbout.h gt-stor-layout.h gt-stringpool.h gt-tree.h gt-varasm.h gt-gimple.h gt-tree-mudflap.h gt-tree-ssanames.h gt-tree-eh.h gt-tree-ssa-address.h gt-tree-cfg.h gt-tree-dfa.h gt-tree-iterator.h gt-gimplify.h gt-tree-scalar-evolution.h gt-tree-profile.h gt-tree-nested.h gt-tree-parloops.h gt-omp-low.h gt-targhooks.h gt-arm.h gt-passes.h gt-cgraphunit.h gt-cgraphclones.h gt-tree-ssa-propagate.h gt-tree-phinodes.h gt-lto-symtab.h gt-trans-mem.h gt-asan.h gt-tsan.h gt-ada-decl.h gt-ada-trans.h gt-ada-utils.h gt-ada-misc.h gt-c-c-lang.h gt-c-c-decl.h gt-c-family-c-common.h gt-c-family-c-cppbuiltin.h gt-c-family-c-pragma.h gt-c-c-objc-common.h gt-c-c-parser.h gt-cp-rtti.h gt-cp-mangle.h gt-cp-name-lookup.h gt-cp-call.h gt-cp-decl.h gt-cp-decl2.h gt-cp-pt.h gt-cp-repo.h gt-cp-semantics.h gt-cp-tree.h gt-cp-parser.h gt-cp-method.h gt-cp-typeck2.h gt-c-family-c-common.h gt-c-family-c-lex.h gt-c-family-c-pragma.h gt-cp-class.h gt-cp-cp-objcp-common.h gt-cp-cp-lang.h gt-cp-except.h gt-fortran-f95-lang.h gt-fortran-trans-decl.h gt-fortran-trans-intrinsic.h gt-fortran-trans-io.h gt-fortran-trans-stmt.h gt-fortran-trans-types.h gt-go-go-lang.h gt-java-builtins.h gt-java-class.h gt-java-constants.h gt-java-decl.h gt-java-expr.h gt-java-jcf-parse.h gt-java-lang.h gt-java-mangle.h gt-java-resource.h gt-lto-lto-lang.h gt-lto-lto.h gt-objc-objc-act.h gt-objc-objc-runtime-shared-support.h gt-objc-objc-gnu-runtime-abi-01.h gt-objc-objc-next-runtime-abi-01.h gt-objc-objc-next-runtime-abi-02.h gt-c-c-parser.h gt-c-c-decl.h gt-c-c-objc-common.h gt-c-family-c-common.h gt-c-family-c-cppbuiltin.h gt-c-family-c-pragma.h gt-cp-rtti.h gt-cp-mangle.h gt-cp-name-lookup.h gt-cp-call.h gt-cp-decl.h gt-cp-decl2.h gt-cp-pt.h gt-cp-repo.h gt-cp-semantics.h gt-cp-tree.h gt-cp-parser.h gt-cp-method.h gt-cp-typeck2.h gt-c-family-c-common.h gt-c-family-c-lex.h gt-c-family-c-pragma.h gt-cp-class.h gt-cp-cp-objcp-common.h gt-objc-objc-act.h gt-objc-objc-runtime-shared-support.h gt-objc-objc-gnu-runtime-abi-01.h gt-objc-objc-next-runtime-abi-01.h gt-objc-objc-next-runtime-abi-02.h gt-c-family-c-cppbuiltin.h
|
||||
GTFILES_LANG_H=gtype-ada.h gtype-c.h gtype-cp.h gtype-fortran.h gtype-go.h gtype-java.h gtype-lto.h gtype-objc.h gtype-objcp.h
|
||||
|
|
@ -0,0 +1,974 @@
|
|||
/* Define control flow data structures for the CFG.
|
||||
Copyright (C) 1987-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_BASIC_BLOCK_H
|
||||
#define GCC_BASIC_BLOCK_H
|
||||
|
||||
#include "predict.h"
|
||||
#include "vec.h"
|
||||
#include "function.h"
|
||||
|
||||
/* Type we use to hold basic block counters. Should be at least
|
||||
64bit. Although a counter cannot be negative, we use a signed
|
||||
type, because erroneous negative counts can be generated when the
|
||||
flow graph is manipulated by various optimizations. A signed type
|
||||
makes those easy to detect. */
|
||||
typedef HOST_WIDEST_INT gcov_type;
|
||||
typedef unsigned HOST_WIDEST_INT gcov_type_unsigned;
|
||||
|
||||
/* Control flow edge information. */
|
||||
struct GTY((user)) edge_def {
|
||||
/* The two blocks at the ends of the edge. */
|
||||
basic_block src;
|
||||
basic_block dest;
|
||||
|
||||
/* Instructions queued on the edge. */
|
||||
union edge_def_insns {
|
||||
gimple_seq g;
|
||||
rtx r;
|
||||
} insns;
|
||||
|
||||
/* Auxiliary info specific to a pass. */
|
||||
PTR aux;
|
||||
|
||||
/* Location of any goto implicit in the edge. */
|
||||
location_t goto_locus;
|
||||
|
||||
/* The index number corresponding to this edge in the edge vector
|
||||
dest->preds. */
|
||||
unsigned int dest_idx;
|
||||
|
||||
int flags; /* see cfg-flags.def */
|
||||
int probability; /* biased by REG_BR_PROB_BASE */
|
||||
gcov_type count; /* Expected number of executions calculated
|
||||
in profile.c */
|
||||
};
|
||||
|
||||
|
||||
/* Garbage collection and PCH support for edge_def. */
|
||||
extern void gt_ggc_mx (edge_def *e);
|
||||
extern void gt_pch_nx (edge_def *e);
|
||||
extern void gt_pch_nx (edge_def *e, gt_pointer_operator, void *);
|
||||
|
||||
/* Masks for edge.flags. */
|
||||
#define DEF_EDGE_FLAG(NAME,IDX) EDGE_##NAME = 1 << IDX ,
|
||||
enum cfg_edge_flags {
|
||||
#include "cfg-flags.def"
|
||||
LAST_CFG_EDGE_FLAG /* this is only used for EDGE_ALL_FLAGS */
|
||||
};
|
||||
#undef DEF_EDGE_FLAG
|
||||
|
||||
/* Bit mask for all edge flags. */
|
||||
#define EDGE_ALL_FLAGS ((LAST_CFG_EDGE_FLAG - 1) * 2 - 1)
|
||||
|
||||
/* The following four flags all indicate something special about an edge.
|
||||
Test the edge flags on EDGE_COMPLEX to detect all forms of "strange"
|
||||
control flow transfers. */
|
||||
#define EDGE_COMPLEX \
|
||||
(EDGE_ABNORMAL | EDGE_ABNORMAL_CALL | EDGE_EH | EDGE_PRESERVE)
|
||||
|
||||
/* Counter summary from the last set of coverage counts read by
|
||||
profile.c. */
|
||||
extern const struct gcov_ctr_summary *profile_info;
|
||||
|
||||
/* Working set size statistics for a given percentage of the entire
|
||||
profile (sum_all from the counter summary). */
|
||||
typedef struct gcov_working_set_info
|
||||
{
|
||||
/* Number of hot counters included in this working set. */
|
||||
unsigned num_counters;
|
||||
/* Smallest counter included in this working set. */
|
||||
gcov_type min_counter;
|
||||
} gcov_working_set_t;
|
||||
|
||||
/* Structure to gather statistic about profile consistency, per pass.
|
||||
An array of this structure, indexed by pass static number, is allocated
|
||||
in passes.c. The structure is defined here so that different CFG modes
|
||||
can do their book-keeping via CFG hooks.
|
||||
|
||||
For every field[2], field[0] is the count before the pass runs, and
|
||||
field[1] is the post-pass count. This allows us to monitor the effect
|
||||
of each individual pass on the profile consistency.
|
||||
|
||||
This structure is not supposed to be used by anything other than passes.c
|
||||
and one CFG hook per CFG mode. */
|
||||
struct profile_record
|
||||
{
|
||||
/* The number of basic blocks where sum(freq) of the block's predecessors
|
||||
doesn't match reasonably well with the incoming frequency. */
|
||||
int num_mismatched_freq_in[2];
|
||||
/* Likewise for a basic block's successors. */
|
||||
int num_mismatched_freq_out[2];
|
||||
/* The number of basic blocks where sum(count) of the block's predecessors
|
||||
doesn't match reasonably well with the incoming frequency. */
|
||||
int num_mismatched_count_in[2];
|
||||
/* Likewise for a basic block's successors. */
|
||||
int num_mismatched_count_out[2];
|
||||
/* A weighted cost of the run-time of the function body. */
|
||||
gcov_type time[2];
|
||||
/* A weighted cost of the size of the function body. */
|
||||
int size[2];
|
||||
/* True iff this pass actually was run. */
|
||||
bool run;
|
||||
};
|
||||
|
||||
/* Declared in cfgloop.h. */
|
||||
struct loop;
|
||||
|
||||
struct GTY(()) rtl_bb_info {
|
||||
/* The first insn of the block is embedded into bb->il.x. */
|
||||
/* The last insn of the block. */
|
||||
rtx end_;
|
||||
|
||||
/* In CFGlayout mode points to insn notes/jumptables to be placed just before
|
||||
and after the block. */
|
||||
rtx header_;
|
||||
rtx footer_;
|
||||
};
|
||||
|
||||
struct GTY(()) gimple_bb_info {
|
||||
/* Sequence of statements in this block. */
|
||||
gimple_seq seq;
|
||||
|
||||
/* PHI nodes for this block. */
|
||||
gimple_seq phi_nodes;
|
||||
};
|
||||
|
||||
/* A basic block is a sequence of instructions with only one entry and
|
||||
only one exit. If any one of the instructions are executed, they
|
||||
will all be executed, and in sequence from first to last.
|
||||
|
||||
There may be COND_EXEC instructions in the basic block. The
|
||||
COND_EXEC *instructions* will be executed -- but if the condition
|
||||
is false the conditionally executed *expressions* will of course
|
||||
not be executed. We don't consider the conditionally executed
|
||||
expression (which might have side-effects) to be in a separate
|
||||
basic block because the program counter will always be at the same
|
||||
location after the COND_EXEC instruction, regardless of whether the
|
||||
condition is true or not.
|
||||
|
||||
Basic blocks need not start with a label nor end with a jump insn.
|
||||
For example, a previous basic block may just "conditionally fall"
|
||||
into the succeeding basic block, and the last basic block need not
|
||||
end with a jump insn. Block 0 is a descendant of the entry block.
|
||||
|
||||
A basic block beginning with two labels cannot have notes between
|
||||
the labels.
|
||||
|
||||
Data for jump tables are stored in jump_insns that occur in no
|
||||
basic block even though these insns can follow or precede insns in
|
||||
basic blocks. */
|
||||
|
||||
/* Basic block information indexed by block number. */
|
||||
struct GTY((chain_next ("%h.next_bb"), chain_prev ("%h.prev_bb"))) basic_block_def {
|
||||
/* The edges into and out of the block. */
|
||||
vec<edge, va_gc> *preds;
|
||||
vec<edge, va_gc> *succs;
|
||||
|
||||
/* Auxiliary info specific to a pass. */
|
||||
PTR GTY ((skip (""))) aux;
|
||||
|
||||
/* Innermost loop containing the block. */
|
||||
struct loop *loop_father;
|
||||
|
||||
/* The dominance and postdominance information node. */
|
||||
struct et_node * GTY ((skip (""))) dom[2];
|
||||
|
||||
/* Previous and next blocks in the chain. */
|
||||
basic_block prev_bb;
|
||||
basic_block next_bb;
|
||||
|
||||
union basic_block_il_dependent {
|
||||
struct gimple_bb_info GTY ((tag ("0"))) gimple;
|
||||
struct {
|
||||
rtx head_;
|
||||
struct rtl_bb_info * rtl;
|
||||
} GTY ((tag ("1"))) x;
|
||||
} GTY ((desc ("((%1.flags & BB_RTL) != 0)"))) il;
|
||||
|
||||
/* Various flags. See cfg-flags.def. */
|
||||
int flags;
|
||||
|
||||
/* The index of this block. */
|
||||
int index;
|
||||
|
||||
/* Expected number of executions: calculated in profile.c. */
|
||||
gcov_type count;
|
||||
|
||||
/* Expected frequency. Normalized to be in range 0 to BB_FREQ_MAX. */
|
||||
int frequency;
|
||||
|
||||
/* The discriminator for this block. The discriminator distinguishes
|
||||
among several basic blocks that share a common locus, allowing for
|
||||
more accurate sample-based profiling. */
|
||||
int discriminator;
|
||||
};
|
||||
|
||||
/* This ensures that struct gimple_bb_info is smaller than
|
||||
struct rtl_bb_info, so that inlining the former into basic_block_def
|
||||
is the better choice. */
|
||||
typedef int __assert_gimple_bb_smaller_rtl_bb
|
||||
[(int)sizeof(struct rtl_bb_info)
|
||||
- (int)sizeof (struct gimple_bb_info)];
|
||||
|
||||
|
||||
#define BB_FREQ_MAX 10000
|
||||
|
||||
/* Masks for basic_block.flags. */
|
||||
#define DEF_BASIC_BLOCK_FLAG(NAME,IDX) BB_##NAME = 1 << IDX ,
|
||||
enum cfg_bb_flags
|
||||
{
|
||||
#include "cfg-flags.def"
|
||||
LAST_CFG_BB_FLAG /* this is only used for BB_ALL_FLAGS */
|
||||
};
|
||||
#undef DEF_BASIC_BLOCK_FLAG
|
||||
|
||||
/* Bit mask for all basic block flags. */
|
||||
#define BB_ALL_FLAGS ((LAST_CFG_BB_FLAG - 1) * 2 - 1)
|
||||
|
||||
/* Bit mask for all basic block flags that must be preserved. These are
|
||||
the bit masks that are *not* cleared by clear_bb_flags. */
|
||||
#define BB_FLAGS_TO_PRESERVE \
|
||||
(BB_DISABLE_SCHEDULE | BB_RTL | BB_NON_LOCAL_GOTO_TARGET \
|
||||
| BB_HOT_PARTITION | BB_COLD_PARTITION)
|
||||
|
||||
/* Dummy bitmask for convenience in the hot/cold partitioning code. */
|
||||
#define BB_UNPARTITIONED 0
|
||||
|
||||
/* Partitions, to be used when partitioning hot and cold basic blocks into
|
||||
separate sections. */
|
||||
#define BB_PARTITION(bb) ((bb)->flags & (BB_HOT_PARTITION|BB_COLD_PARTITION))
|
||||
#define BB_SET_PARTITION(bb, part) do { \
|
||||
basic_block bb_ = (bb); \
|
||||
bb_->flags = ((bb_->flags & ~(BB_HOT_PARTITION|BB_COLD_PARTITION)) \
|
||||
| (part)); \
|
||||
} while (0)
|
||||
|
||||
#define BB_COPY_PARTITION(dstbb, srcbb) \
|
||||
BB_SET_PARTITION (dstbb, BB_PARTITION (srcbb))
|
||||
|
||||
/* State of dominance information. */
|
||||
|
||||
enum dom_state
|
||||
{
|
||||
DOM_NONE, /* Not computed at all. */
|
||||
DOM_NO_FAST_QUERY, /* The data is OK, but the fast query data are not usable. */
|
||||
DOM_OK /* Everything is ok. */
|
||||
};
|
||||
|
||||
/* What sort of profiling information we have. */
|
||||
enum profile_status_d
|
||||
{
|
||||
PROFILE_ABSENT,
|
||||
PROFILE_GUESSED,
|
||||
PROFILE_READ,
|
||||
PROFILE_LAST /* Last value, used by profile streaming. */
|
||||
};
|
||||
|
||||
/* A structure to group all the per-function control flow graph data.
|
||||
The x_* prefixing is necessary because otherwise references to the
|
||||
fields of this struct are interpreted as the defines for backward
|
||||
source compatibility following the definition of this struct. */
|
||||
struct GTY(()) control_flow_graph {
|
||||
/* Block pointers for the exit and entry of a function.
|
||||
These are always the head and tail of the basic block list. */
|
||||
basic_block x_entry_block_ptr;
|
||||
basic_block x_exit_block_ptr;
|
||||
|
||||
/* Index by basic block number, get basic block struct info. */
|
||||
vec<basic_block, va_gc> *x_basic_block_info;
|
||||
|
||||
/* Number of basic blocks in this flow graph. */
|
||||
int x_n_basic_blocks;
|
||||
|
||||
/* Number of edges in this flow graph. */
|
||||
int x_n_edges;
|
||||
|
||||
/* The first free basic block number. */
|
||||
int x_last_basic_block;
|
||||
|
||||
/* UIDs for LABEL_DECLs. */
|
||||
int last_label_uid;
|
||||
|
||||
/* Mapping of labels to their associated blocks. At present
|
||||
only used for the gimple CFG. */
|
||||
vec<basic_block, va_gc> *x_label_to_block_map;
|
||||
|
||||
enum profile_status_d x_profile_status;
|
||||
|
||||
/* Whether the dominators and the postdominators are available. */
|
||||
enum dom_state x_dom_computed[2];
|
||||
|
||||
/* Number of basic blocks in the dominance tree. */
|
||||
unsigned x_n_bbs_in_dom_tree[2];
|
||||
|
||||
/* Maximal number of entities in the single jumptable. Used to estimate
|
||||
final flowgraph size. */
|
||||
int max_jumptable_ents;
|
||||
};
|
||||
|
||||
/* Defines for accessing the fields of the CFG structure for function FN. */
|
||||
#define ENTRY_BLOCK_PTR_FOR_FUNCTION(FN) ((FN)->cfg->x_entry_block_ptr)
|
||||
#define EXIT_BLOCK_PTR_FOR_FUNCTION(FN) ((FN)->cfg->x_exit_block_ptr)
|
||||
#define basic_block_info_for_function(FN) ((FN)->cfg->x_basic_block_info)
|
||||
#define n_basic_blocks_for_function(FN) ((FN)->cfg->x_n_basic_blocks)
|
||||
#define n_edges_for_function(FN) ((FN)->cfg->x_n_edges)
|
||||
#define last_basic_block_for_function(FN) ((FN)->cfg->x_last_basic_block)
|
||||
#define label_to_block_map_for_function(FN) ((FN)->cfg->x_label_to_block_map)
|
||||
#define profile_status_for_function(FN) ((FN)->cfg->x_profile_status)
|
||||
|
||||
#define BASIC_BLOCK_FOR_FUNCTION(FN,N) \
|
||||
((*basic_block_info_for_function(FN))[(N)])
|
||||
#define SET_BASIC_BLOCK_FOR_FUNCTION(FN,N,BB) \
|
||||
((*basic_block_info_for_function(FN))[(N)] = (BB))
|
||||
|
||||
/* Defines for textual backward source compatibility. */
|
||||
#define ENTRY_BLOCK_PTR (cfun->cfg->x_entry_block_ptr)
|
||||
#define EXIT_BLOCK_PTR (cfun->cfg->x_exit_block_ptr)
|
||||
#define basic_block_info (cfun->cfg->x_basic_block_info)
|
||||
#define n_basic_blocks (cfun->cfg->x_n_basic_blocks)
|
||||
#define n_edges (cfun->cfg->x_n_edges)
|
||||
#define last_basic_block (cfun->cfg->x_last_basic_block)
|
||||
#define label_to_block_map (cfun->cfg->x_label_to_block_map)
|
||||
#define profile_status (cfun->cfg->x_profile_status)
|
||||
|
||||
#define BASIC_BLOCK(N) ((*basic_block_info)[(N)])
|
||||
#define SET_BASIC_BLOCK(N,BB) ((*basic_block_info)[(N)] = (BB))
|
||||
|
||||
/* For iterating over basic blocks. */
|
||||
#define FOR_BB_BETWEEN(BB, FROM, TO, DIR) \
|
||||
for (BB = FROM; BB != TO; BB = BB->DIR)
|
||||
|
||||
#define FOR_EACH_BB_FN(BB, FN) \
|
||||
FOR_BB_BETWEEN (BB, (FN)->cfg->x_entry_block_ptr->next_bb, (FN)->cfg->x_exit_block_ptr, next_bb)
|
||||
|
||||
#define FOR_EACH_BB(BB) FOR_EACH_BB_FN (BB, cfun)
|
||||
|
||||
#define FOR_EACH_BB_REVERSE_FN(BB, FN) \
|
||||
FOR_BB_BETWEEN (BB, (FN)->cfg->x_exit_block_ptr->prev_bb, (FN)->cfg->x_entry_block_ptr, prev_bb)
|
||||
|
||||
#define FOR_EACH_BB_REVERSE(BB) FOR_EACH_BB_REVERSE_FN(BB, cfun)
|
||||
|
||||
/* For iterating over insns in basic block. */
|
||||
#define FOR_BB_INSNS(BB, INSN) \
|
||||
for ((INSN) = BB_HEAD (BB); \
|
||||
(INSN) && (INSN) != NEXT_INSN (BB_END (BB)); \
|
||||
(INSN) = NEXT_INSN (INSN))
|
||||
|
||||
/* For iterating over insns in basic block when we might remove the
|
||||
current insn. */
|
||||
#define FOR_BB_INSNS_SAFE(BB, INSN, CURR) \
|
||||
for ((INSN) = BB_HEAD (BB), (CURR) = (INSN) ? NEXT_INSN ((INSN)): NULL; \
|
||||
(INSN) && (INSN) != NEXT_INSN (BB_END (BB)); \
|
||||
(INSN) = (CURR), (CURR) = (INSN) ? NEXT_INSN ((INSN)) : NULL)
|
||||
|
||||
#define FOR_BB_INSNS_REVERSE(BB, INSN) \
|
||||
for ((INSN) = BB_END (BB); \
|
||||
(INSN) && (INSN) != PREV_INSN (BB_HEAD (BB)); \
|
||||
(INSN) = PREV_INSN (INSN))
|
||||
|
||||
#define FOR_BB_INSNS_REVERSE_SAFE(BB, INSN, CURR) \
|
||||
for ((INSN) = BB_END (BB),(CURR) = (INSN) ? PREV_INSN ((INSN)) : NULL; \
|
||||
(INSN) && (INSN) != PREV_INSN (BB_HEAD (BB)); \
|
||||
(INSN) = (CURR), (CURR) = (INSN) ? PREV_INSN ((INSN)) : NULL)
|
||||
|
||||
/* Cycles through _all_ basic blocks, even the fake ones (entry and
|
||||
exit block). */
|
||||
|
||||
#define FOR_ALL_BB(BB) \
|
||||
for (BB = ENTRY_BLOCK_PTR; BB; BB = BB->next_bb)
|
||||
|
||||
#define FOR_ALL_BB_FN(BB, FN) \
|
||||
for (BB = ENTRY_BLOCK_PTR_FOR_FUNCTION (FN); BB; BB = BB->next_bb)
|
||||
|
||||
|
||||
/* Stuff for recording basic block info. */
|
||||
|
||||
#define BB_HEAD(B) (B)->il.x.head_
|
||||
#define BB_END(B) (B)->il.x.rtl->end_
|
||||
#define BB_HEADER(B) (B)->il.x.rtl->header_
|
||||
#define BB_FOOTER(B) (B)->il.x.rtl->footer_
|
||||
|
||||
/* Special block numbers [markers] for entry and exit.
|
||||
Neither of them is supposed to hold actual statements. */
|
||||
#define ENTRY_BLOCK (0)
|
||||
#define EXIT_BLOCK (1)
|
||||
|
||||
/* The two blocks that are always in the cfg. */
|
||||
#define NUM_FIXED_BLOCKS (2)
|
||||
|
||||
#define set_block_for_insn(INSN, BB) (BLOCK_FOR_INSN (INSN) = BB)
|
||||
|
||||
extern void compute_bb_for_insn (void);
|
||||
extern unsigned int free_bb_for_insn (void);
|
||||
extern void update_bb_for_insn (basic_block);
|
||||
|
||||
extern void insert_insn_on_edge (rtx, edge);
|
||||
basic_block split_edge_and_insert (edge, rtx);
|
||||
|
||||
extern void commit_one_edge_insertion (edge e);
|
||||
extern void commit_edge_insertions (void);
|
||||
|
||||
extern edge unchecked_make_edge (basic_block, basic_block, int);
|
||||
extern edge cached_make_edge (sbitmap, basic_block, basic_block, int);
|
||||
extern edge make_edge (basic_block, basic_block, int);
|
||||
extern edge make_single_succ_edge (basic_block, basic_block, int);
|
||||
extern void remove_edge_raw (edge);
|
||||
extern void redirect_edge_succ (edge, basic_block);
|
||||
extern edge redirect_edge_succ_nodup (edge, basic_block);
|
||||
extern void redirect_edge_pred (edge, basic_block);
|
||||
extern basic_block create_basic_block_structure (rtx, rtx, rtx, basic_block);
|
||||
extern void clear_bb_flags (void);
|
||||
extern void dump_bb_info (FILE *, basic_block, int, int, bool, bool);
|
||||
extern void dump_edge_info (FILE *, edge, int, int);
|
||||
extern void brief_dump_cfg (FILE *, int);
|
||||
extern void clear_edges (void);
|
||||
extern void scale_bbs_frequencies_int (basic_block *, int, int, int);
|
||||
extern void scale_bbs_frequencies_gcov_type (basic_block *, int, gcov_type,
|
||||
gcov_type);
|
||||
|
||||
/* Structure to group all of the information to process IF-THEN and
|
||||
IF-THEN-ELSE blocks for the conditional execution support. This
|
||||
needs to be in a public file in case the IFCVT macros call
|
||||
functions passing the ce_if_block data structure. */
|
||||
|
||||
typedef struct ce_if_block
|
||||
{
|
||||
basic_block test_bb; /* First test block. */
|
||||
basic_block then_bb; /* THEN block. */
|
||||
basic_block else_bb; /* ELSE block or NULL. */
|
||||
basic_block join_bb; /* Join THEN/ELSE blocks. */
|
||||
basic_block last_test_bb; /* Last bb to hold && or || tests. */
|
||||
int num_multiple_test_blocks; /* # of && and || basic blocks. */
|
||||
int num_and_and_blocks; /* # of && blocks. */
|
||||
int num_or_or_blocks; /* # of || blocks. */
|
||||
int num_multiple_test_insns; /* # of insns in && and || blocks. */
|
||||
int and_and_p; /* Complex test is &&. */
|
||||
int num_then_insns; /* # of insns in THEN block. */
|
||||
int num_else_insns; /* # of insns in ELSE block. */
|
||||
int pass; /* Pass number. */
|
||||
} ce_if_block_t;
|
||||
|
||||
/* This structure maintains an edge list vector. */
|
||||
/* FIXME: Make this a vec<edge>. */
|
||||
struct edge_list
|
||||
{
|
||||
int num_edges;
|
||||
edge *index_to_edge;
|
||||
};
|
||||
|
||||
/* The base value for branch probability notes and edge probabilities. */
|
||||
#define REG_BR_PROB_BASE 10000
|
||||
|
||||
/* This is the value which indicates no edge is present. */
|
||||
#define EDGE_INDEX_NO_EDGE -1
|
||||
|
||||
/* EDGE_INDEX returns an integer index for an edge, or EDGE_INDEX_NO_EDGE
|
||||
if there is no edge between the 2 basic blocks. */
|
||||
#define EDGE_INDEX(el, pred, succ) (find_edge_index ((el), (pred), (succ)))
|
||||
|
||||
/* INDEX_EDGE_PRED_BB and INDEX_EDGE_SUCC_BB return a pointer to the basic
|
||||
block which is either the pred or succ end of the indexed edge. */
|
||||
#define INDEX_EDGE_PRED_BB(el, index) ((el)->index_to_edge[(index)]->src)
|
||||
#define INDEX_EDGE_SUCC_BB(el, index) ((el)->index_to_edge[(index)]->dest)
|
||||
|
||||
/* INDEX_EDGE returns a pointer to the edge. */
|
||||
#define INDEX_EDGE(el, index) ((el)->index_to_edge[(index)])
|
||||
|
||||
/* Number of edges in the compressed edge list. */
|
||||
#define NUM_EDGES(el) ((el)->num_edges)
|
||||
|
||||
/* BB is assumed to contain conditional jump. Return the fallthru edge. */
|
||||
#define FALLTHRU_EDGE(bb) (EDGE_SUCC ((bb), 0)->flags & EDGE_FALLTHRU \
|
||||
? EDGE_SUCC ((bb), 0) : EDGE_SUCC ((bb), 1))
|
||||
|
||||
/* BB is assumed to contain conditional jump. Return the branch edge. */
|
||||
#define BRANCH_EDGE(bb) (EDGE_SUCC ((bb), 0)->flags & EDGE_FALLTHRU \
|
||||
? EDGE_SUCC ((bb), 1) : EDGE_SUCC ((bb), 0))
|
||||
|
||||
#define RDIV(X,Y) (((X) + (Y) / 2) / (Y))
|
||||
/* Return expected execution frequency of the edge E. */
|
||||
#define EDGE_FREQUENCY(e) RDIV ((e)->src->frequency * (e)->probability, \
|
||||
REG_BR_PROB_BASE)
|
||||
|
||||
/* Return nonzero if edge is critical. */
|
||||
#define EDGE_CRITICAL_P(e) (EDGE_COUNT ((e)->src->succs) >= 2 \
|
||||
&& EDGE_COUNT ((e)->dest->preds) >= 2)
|
||||
|
||||
#define EDGE_COUNT(ev) vec_safe_length (ev)
|
||||
#define EDGE_I(ev,i) (*ev)[(i)]
|
||||
#define EDGE_PRED(bb,i) (*(bb)->preds)[(i)]
|
||||
#define EDGE_SUCC(bb,i) (*(bb)->succs)[(i)]
|
||||
|
||||
/* Returns true if BB has precisely one successor. */
|
||||
|
||||
static inline bool
|
||||
single_succ_p (const_basic_block bb)
|
||||
{
|
||||
return EDGE_COUNT (bb->succs) == 1;
|
||||
}
|
||||
|
||||
/* Returns true if BB has precisely one predecessor. */
|
||||
|
||||
static inline bool
|
||||
single_pred_p (const_basic_block bb)
|
||||
{
|
||||
return EDGE_COUNT (bb->preds) == 1;
|
||||
}
|
||||
|
||||
/* Returns the single successor edge of basic block BB. Aborts if
|
||||
BB does not have exactly one successor. */
|
||||
|
||||
static inline edge
|
||||
single_succ_edge (const_basic_block bb)
|
||||
{
|
||||
gcc_checking_assert (single_succ_p (bb));
|
||||
return EDGE_SUCC (bb, 0);
|
||||
}
|
||||
|
||||
/* Returns the single predecessor edge of basic block BB. Aborts
|
||||
if BB does not have exactly one predecessor. */
|
||||
|
||||
static inline edge
|
||||
single_pred_edge (const_basic_block bb)
|
||||
{
|
||||
gcc_checking_assert (single_pred_p (bb));
|
||||
return EDGE_PRED (bb, 0);
|
||||
}
|
||||
|
||||
/* Returns the single successor block of basic block BB. Aborts
|
||||
if BB does not have exactly one successor. */
|
||||
|
||||
static inline basic_block
|
||||
single_succ (const_basic_block bb)
|
||||
{
|
||||
return single_succ_edge (bb)->dest;
|
||||
}
|
||||
|
||||
/* Returns the single predecessor block of basic block BB. Aborts
|
||||
if BB does not have exactly one predecessor.*/
|
||||
|
||||
static inline basic_block
|
||||
single_pred (const_basic_block bb)
|
||||
{
|
||||
return single_pred_edge (bb)->src;
|
||||
}
|
||||
|
||||
/* Iterator object for edges. */
|
||||
|
||||
typedef struct {
|
||||
unsigned index;
|
||||
vec<edge, va_gc> **container;
|
||||
} edge_iterator;
|
||||
|
||||
static inline vec<edge, va_gc> *
|
||||
ei_container (edge_iterator i)
|
||||
{
|
||||
gcc_checking_assert (i.container);
|
||||
return *i.container;
|
||||
}
|
||||
|
||||
#define ei_start(iter) ei_start_1 (&(iter))
|
||||
#define ei_last(iter) ei_last_1 (&(iter))
|
||||
|
||||
/* Return an iterator pointing to the start of an edge vector. */
|
||||
static inline edge_iterator
|
||||
ei_start_1 (vec<edge, va_gc> **ev)
|
||||
{
|
||||
edge_iterator i;
|
||||
|
||||
i.index = 0;
|
||||
i.container = ev;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
/* Return an iterator pointing to the last element of an edge
|
||||
vector. */
|
||||
static inline edge_iterator
|
||||
ei_last_1 (vec<edge, va_gc> **ev)
|
||||
{
|
||||
edge_iterator i;
|
||||
|
||||
i.index = EDGE_COUNT (*ev) - 1;
|
||||
i.container = ev;
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
/* Is the iterator `i' at the end of the sequence? */
|
||||
static inline bool
|
||||
ei_end_p (edge_iterator i)
|
||||
{
|
||||
return (i.index == EDGE_COUNT (ei_container (i)));
|
||||
}
|
||||
|
||||
/* Is the iterator `i' at one position before the end of the
|
||||
sequence? */
|
||||
static inline bool
|
||||
ei_one_before_end_p (edge_iterator i)
|
||||
{
|
||||
return (i.index + 1 == EDGE_COUNT (ei_container (i)));
|
||||
}
|
||||
|
||||
/* Advance the iterator to the next element. */
|
||||
static inline void
|
||||
ei_next (edge_iterator *i)
|
||||
{
|
||||
gcc_checking_assert (i->index < EDGE_COUNT (ei_container (*i)));
|
||||
i->index++;
|
||||
}
|
||||
|
||||
/* Move the iterator to the previous element. */
|
||||
static inline void
|
||||
ei_prev (edge_iterator *i)
|
||||
{
|
||||
gcc_checking_assert (i->index > 0);
|
||||
i->index--;
|
||||
}
|
||||
|
||||
/* Return the edge pointed to by the iterator `i'. */
|
||||
static inline edge
|
||||
ei_edge (edge_iterator i)
|
||||
{
|
||||
return EDGE_I (ei_container (i), i.index);
|
||||
}
|
||||
|
||||
/* Return an edge pointed to by the iterator. Do it safely so that
|
||||
NULL is returned when the iterator is pointing at the end of the
|
||||
sequence. */
|
||||
static inline edge
|
||||
ei_safe_edge (edge_iterator i)
|
||||
{
|
||||
return !ei_end_p (i) ? ei_edge (i) : NULL;
|
||||
}
|
||||
|
||||
/* Return 1 if we should continue to iterate. Return 0 otherwise.
|
||||
*Edge P is set to the next edge if we are to continue to iterate
|
||||
and NULL otherwise. */
|
||||
|
||||
static inline bool
|
||||
ei_cond (edge_iterator ei, edge *p)
|
||||
{
|
||||
if (!ei_end_p (ei))
|
||||
{
|
||||
*p = ei_edge (ei);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
*p = NULL;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* This macro serves as a convenient way to iterate each edge in a
|
||||
vector of predecessor or successor edges. It must not be used when
|
||||
an element might be removed during the traversal, otherwise
|
||||
elements will be missed. Instead, use a for-loop like that shown
|
||||
in the following pseudo-code:
|
||||
|
||||
FOR (ei = ei_start (bb->succs); (e = ei_safe_edge (ei)); )
|
||||
{
|
||||
IF (e != taken_edge)
|
||||
remove_edge (e);
|
||||
ELSE
|
||||
ei_next (&ei);
|
||||
}
|
||||
*/
|
||||
|
||||
#define FOR_EACH_EDGE(EDGE,ITER,EDGE_VEC) \
|
||||
for ((ITER) = ei_start ((EDGE_VEC)); \
|
||||
ei_cond ((ITER), &(EDGE)); \
|
||||
ei_next (&(ITER)))
|
||||
|
||||
#define CLEANUP_EXPENSIVE 1 /* Do relatively expensive optimizations
|
||||
except for edge forwarding */
|
||||
#define CLEANUP_CROSSJUMP 2 /* Do crossjumping. */
|
||||
#define CLEANUP_POST_REGSTACK 4 /* We run after reg-stack and need
|
||||
to care REG_DEAD notes. */
|
||||
#define CLEANUP_THREADING 8 /* Do jump threading. */
|
||||
#define CLEANUP_NO_INSN_DEL 16 /* Do not try to delete trivially dead
|
||||
insns. */
|
||||
#define CLEANUP_CFGLAYOUT 32 /* Do cleanup in cfglayout mode. */
|
||||
#define CLEANUP_CFG_CHANGED 64 /* The caller changed the CFG. */
|
||||
|
||||
/* In cfganal.c */
|
||||
extern void bitmap_intersection_of_succs (sbitmap, sbitmap *, basic_block);
|
||||
extern void bitmap_intersection_of_preds (sbitmap, sbitmap *, basic_block);
|
||||
extern void bitmap_union_of_succs (sbitmap, sbitmap *, basic_block);
|
||||
extern void bitmap_union_of_preds (sbitmap, sbitmap *, basic_block);
|
||||
|
||||
/* In lcm.c */
|
||||
extern struct edge_list *pre_edge_lcm (int, sbitmap *, sbitmap *,
|
||||
sbitmap *, sbitmap *, sbitmap **,
|
||||
sbitmap **);
|
||||
extern struct edge_list *pre_edge_rev_lcm (int, sbitmap *,
|
||||
sbitmap *, sbitmap *,
|
||||
sbitmap *, sbitmap **,
|
||||
sbitmap **);
|
||||
extern void compute_available (sbitmap *, sbitmap *, sbitmap *, sbitmap *);
|
||||
|
||||
/* In predict.c */
|
||||
extern bool maybe_hot_bb_p (struct function *, const_basic_block);
|
||||
extern bool maybe_hot_edge_p (edge);
|
||||
extern bool probably_never_executed_bb_p (struct function *, const_basic_block);
|
||||
extern bool optimize_bb_for_size_p (const_basic_block);
|
||||
extern bool optimize_bb_for_speed_p (const_basic_block);
|
||||
extern bool optimize_edge_for_size_p (edge);
|
||||
extern bool optimize_edge_for_speed_p (edge);
|
||||
extern bool optimize_loop_for_size_p (struct loop *);
|
||||
extern bool optimize_loop_for_speed_p (struct loop *);
|
||||
extern bool optimize_loop_nest_for_size_p (struct loop *);
|
||||
extern bool optimize_loop_nest_for_speed_p (struct loop *);
|
||||
extern bool gimple_predicted_by_p (const_basic_block, enum br_predictor);
|
||||
extern bool rtl_predicted_by_p (const_basic_block, enum br_predictor);
|
||||
extern void gimple_predict_edge (edge, enum br_predictor, int);
|
||||
extern void rtl_predict_edge (edge, enum br_predictor, int);
|
||||
extern void predict_edge_def (edge, enum br_predictor, enum prediction);
|
||||
extern void guess_outgoing_edge_probabilities (basic_block);
|
||||
extern void remove_predictions_associated_with_edge (edge);
|
||||
extern bool edge_probability_reliable_p (const_edge);
|
||||
extern bool br_prob_note_reliable_p (const_rtx);
|
||||
extern bool predictable_edge_p (edge);
|
||||
|
||||
/* In cfg.c */
|
||||
extern void init_flow (struct function *);
|
||||
extern void debug_bb (basic_block);
|
||||
extern basic_block debug_bb_n (int);
|
||||
extern void dump_flow_info (FILE *, int);
|
||||
extern void expunge_block (basic_block);
|
||||
extern void link_block (basic_block, basic_block);
|
||||
extern void unlink_block (basic_block);
|
||||
extern void compact_blocks (void);
|
||||
extern basic_block alloc_block (void);
|
||||
extern void alloc_aux_for_blocks (int);
|
||||
extern void clear_aux_for_blocks (void);
|
||||
extern void free_aux_for_blocks (void);
|
||||
extern void alloc_aux_for_edge (edge, int);
|
||||
extern void alloc_aux_for_edges (int);
|
||||
extern void clear_aux_for_edges (void);
|
||||
extern void free_aux_for_edges (void);
|
||||
|
||||
/* In cfganal.c */
|
||||
extern void find_unreachable_blocks (void);
|
||||
extern bool mark_dfs_back_edges (void);
|
||||
struct edge_list * create_edge_list (void);
|
||||
void free_edge_list (struct edge_list *);
|
||||
void print_edge_list (FILE *, struct edge_list *);
|
||||
void verify_edge_list (FILE *, struct edge_list *);
|
||||
int find_edge_index (struct edge_list *, basic_block, basic_block);
|
||||
edge find_edge (basic_block, basic_block);
|
||||
extern void remove_fake_edges (void);
|
||||
extern void remove_fake_exit_edges (void);
|
||||
extern void add_noreturn_fake_exit_edges (void);
|
||||
extern void connect_infinite_loops_to_exit (void);
|
||||
extern int post_order_compute (int *, bool, bool);
|
||||
extern basic_block dfs_find_deadend (basic_block);
|
||||
extern int inverted_post_order_compute (int *);
|
||||
extern int pre_and_rev_post_order_compute (int *, int *, bool);
|
||||
extern int dfs_enumerate_from (basic_block, int,
|
||||
bool (*)(const_basic_block, const void *),
|
||||
basic_block *, int, const void *);
|
||||
extern void compute_dominance_frontiers (struct bitmap_head_def *);
|
||||
extern bitmap compute_idf (bitmap, struct bitmap_head_def *);
|
||||
|
||||
/* In cfgrtl.c */
|
||||
extern rtx block_label (basic_block);
|
||||
extern rtx bb_note (basic_block);
|
||||
extern bool purge_all_dead_edges (void);
|
||||
extern bool purge_dead_edges (basic_block);
|
||||
extern bool fixup_abnormal_edges (void);
|
||||
extern basic_block force_nonfallthru_and_redirect (edge, basic_block, rtx);
|
||||
extern bool contains_no_active_insn_p (const_basic_block);
|
||||
extern bool forwarder_block_p (const_basic_block);
|
||||
extern bool can_fallthru (basic_block, basic_block);
|
||||
|
||||
/* In cfgbuild.c. */
|
||||
extern void find_many_sub_basic_blocks (sbitmap);
|
||||
extern void rtl_make_eh_edge (sbitmap, basic_block, rtx);
|
||||
|
||||
enum replace_direction { dir_none, dir_forward, dir_backward, dir_both };
|
||||
|
||||
/* In cfgcleanup.c. */
|
||||
extern bool cleanup_cfg (int);
|
||||
extern int flow_find_cross_jump (basic_block, basic_block, rtx *, rtx *,
|
||||
enum replace_direction*);
|
||||
extern int flow_find_head_matching_sequence (basic_block, basic_block,
|
||||
rtx *, rtx *, int);
|
||||
|
||||
extern bool delete_unreachable_blocks (void);
|
||||
|
||||
extern void update_br_prob_note (basic_block);
|
||||
extern bool inside_basic_block_p (const_rtx);
|
||||
extern bool control_flow_insn_p (const_rtx);
|
||||
extern rtx get_last_bb_insn (basic_block);
|
||||
|
||||
/* In dominance.c */
|
||||
|
||||
enum cdi_direction
|
||||
{
|
||||
CDI_DOMINATORS = 1,
|
||||
CDI_POST_DOMINATORS = 2
|
||||
};
|
||||
|
||||
extern enum dom_state dom_info_state (enum cdi_direction);
|
||||
extern void set_dom_info_availability (enum cdi_direction, enum dom_state);
|
||||
extern bool dom_info_available_p (enum cdi_direction);
|
||||
extern void calculate_dominance_info (enum cdi_direction);
|
||||
extern void free_dominance_info (enum cdi_direction);
|
||||
extern basic_block nearest_common_dominator (enum cdi_direction,
|
||||
basic_block, basic_block);
|
||||
extern basic_block nearest_common_dominator_for_set (enum cdi_direction,
|
||||
bitmap);
|
||||
extern void set_immediate_dominator (enum cdi_direction, basic_block,
|
||||
basic_block);
|
||||
extern basic_block get_immediate_dominator (enum cdi_direction, basic_block);
|
||||
extern bool dominated_by_p (enum cdi_direction, const_basic_block, const_basic_block);
|
||||
extern vec<basic_block> get_dominated_by (enum cdi_direction, basic_block);
|
||||
extern vec<basic_block> get_dominated_by_region (enum cdi_direction,
|
||||
basic_block *,
|
||||
unsigned);
|
||||
extern vec<basic_block> get_dominated_to_depth (enum cdi_direction,
|
||||
basic_block, int);
|
||||
extern vec<basic_block> get_all_dominated_blocks (enum cdi_direction,
|
||||
basic_block);
|
||||
extern void add_to_dominance_info (enum cdi_direction, basic_block);
|
||||
extern void delete_from_dominance_info (enum cdi_direction, basic_block);
|
||||
basic_block recompute_dominator (enum cdi_direction, basic_block);
|
||||
extern void redirect_immediate_dominators (enum cdi_direction, basic_block,
|
||||
basic_block);
|
||||
extern void iterate_fix_dominators (enum cdi_direction,
|
||||
vec<basic_block> , bool);
|
||||
extern void verify_dominators (enum cdi_direction);
|
||||
extern basic_block first_dom_son (enum cdi_direction, basic_block);
|
||||
extern basic_block next_dom_son (enum cdi_direction, basic_block);
|
||||
unsigned bb_dom_dfs_in (enum cdi_direction, basic_block);
|
||||
unsigned bb_dom_dfs_out (enum cdi_direction, basic_block);
|
||||
|
||||
extern edge try_redirect_by_replacing_jump (edge, basic_block, bool);
|
||||
extern void break_superblocks (void);
|
||||
extern void relink_block_chain (bool);
|
||||
extern void update_bb_profile_for_threading (basic_block, int, gcov_type, edge);
|
||||
extern void init_rtl_bb_info (basic_block);
|
||||
|
||||
extern void initialize_original_copy_tables (void);
|
||||
extern void free_original_copy_tables (void);
|
||||
extern void set_bb_original (basic_block, basic_block);
|
||||
extern basic_block get_bb_original (basic_block);
|
||||
extern void set_bb_copy (basic_block, basic_block);
|
||||
extern basic_block get_bb_copy (basic_block);
|
||||
void set_loop_copy (struct loop *, struct loop *);
|
||||
struct loop *get_loop_copy (struct loop *);
|
||||
|
||||
#include "cfghooks.h"
|
||||
|
||||
/* Return true when one of the predecessor edges of BB is marked with EDGE_EH. */
|
||||
static inline bool
|
||||
bb_has_eh_pred (basic_block bb)
|
||||
{
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
|
||||
FOR_EACH_EDGE (e, ei, bb->preds)
|
||||
{
|
||||
if (e->flags & EDGE_EH)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Return true when one of the predecessor edges of BB is marked with EDGE_ABNORMAL. */
|
||||
static inline bool
|
||||
bb_has_abnormal_pred (basic_block bb)
|
||||
{
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
|
||||
FOR_EACH_EDGE (e, ei, bb->preds)
|
||||
{
|
||||
if (e->flags & EDGE_ABNORMAL)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Return the fallthru edge in EDGES if it exists, NULL otherwise. */
|
||||
static inline edge
|
||||
find_fallthru_edge (vec<edge, va_gc> *edges)
|
||||
{
|
||||
edge e;
|
||||
edge_iterator ei;
|
||||
|
||||
FOR_EACH_EDGE (e, ei, edges)
|
||||
if (e->flags & EDGE_FALLTHRU)
|
||||
break;
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
/* In cfgloopmanip.c. */
|
||||
extern edge mfb_kj_edge;
|
||||
extern bool mfb_keep_just (edge);
|
||||
|
||||
/* In cfgexpand.c. */
|
||||
extern void rtl_profile_for_bb (basic_block);
|
||||
extern void rtl_profile_for_edge (edge);
|
||||
extern void default_rtl_profile (void);
|
||||
|
||||
/* In profile.c. */
|
||||
extern gcov_working_set_t *find_working_set(unsigned pct_times_10);
|
||||
|
||||
/* Check tha probability is sane. */
|
||||
|
||||
static inline void
|
||||
check_probability (int prob)
|
||||
{
|
||||
gcc_checking_assert (prob >= 0 && prob <= REG_BR_PROB_BASE);
|
||||
}
|
||||
|
||||
/* Given PROB1 and PROB2, return PROB1*PROB2/REG_BR_PROB_BASE.
|
||||
Used to combine BB probabilities. */
|
||||
|
||||
static inline int
|
||||
combine_probabilities (int prob1, int prob2)
|
||||
{
|
||||
check_probability (prob1);
|
||||
check_probability (prob2);
|
||||
return RDIV (prob1 * prob2, REG_BR_PROB_BASE);
|
||||
}
|
||||
|
||||
/* Apply probability PROB on frequency or count FREQ. */
|
||||
|
||||
static inline gcov_type
|
||||
apply_probability (gcov_type freq, int prob)
|
||||
{
|
||||
check_probability (prob);
|
||||
return RDIV (freq * prob, REG_BR_PROB_BASE);
|
||||
}
|
||||
|
||||
/* Return inverse probability for PROB. */
|
||||
|
||||
static inline int
|
||||
inverse_probability (int prob1)
|
||||
{
|
||||
check_probability (prob1);
|
||||
return REG_BR_PROB_BASE - prob1;
|
||||
}
|
||||
#endif /* GCC_BASIC_BLOCK_H */
|
||||
|
|
@ -0,0 +1,713 @@
|
|||
/* Functions to support general ended bitmaps.
|
||||
Copyright (C) 1997-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_BITMAP_H
|
||||
#define GCC_BITMAP_H
|
||||
|
||||
/* Implementation of sparse integer sets as a linked list.
|
||||
|
||||
This sparse set representation is suitable for sparse sets with an
|
||||
unknown (a priori) universe. The set is represented as a double-linked
|
||||
list of container nodes (struct bitmap_element_def). Each node consists
|
||||
of an index for the first member that could be held in the container,
|
||||
a small array of integers that represent the members in the container,
|
||||
and pointers to the next and previous element in the linked list. The
|
||||
elements in the list are sorted in ascending order, i.e. the head of
|
||||
the list holds the element with the smallest member of the set.
|
||||
|
||||
For a given member I in the set:
|
||||
- the element for I will have index is I / (bits per element)
|
||||
- the position for I within element is I % (bits per element)
|
||||
|
||||
This representation is very space-efficient for large sparse sets, and
|
||||
the size of the set can be changed dynamically without much overhead.
|
||||
An important parameter is the number of bits per element. In this
|
||||
implementation, there are 128 bits per element. This results in a
|
||||
high storage overhead *per element*, but a small overall overhead if
|
||||
the set is very sparse.
|
||||
|
||||
The downside is that many operations are relatively slow because the
|
||||
linked list has to be traversed to test membership (i.e. member_p/
|
||||
add_member/remove_member). To improve the performance of this set
|
||||
representation, the last accessed element and its index are cached.
|
||||
For membership tests on members close to recently accessed members,
|
||||
the cached last element improves membership test to a constant-time
|
||||
operation.
|
||||
|
||||
The following operations can always be performed in O(1) time:
|
||||
|
||||
* clear : bitmap_clear
|
||||
* choose_one : (not implemented, but could be
|
||||
implemented in constant time)
|
||||
|
||||
The following operations can be performed in O(E) time worst-case (with
|
||||
E the number of elements in the linked list), but in O(1) time with a
|
||||
suitable access patterns:
|
||||
|
||||
* member_p : bitmap_bit_p
|
||||
* add_member : bitmap_set_bit
|
||||
* remove_member : bitmap_clear_bit
|
||||
|
||||
The following operations can be performed in O(E) time:
|
||||
|
||||
* cardinality : bitmap_count_bits
|
||||
* set_size : bitmap_last_set_bit (but this could
|
||||
in constant time with a pointer to
|
||||
the last element in the chain)
|
||||
|
||||
Additionally, the linked-list sparse set representation supports
|
||||
enumeration of the members in O(E) time:
|
||||
|
||||
* forall : EXECUTE_IF_SET_IN_BITMAP
|
||||
* set_copy : bitmap_copy
|
||||
* set_intersection : bitmap_intersect_p /
|
||||
bitmap_and / bitmap_and_into /
|
||||
EXECUTE_IF_AND_IN_BITMAP
|
||||
* set_union : bitmap_ior / bitmap_ior_into
|
||||
* set_difference : bitmap_intersect_compl_p /
|
||||
bitmap_and_comp / bitmap_and_comp_into /
|
||||
EXECUTE_IF_AND_COMPL_IN_BITMAP
|
||||
* set_disjuction : bitmap_xor_comp / bitmap_xor_comp_into
|
||||
* set_compare : bitmap_equal_p
|
||||
|
||||
Some operations on 3 sets that occur frequently in in data flow problems
|
||||
are also implemented:
|
||||
|
||||
* A | (B & C) : bitmap_ior_and_into
|
||||
* A | (B & ~C) : bitmap_ior_and_compl /
|
||||
bitmap_ior_and_compl_into
|
||||
|
||||
The storage requirements for linked-list sparse sets are O(E), with E->N
|
||||
in the worst case (a sparse set with large distances between the values
|
||||
of the set members).
|
||||
|
||||
The linked-list set representation works well for problems involving very
|
||||
sparse sets. The canonical example in GCC is, of course, the "set of
|
||||
sets" for some CFG-based data flow problems (liveness analysis, dominance
|
||||
frontiers, etc.).
|
||||
|
||||
This representation also works well for data flow problems where the size
|
||||
of the set may grow dynamically, but care must be taken that the member_p,
|
||||
add_member, and remove_member operations occur with a suitable access
|
||||
pattern.
|
||||
|
||||
For random-access sets with a known, relatively small universe size, the
|
||||
SparseSet or simple bitmap representations may be more efficient than a
|
||||
linked-list set. For random-access sets of unknown universe, a hash table
|
||||
or a balanced binary tree representation is likely to be a more suitable
|
||||
choice.
|
||||
|
||||
Traversing linked lists is usually cache-unfriendly, even with the last
|
||||
accessed element cached.
|
||||
|
||||
Cache performance can be improved by keeping the elements in the set
|
||||
grouped together in memory, using a dedicated obstack for a set (or group
|
||||
of related sets). Elements allocated on obstacks are released to a
|
||||
free-list and taken off the free list. If multiple sets are allocated on
|
||||
the same obstack, elements freed from one set may be re-used for one of
|
||||
the other sets. This usually helps avoid cache misses.
|
||||
|
||||
A single free-list is used for all sets allocated in GGC space. This is
|
||||
bad for persistent sets, so persistent sets should be allocated on an
|
||||
obstack whenever possible. */
|
||||
|
||||
#include "hashtab.h"
|
||||
#include "statistics.h"
|
||||
#include "obstack.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 GTY (()) bitmap_obstack {
|
||||
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 GTY((chain_next ("%h.next"), chain_prev ("%h.prev"))) bitmap_element_def {
|
||||
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. The 'current' member points to something
|
||||
already pointed to by the chain started by first, so GTY((skip)) it. */
|
||||
|
||||
typedef struct GTY(()) bitmap_head_def {
|
||||
unsigned int indx; /* Index of last element looked at. */
|
||||
unsigned int descriptor_id; /* Unique identifier for the allocation
|
||||
site of this bitmap, for detailed
|
||||
statistics gathering. */
|
||||
bitmap_element *first; /* First element in linked list. */
|
||||
bitmap_element * GTY((skip(""))) current; /* Last element looked at. */
|
||||
bitmap_obstack *obstack; /* Obstack to allocate elements from.
|
||||
If NULL, then use GGC allocation. */
|
||||
} 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, const_bitmap);
|
||||
|
||||
/* True if two bitmaps are identical. */
|
||||
extern bool bitmap_equal_p (const_bitmap, const_bitmap);
|
||||
|
||||
/* True if the bitmaps intersect (their AND is non-empty). */
|
||||
extern bool bitmap_intersect_p (const_bitmap, const_bitmap);
|
||||
|
||||
/* True if the complement of the second intersects the first (their
|
||||
AND_COMPL is non-empty). */
|
||||
extern bool bitmap_intersect_compl_p (const_bitmap, const_bitmap);
|
||||
|
||||
/* True if MAP is an empty bitmap. */
|
||||
inline bool bitmap_empty_p (const_bitmap map)
|
||||
{
|
||||
return !map->first;
|
||||
}
|
||||
|
||||
/* True if the bitmap has only a single bit set. */
|
||||
extern bool bitmap_single_bit_set_p (const_bitmap);
|
||||
|
||||
/* Count the number of bits set in the bitmap. */
|
||||
extern unsigned long bitmap_count_bits (const_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, const_bitmap, const_bitmap);
|
||||
extern bool bitmap_and_into (bitmap, const_bitmap);
|
||||
extern bool bitmap_and_compl (bitmap, const_bitmap, const_bitmap);
|
||||
extern bool bitmap_and_compl_into (bitmap, const_bitmap);
|
||||
#define bitmap_compl_and(DST, A, B) bitmap_and_compl (DST, B, A)
|
||||
extern void bitmap_compl_and_into (bitmap, const_bitmap);
|
||||
extern void bitmap_clear_range (bitmap, unsigned int, unsigned int);
|
||||
extern void bitmap_set_range (bitmap, unsigned int, unsigned int);
|
||||
extern bool bitmap_ior (bitmap, const_bitmap, const_bitmap);
|
||||
extern bool bitmap_ior_into (bitmap, const_bitmap);
|
||||
extern void bitmap_xor (bitmap, const_bitmap, const_bitmap);
|
||||
extern void bitmap_xor_into (bitmap, const_bitmap);
|
||||
|
||||
/* DST = A | (B & C). Return true if DST changes. */
|
||||
extern bool bitmap_ior_and_into (bitmap DST, const_bitmap B, const_bitmap C);
|
||||
/* DST = A | (B & ~C). Return true if DST changes. */
|
||||
extern bool bitmap_ior_and_compl (bitmap DST, const_bitmap A,
|
||||
const_bitmap B, const_bitmap C);
|
||||
/* A |= (B & ~C). Return true if A changes. */
|
||||
extern bool bitmap_ior_and_compl_into (bitmap A,
|
||||
const_bitmap B, const_bitmap C);
|
||||
|
||||
/* Clear a single bit in a bitmap. Return true if the bit changed. */
|
||||
extern bool bitmap_clear_bit (bitmap, int);
|
||||
|
||||
/* Set a single bit in a bitmap. Return true if the bit changed. */
|
||||
extern bool 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 (const_bitmap);
|
||||
extern void debug_bitmap_file (FILE *, const_bitmap);
|
||||
|
||||
/* Print a bitmap. */
|
||||
extern void bitmap_print (FILE *, const_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 *);
|
||||
extern void bitmap_register (bitmap MEM_STAT_DECL);
|
||||
extern void dump_bitmap_statistics (void);
|
||||
|
||||
/* Initialize a bitmap header. OBSTACK indicates the bitmap obstack
|
||||
to allocate from, NULL for GC'd bitmap. */
|
||||
|
||||
static inline void
|
||||
bitmap_initialize_stat (bitmap head, bitmap_obstack *obstack MEM_STAT_DECL)
|
||||
{
|
||||
head->first = head->current = NULL;
|
||||
head->obstack = obstack;
|
||||
if (GATHER_STATISTICS)
|
||||
bitmap_register (head PASS_MEM_STAT);
|
||||
}
|
||||
#define bitmap_initialize(h,o) bitmap_initialize_stat (h,o MEM_STAT_INFO)
|
||||
|
||||
/* Allocate and free bitmaps from obstack, malloc and gc'd memory. */
|
||||
extern bitmap bitmap_obstack_alloc_stat (bitmap_obstack *obstack MEM_STAT_DECL);
|
||||
#define bitmap_obstack_alloc(t) bitmap_obstack_alloc_stat (t MEM_STAT_INFO)
|
||||
extern bitmap bitmap_gc_alloc_stat (ALONE_MEM_STAT_DECL);
|
||||
#define bitmap_gc_alloc() bitmap_gc_alloc_stat (ALONE_MEM_STAT_INFO)
|
||||
extern void bitmap_obstack_free (bitmap);
|
||||
|
||||
/* A few compatibility/functions macros for compatibility with sbitmaps */
|
||||
inline void dump_bitmap (FILE *file, const_bitmap map)
|
||||
{
|
||||
bitmap_print (file, map, "", "\n");
|
||||
}
|
||||
|
||||
extern unsigned bitmap_first_set_bit (const_bitmap);
|
||||
extern unsigned bitmap_last_set_bit (const_bitmap);
|
||||
|
||||
/* Compute bitmap hash (for purposes of hashing etc.) */
|
||||
extern hashval_t bitmap_hash(const_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), (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, const_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, const_bitmap map1, const_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,
|
||||
const_bitmap map1, const_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 first set bit in BI. */
|
||||
|
||||
static inline void
|
||||
bmp_iter_next_bit (bitmap_iterator * bi, unsigned *bit_no)
|
||||
{
|
||||
#if (GCC_VERSION >= 3004)
|
||||
{
|
||||
unsigned int n = __builtin_ctzl (bi->bits);
|
||||
gcc_assert (sizeof (unsigned long) == sizeof (BITMAP_WORD));
|
||||
bi->bits >>= n;
|
||||
*bit_no += n;
|
||||
}
|
||||
#else
|
||||
while (!(bi->bits & 1))
|
||||
{
|
||||
bi->bits >>= 1;
|
||||
*bit_no += 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* 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:
|
||||
bmp_iter_next_bit (bi, bit_no);
|
||||
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:
|
||||
bmp_iter_next_bit (bi, bit_no);
|
||||
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:
|
||||
bmp_iter_next_bit (bi, bit_no);
|
||||
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. */
|
||||
|
||||
#ifndef EXECUTE_IF_SET_IN_BITMAP
|
||||
/* See sbitmap.h for the other definition of EXECUTE_IF_SET_IN_BITMAP. */
|
||||
#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)))
|
||||
#endif
|
||||
|
||||
/* 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 */
|
||||
|
|
@ -0,0 +1,839 @@
|
|||
/* This file contains the definitions and documentation for the
|
||||
builtins used in the GNU compiler.
|
||||
Copyright (C) 2000-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* 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, BT_LAST, BT_LAST, false, false, \
|
||||
false, ATTR_LAST, 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 || flag_tree_parallelize_loops))
|
||||
|
||||
/* Builtin used by the implementation of GNU TM. These
|
||||
functions are mapped to the actual implementation of the STM library. */
|
||||
#undef DEF_TM_BUILTIN
|
||||
#define DEF_TM_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
||||
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
|
||||
true, true, true, ATTRS, false, flag_tm)
|
||||
|
||||
/* Builtin used by the implementation of libsanitizer. These
|
||||
functions are mapped to the actual implementation of the
|
||||
libtsan library. */
|
||||
#undef DEF_SANITIZER_BUILTIN
|
||||
#define DEF_SANITIZER_BUILTIN(ENUM, NAME, TYPE, ATTRS) \
|
||||
DEF_BUILTIN (ENUM, "__builtin_" NAME, BUILT_IN_NORMAL, TYPE, TYPE, \
|
||||
true, true, true, ATTRS, true, \
|
||||
(flag_asan || flag_tsan))
|
||||
|
||||
/* 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_LEAF_LIST : ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
|
||||
/* Define an attribute list for math functions that are normally
|
||||
"const" but if flag_rounding_math is set they are instead "pure".
|
||||
This distinction accounts for the fact that some math functions
|
||||
check the rounding mode which is akin to examining global
|
||||
memory. */
|
||||
#undef ATTR_MATHFN_FPROUNDING
|
||||
#define ATTR_MATHFN_FPROUNDING (flag_rounding_math ? \
|
||||
ATTR_PURE_NOTHROW_LEAF_LIST : ATTR_CONST_NOTHROW_LEAF_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_LEAF_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_LEAF_LIST
|
||||
|
||||
/* Make sure 0 is not a legitimate builtin. */
|
||||
DEF_BUILTIN_STUB(BUILT_IN_NONE, (const char *)0)
|
||||
|
||||
/* 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_LEAF_LIST)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_CEILF, "ceilf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_CEILL, "ceill", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_COPYSIGN, "copysign", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_COPYSIGNF, "copysignf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_COPYSIGNL, "copysignl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_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_LEAF_LIST)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_FABSF, "fabsf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_FABSL, "fabsl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_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_LEAF_LIST)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_FLOORF, "floorf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_FLOORL, "floorl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_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_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_FMAXF, "fmaxf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_FMAXL, "fmaxl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_FMIN, "fmin", BT_FN_DOUBLE_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_FMINF, "fminf", BT_FN_FLOAT_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_FMINL, "fminl", BT_FN_LONGDOUBLE_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_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_EXT_LIB_BUILTIN (BUILT_IN_GAMMA_R, "gamma_r", BT_FN_DOUBLE_DOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAF_R, "gammaf_r", BT_FN_FLOAT_FLOAT_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_GAMMAL_R, "gammal_r", BT_FN_LONGDOUBLE_LONGDOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_HUGE_VAL, "huge_val", BT_FN_DOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_HUGE_VALF, "huge_valf", BT_FN_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_HUGE_VALL, "huge_vall", BT_FN_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_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_GCC_BUILTIN (BUILT_IN_ICEIL, "iceil", BT_FN_INT_DOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ICEILF, "iceilf", BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ICEILL, "iceill", BT_FN_INT_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_IFLOOR, "ifloor", BT_FN_INT_DOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_IFLOORF, "ifloorf", BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_IFLOORL, "ifloorl", BT_FN_INT_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
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_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_INFF, "inff", BT_FN_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_INFL, "infl", BT_FN_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_INFD32, "infd32", BT_FN_DFLOAT32, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_INFD64, "infd64", BT_FN_DFLOAT64, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_INFD128, "infd128", BT_FN_DFLOAT128, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_IRINT, "irint", BT_FN_INT_DOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_IRINTF, "irintf", BT_FN_INT_FLOAT, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_IRINTL, "irintl", BT_FN_INT_LONGDOUBLE, ATTR_MATHFN_FPROUNDING_ERRNO)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_IROUND, "iround", BT_FN_INT_DOUBLE, ATTR_MATHFN_ERRNO)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_IROUNDF, "iroundf", BT_FN_INT_FLOAT, ATTR_MATHFN_ERRNO)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_IROUNDL, "iroundl", BT_FN_INT_LONGDOUBLE, ATTR_MATHFN_ERRNO)
|
||||
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_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LCEILF, "lceilf", BT_FN_LONG_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LCEILL, "lceill", BT_FN_LONG_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_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_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LFLOORF, "lfloorf", BT_FN_LONG_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LFLOORL, "lfloorl", BT_FN_LONG_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_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_EXT_LIB_BUILTIN (BUILT_IN_LGAMMA_R, "lgamma_r", BT_FN_DOUBLE_DOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_LGAMMAF_R, "lgammaf_r", BT_FN_FLOAT_FLOAT_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_LGAMMAL_R, "lgammal_r", BT_FN_LONGDOUBLE_LONGDOUBLE_INTPTR, ATTR_MATHFN_FPROUNDING_STORE)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LLCEIL, "llceil", BT_FN_LONGLONG_DOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LLCEILF, "llceilf", BT_FN_LONGLONG_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LLCEILL, "llceill", BT_FN_LONGLONG_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LLFLOOR, "llfloor", BT_FN_LONGLONG_DOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LLFLOORF, "llfloorf", BT_FN_LONGLONG_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LLFLOORL, "llfloorl", BT_FN_LONGLONG_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_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_C99_BUILTIN (BUILT_IN_NAN, "nan", BT_FN_DOUBLE_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL)
|
||||
DEF_C99_BUILTIN (BUILT_IN_NANF, "nanf", BT_FN_FLOAT_CONST_STRING, ATTR_CONST_NOTHROW_NONNULL)
|
||||
DEF_C99_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_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_NEARBYINTF, "nearbyintf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_NEARBYINTL, "nearbyintl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_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_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ROUNDF, "roundf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ROUNDL, "roundl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_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_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNBITF, "signbitf", BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNBITL, "signbitl", BT_FN_INT_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNBITD32, "signbitd32", BT_FN_INT_DFLOAT32, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNBITD64, "signbitd64", BT_FN_INT_DFLOAT64, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SIGNBITD128, "signbitd128", BT_FN_INT_DFLOAT128, ATTR_CONST_NOTHROW_LEAF_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_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_TRUNCF, "truncf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_TRUNCL, "truncl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_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_GCC_BUILTIN (BUILT_IN_CEXPI, "cexpi", BT_FN_COMPLEX_DOUBLE_DOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CEXPIF, "cexpif", BT_FN_COMPLEX_FLOAT_FLOAT, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CEXPIL, "cexpil", BT_FN_COMPLEX_LONGDOUBLE_LONGDOUBLE, ATTR_MATHFN_FPROUNDING)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CIMAG, "cimag", BT_FN_DOUBLE_COMPLEX_DOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CIMAGF, "cimagf", BT_FN_FLOAT_COMPLEX_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CIMAGL, "cimagl", BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_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_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CONJF, "conjf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CONJL, "conjl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_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_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CPROJF, "cprojf", BT_FN_COMPLEX_FLOAT_COMPLEX_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CPROJL, "cprojl", BT_FN_COMPLEX_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CREAL, "creal", BT_FN_DOUBLE_COMPLEX_DOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CREALF, "crealf", BT_FN_FLOAT_COMPLEX_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_CREALL, "creall", BT_FN_LONGDOUBLE_COMPLEX_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_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_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_BCOPY, "bcopy", BT_FN_VOID_CONST_PTR_PTR_SIZE, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_BZERO, "bzero", BT_FN_VOID_PTR_SIZE, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_INDEX, "index", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_MEMCHR, "memchr", BT_FN_PTR_CONST_PTR_INT_SIZE, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_MEMCMP, "memcmp", BT_FN_INT_CONST_PTR_CONST_PTR_SIZE, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_MEMCPY, "memcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_MEMMOVE, "memmove", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMPCPY, "mempcpy", BT_FN_PTR_PTR_CONST_PTR_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_MEMSET, "memset", BT_FN_PTR_PTR_INT_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_RINDEX, "rindex", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STPCPY, "stpcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STPNCPY, "stpncpy", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRCASECMP, "strcasecmp", BT_FN_INT_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRCAT, "strcat", BT_FN_STRING_STRING_CONST_STRING, ATTR_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRCHR, "strchr", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRCMP, "strcmp", BT_FN_INT_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRCPY, "strcpy", BT_FN_STRING_STRING_CONST_STRING, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRCSPN, "strcspn", BT_FN_SIZE_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRDUP, "strdup", BT_FN_STRING_CONST_STRING, ATTR_MALLOC_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNDUP, "strndup", BT_FN_STRING_CONST_STRING_SIZE, ATTR_MALLOC_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRLEN, "strlen", BT_FN_SIZE_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNCASECMP, "strncasecmp", BT_FN_INT_CONST_STRING_CONST_STRING_SIZE, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRNCAT, "strncat", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRNCMP, "strncmp", BT_FN_INT_CONST_STRING_CONST_STRING_SIZE, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRNCPY, "strncpy", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRPBRK, "strpbrk", BT_FN_STRING_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRRCHR, "strrchr", BT_FN_STRING_CONST_STRING_INT, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRSPN, "strspn", BT_FN_SIZE_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRSTR, "strstr", BT_FN_STRING_CONST_STRING_CONST_STRING, ATTR_PURE_NOTHROW_NONNULL_LEAF)
|
||||
|
||||
/* 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_NOTHROW_3_4)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_SPRINTF, "sprintf", BT_FN_INT_STRING_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_NOTHROW_2_3)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_SSCANF, "sscanf", BT_FN_INT_CONST_STRING_CONST_STRING_VAR, ATTR_FORMAT_SCANF_NOTHROW_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_NOTHROW_3_0)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_VSPRINTF, "vsprintf", BT_FN_INT_STRING_CONST_STRING_VALIST_ARG, ATTR_FORMAT_PRINTF_NOTHROW_2_0)
|
||||
DEF_C99_BUILTIN (BUILT_IN_VSSCANF, "vsscanf", BT_FN_INT_CONST_STRING_CONST_STRING_VALIST_ARG, ATTR_FORMAT_SCANF_NOTHROW_2_0)
|
||||
|
||||
/* Category: ctype builtins. */
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISALNUM, "isalnum", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISALPHA, "isalpha", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISASCII, "isascii", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ISBLANK, "isblank", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISCNTRL, "iscntrl", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISDIGIT, "isdigit", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISGRAPH, "isgraph", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISLOWER, "islower", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISPRINT, "isprint", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISPUNCT, "ispunct", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISSPACE, "isspace", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISUPPER, "isupper", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ISXDIGIT, "isxdigit", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_TOASCII, "toascii", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_TOLOWER, "tolower", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_TOUPPER, "toupper", BT_FN_INT_INT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
|
||||
/* Category: wctype builtins. */
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWALNUM, "iswalnum", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWALPHA, "iswalpha", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_ISWBLANK, "iswblank", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWCNTRL, "iswcntrl", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWDIGIT, "iswdigit", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWGRAPH, "iswgraph", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWLOWER, "iswlower", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWPRINT, "iswprint", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWPUNCT, "iswpunct", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWSPACE, "iswspace", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWUPPER, "iswupper", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_ISWXDIGIT, "iswxdigit", BT_FN_INT_WINT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_TOWLOWER, "towlower", BT_FN_WINT_WINT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_C94_BUILTIN (BUILT_IN_TOWUPPER, "towupper", BT_FN_WINT_WINT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
|
||||
/* Category: miscellaneous builtins. */
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ABORT, "abort", BT_FN_VOID, ATTR_NORETURN_NOTHROW_LEAF_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_ABS, "abs", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_AGGREGATE_INCOMING_ADDRESS, "aggregate_incoming_address", BT_FN_PTR_VAR, ATTR_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ALLOCA, "alloca", BT_FN_PTR_SIZE, ATTR_MALLOC_NOTHROW_LEAF_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_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_BSWAP16, "bswap16", BT_FN_UINT16_UINT16, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_BSWAP32, "bswap32", BT_FN_UINT32_UINT32, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_BSWAP64, "bswap64", BT_FN_UINT64_UINT64, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_CLEAR_CACHE, "__clear_cache", BT_FN_VOID_PTR_PTR, ATTR_NOTHROW_LEAF_LIST)
|
||||
/* [trans-mem]: Adjust BUILT_IN_TM_CALLOC if BUILT_IN_CALLOC is changed. */
|
||||
DEF_LIB_BUILTIN (BUILT_IN_CALLOC, "calloc", BT_FN_PTR_SIZE_SIZE, ATTR_MALLOC_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CLASSIFY_TYPE, "classify_type", BT_FN_INT_VAR, ATTR_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CLZ, "clz", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CLZIMAX, "clzimax", BT_FN_INT_UINTMAX, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CLZL, "clzl", BT_FN_INT_ULONG, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CLZLL, "clzll", BT_FN_INT_ULONGLONG, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CONSTANT_P, "constant_p", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CTZ, "ctz", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CTZIMAX, "ctzimax", BT_FN_INT_UINTMAX, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CTZL, "ctzl", BT_FN_INT_ULONG, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CTZLL, "ctzll", BT_FN_INT_ULONGLONG, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CLRSB, "clrsb", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CLRSBIMAX, "clrsbimax", BT_FN_INT_INTMAX, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CLRSBL, "clrsbl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_CLRSBLL, "clrsbll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LEAF_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_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_EH_RETURN_DATA_REGNO, "eh_return_data_regno", BT_FN_INT_INT, ATTR_LEAF_LIST)
|
||||
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_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ASSUME_ALIGNED, "assume_aligned", BT_FN_PTR_CONST_PTR_SIZE_VAR, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_EXTEND_POINTER, "extend_pointer", BT_FN_UNWINDWORD_PTR, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_EXTRACT_RETURN_ADDR, "extract_return_addr", BT_FN_PTR_PTR, ATTR_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FFS, "ffs", BT_FN_INT_INT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSIMAX, "ffsimax", BT_FN_INT_INTMAX, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSL, "ffsl", BT_FN_INT_LONG, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FFSLL, "ffsll", BT_FN_INT_LONGLONG, ATTR_CONST_NOTHROW_LEAF_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)
|
||||
/* [trans-mem]: Adjust BUILT_IN_TM_FREE if BUILT_IN_FREE is changed. */
|
||||
DEF_LIB_BUILTIN (BUILT_IN_FREE, "free", BT_FN_VOID_PTR, ATTR_NOTHROW_LIST)
|
||||
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_LEAF_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_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITEF, "finitef", BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITEL, "finitel", BT_FN_INT_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITED32, "finited32", BT_FN_INT_DFLOAT32, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITED64, "finited64", BT_FN_INT_DFLOAT64, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITED128, "finited128", BT_FN_INT_DFLOAT128, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_FPCLASSIFY, "fpclassify", BT_FN_INT_INT_INT_INT_INT_INT_VAR, ATTR_CONST_NOTHROW_TYPEGENERIC_LEAF)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ISFINITE, "isfinite", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_TYPEGENERIC_LEAF)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ISINF_SIGN, "isinf_sign", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_TYPEGENERIC_LEAF)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_ISINF, "isinf", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_TYPEGENERIC)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISINFF, "isinff", BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISINFL, "isinfl", BT_FN_INT_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISINFD32, "isinfd32", BT_FN_INT_DFLOAT32, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISINFD64, "isinfd64", BT_FN_INT_DFLOAT64, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISINFD128, "isinfd128", BT_FN_INT_DFLOAT128, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_C90RES_BUILTIN (BUILT_IN_ISNAN, "isnan", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_TYPEGENERIC_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISNANF, "isnanf", BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISNANL, "isnanl", BT_FN_INT_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISNAND32, "isnand32", BT_FN_INT_DFLOAT32, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISNAND64, "isnand64", BT_FN_INT_DFLOAT64, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_ISNAND128, "isnand128", BT_FN_INT_DFLOAT128, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ISNORMAL, "isnormal", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_TYPEGENERIC_LEAF)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ISGREATER, "isgreater", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_TYPEGENERIC_LEAF)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ISGREATEREQUAL, "isgreaterequal", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_TYPEGENERIC_LEAF)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ISLESS, "isless", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_TYPEGENERIC_LEAF)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ISLESSEQUAL, "islessequal", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_TYPEGENERIC_LEAF)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ISLESSGREATER, "islessgreater", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_TYPEGENERIC_LEAF)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_ISUNORDERED, "isunordered", BT_FN_INT_VAR, ATTR_CONST_NOTHROW_TYPEGENERIC_LEAF)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_LABS, "labs", BT_FN_LONG_LONG, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN_LLABS, "llabs", BT_FN_LONGLONG_LONGLONG, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LONGJMP, "longjmp", BT_FN_VOID_PTR_INT, ATTR_NORETURN_NOTHROW_LEAF_LIST)
|
||||
/* [trans-mem]: Adjust BUILT_IN_TM_MALLOC if BUILT_IN_MALLOC is changed. */
|
||||
DEF_LIB_BUILTIN (BUILT_IN_MALLOC, "malloc", BT_FN_PTR_SIZE, ATTR_MALLOC_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_NEXT_ARG, "next_arg", BT_FN_PTR_VAR, ATTR_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_PARITY, "parity", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_PARITYIMAX, "parityimax", BT_FN_INT_UINTMAX, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_PARITYL, "parityl", BT_FN_INT_ULONG, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_PARITYLL, "parityll", BT_FN_INT_ULONGLONG, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_POPCOUNT, "popcount", BT_FN_INT_UINT, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTIMAX, "popcountimax", BT_FN_INT_UINTMAX, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTL, "popcountl", BT_FN_INT_ULONG, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_POPCOUNTLL, "popcountll", BT_FN_INT_ULONGLONG, ATTR_CONST_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_PREFETCH, "prefetch", BT_FN_VOID_CONST_PTR_VAR, ATTR_NOVOPS_LEAF_LIST)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_REALLOC, "realloc", BT_FN_PTR_PTR_SIZE, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_RETURN, "return", BT_FN_VOID_PTR, ATTR_NORETURN_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_RETURN_ADDRESS, "return_address", BT_FN_PTR_UINT, ATTR_LEAF_LIST)
|
||||
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_EXT_LIB_BUILTIN (BUILT_IN_STRFMON, "strfmon", BT_FN_SSIZE_STRING_SIZE_CONST_STRING_VAR, ATTR_FORMAT_STRFMON_NOTHROW_3_4)
|
||||
DEF_LIB_BUILTIN (BUILT_IN_STRFTIME, "strftime", BT_FN_SIZE_STRING_SIZE_CONST_STRING_CONST_PTR, ATTR_FORMAT_STRFTIME_NOTHROW_3_0)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_TRAP, "trap", BT_FN_VOID, ATTR_NORETURN_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_UNREACHABLE, "unreachable", BT_FN_VOID, ATTR_CONST_NORETURN_NOTHROW_LEAF_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_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_VA_END, "va_end", BT_FN_VOID_VALIST_REF, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_VA_START, "va_start", BT_FN_VOID_VALIST_REF_VAR, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_VA_ARG_PACK, "va_arg_pack", BT_FN_INT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_VA_ARG_PACK_LEN, "va_arg_pack_len", BT_FN_INT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN__EXIT, "_exit", BT_FN_VOID_INT, ATTR_NORETURN_NOTHROW_LEAF_LIST)
|
||||
DEF_C99_BUILTIN (BUILT_IN__EXIT2, "_Exit", BT_FN_VOID_INT, ATTR_NORETURN_NOTHROW_LEAF_LIST)
|
||||
|
||||
/* Implementing nested functions. */
|
||||
DEF_BUILTIN_STUB (BUILT_IN_INIT_TRAMPOLINE, "__builtin_init_trampoline")
|
||||
DEF_BUILTIN_STUB (BUILT_IN_INIT_HEAP_TRAMPOLINE, "__builtin_init_heap_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")
|
||||
DEF_BUILTIN_STUB (BUILT_IN_ALLOCA_WITH_ALIGN, "__builtin_alloca_with_align")
|
||||
|
||||
/* Object size checking builtins. */
|
||||
DEF_GCC_BUILTIN (BUILT_IN_OBJECT_SIZE, "object_size", BT_FN_SIZE_CONST_PTR_INT, ATTR_PURE_NOTHROW_LEAF_LIST)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMCPY_CHK, "__memcpy_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMMOVE_CHK, "__memmove_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_RET1_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMPCPY_CHK, "__mempcpy_chk", BT_FN_PTR_PTR_CONST_PTR_SIZE_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_MEMSET_CHK, "__memset_chk", BT_FN_PTR_PTR_INT_SIZE_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STPCPY_CHK, "__stpcpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STPNCPY_CHK, "__stpncpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRCAT_CHK, "__strcat_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRCPY_CHK, "__strcpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNCAT_CHK, "__strncat_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_STRNCPY_CHK, "__strncpy_chk", BT_FN_STRING_STRING_CONST_STRING_SIZE_SIZE, ATTR_NOTHROW_NONNULL_LEAF)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SNPRINTF_CHK, "__snprintf_chk", BT_FN_INT_STRING_SIZE_INT_SIZE_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_NOTHROW_5_6)
|
||||
DEF_EXT_LIB_BUILTIN (BUILT_IN_SPRINTF_CHK, "__sprintf_chk", BT_FN_INT_STRING_INT_SIZE_CONST_STRING_VAR, ATTR_FORMAT_PRINTF_NOTHROW_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_NOTHROW_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_NOTHROW_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 (BUILT_IN_PROFILE_FUNC_ENTER, "__cyg_profile_func_enter", BUILT_IN_NORMAL, BT_FN_VOID_PTR_PTR, BT_LAST,
|
||||
false, false, false, ATTR_NULL, true, true)
|
||||
DEF_BUILTIN (BUILT_IN_PROFILE_FUNC_EXIT, "__cyg_profile_func_exit", BUILT_IN_NORMAL, BT_FN_VOID_PTR_PTR, BT_LAST,
|
||||
false, false, false, ATTR_NULL, true, true)
|
||||
|
||||
/* TLS thread pointer related builtins. */
|
||||
DEF_BUILTIN (BUILT_IN_THREAD_POINTER, "__builtin_thread_pointer",
|
||||
BUILT_IN_NORMAL, BT_FN_PTR, BT_LAST,
|
||||
false, false, true, ATTR_CONST_NOTHROW_LIST, true,
|
||||
targetm.have_tls)
|
||||
|
||||
DEF_BUILTIN (BUILT_IN_SET_THREAD_POINTER, "__builtin_set_thread_pointer",
|
||||
BUILT_IN_NORMAL, BT_FN_VOID_PTR, BT_LAST,
|
||||
false, false, true, ATTR_NOTHROW_LIST, true,
|
||||
targetm.have_tls)
|
||||
|
||||
/* TLS emulation. */
|
||||
DEF_BUILTIN (BUILT_IN_EMUTLS_GET_ADDRESS, targetm.emutls.get_address,
|
||||
BUILT_IN_NORMAL,
|
||||
BT_FN_PTR_PTR, BT_FN_PTR_PTR,
|
||||
true, true, true, ATTR_CONST_NOTHROW_NONNULL_LEAF, false,
|
||||
!targetm.have_tls)
|
||||
DEF_BUILTIN (BUILT_IN_EMUTLS_REGISTER_COMMON,
|
||||
targetm.emutls.register_common, BUILT_IN_NORMAL,
|
||||
BT_FN_VOID_PTR_WORD_WORD_PTR, BT_FN_VOID_PTR_WORD_WORD_PTR,
|
||||
true, true, true, ATTR_NOTHROW_LEAF_LIST, false,
|
||||
!targetm.have_tls)
|
||||
|
||||
/* Exception support. */
|
||||
DEF_BUILTIN_STUB (BUILT_IN_UNWIND_RESUME, "__builtin_unwind_resume")
|
||||
DEF_BUILTIN_STUB (BUILT_IN_CXA_END_CLEANUP, "__builtin_cxa_end_cleanup")
|
||||
DEF_BUILTIN_STUB (BUILT_IN_EH_POINTER, "__builtin_eh_pointer")
|
||||
DEF_BUILTIN_STUB (BUILT_IN_EH_FILTER, "__builtin_eh_filter")
|
||||
DEF_BUILTIN_STUB (BUILT_IN_EH_COPY_VALUES, "__builtin_eh_copy_values")
|
||||
|
||||
/* __FILE__, __LINE__, __FUNCTION__ as builtins. */
|
||||
DEF_GCC_BUILTIN (BUILT_IN_FILE, "FILE", BT_FN_CONST_STRING, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_FUNCTION, "FUNCTION", BT_FN_CONST_STRING, ATTR_NOTHROW_LEAF_LIST)
|
||||
DEF_GCC_BUILTIN (BUILT_IN_LINE, "LINE", BT_FN_INT, ATTR_NOTHROW_LEAF_LIST)
|
||||
|
||||
/* Synchronization Primitives. */
|
||||
#include "sync-builtins.def"
|
||||
|
||||
/* OpenMP builtins. */
|
||||
#include "omp-builtins.def"
|
||||
|
||||
/* GTM builtins. */
|
||||
#include "gtm-builtins.def"
|
||||
|
||||
/* Sanitizer builtins. */
|
||||
#include "sanitizer.def"
|
||||
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
#define BUILDING_GCC_MAJOR 4
|
||||
#define BUILDING_GCC_MINOR 8
|
||||
#define BUILDING_GCC_PATCHLEVEL 3
|
||||
#define BUILDING_GCC_VERSION (BUILDING_GCC_MAJOR * 1000 + BUILDING_GCC_MINOR)
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
/* 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-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Tree nodes used in the C frontend. These are also shared with the
|
||||
C++ and Objective C frontends. */
|
||||
|
||||
/* A C_MAYBE_CONST_EXPR, currently only used for C and Objective C,
|
||||
tracks information about constancy of an expression and VLA type
|
||||
sizes or VM expressions from typeof that need to be evaluated
|
||||
before the main expression. It is used during parsing and removed
|
||||
in c_fully_fold. C_MAYBE_CONST_EXPR_PRE is the expression to
|
||||
evaluate first, if not NULL; C_MAYBE_CONST_EXPR_EXPR is the main
|
||||
expression. If C_MAYBE_CONST_EXPR_INT_OPERANDS is set then the
|
||||
expression may be used in an unevaluated part of an integer
|
||||
constant expression, but not in an evaluated part. If
|
||||
C_MAYBE_CONST_EXPR_NON_CONST is set then the expression contains
|
||||
something that cannot occur in an evaluated part of a constant
|
||||
expression (or outside of sizeof in C90 mode); otherwise it does
|
||||
not. */
|
||||
DEFTREECODE (C_MAYBE_CONST_EXPR, "c_maybe_const_expr", tcc_expression, 2)
|
||||
|
||||
/* An EXCESS_PRECISION_EXPR, currently only used for C and Objective
|
||||
C, represents an expression evaluated in greater range or precision
|
||||
than its type. The type of the EXCESS_PRECISION_EXPR is the
|
||||
semantic type while the operand represents what is actually being
|
||||
evaluated. */
|
||||
DEFTREECODE (EXCESS_PRECISION_EXPR, "excess_precision_expr", tcc_expression, 1)
|
||||
|
||||
/* Used to represent a user-defined literal.
|
||||
The operands are an IDENTIFIER for the suffix, the VALUE of the literal,
|
||||
and for numeric literals the original string representation of the
|
||||
number. */
|
||||
DEFTREECODE (USERDEF_LITERAL, "userdef_literal", tcc_exceptional, 3)
|
||||
|
||||
/* Represents a 'sizeof' expression during C++ template expansion,
|
||||
or for the purpose of -Wsizeof-pointer-memaccess warning. */
|
||||
DEFTREECODE (SIZEOF_EXPR, "sizeof_expr", tcc_expression, 1)
|
||||
|
||||
/*
|
||||
Local variables:
|
||||
mode:c
|
||||
End:
|
||||
*/
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,114 @@
|
|||
/* Definitions of Objective-C front-end entry points used for C and C++.
|
||||
Copyright (C) 1987-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_C_COMMON_OBJC_H
|
||||
#define GCC_C_COMMON_OBJC_H
|
||||
|
||||
/* ObjC ivar visibility types. */
|
||||
typedef enum objc_ivar_visibility_kind {
|
||||
OBJC_IVAR_VIS_PROTECTED = 0,
|
||||
OBJC_IVAR_VIS_PUBLIC = 1,
|
||||
OBJC_IVAR_VIS_PRIVATE = 2,
|
||||
OBJC_IVAR_VIS_PACKAGE = 3
|
||||
} objc_ivar_visibility_kind;
|
||||
|
||||
/* Objective-C / Objective-C++ entry points. */
|
||||
|
||||
/* The following ObjC/ObjC++ functions are called by the C and/or C++
|
||||
front-ends; they all must have corresponding stubs in stub-objc.c. */
|
||||
extern void objc_write_global_declarations (void);
|
||||
extern tree objc_is_class_name (tree);
|
||||
extern tree objc_is_object_ptr (tree);
|
||||
extern void objc_check_decl (tree);
|
||||
extern void objc_check_global_decl (tree);
|
||||
extern tree objc_common_type (tree, tree);
|
||||
extern bool objc_compare_types (tree, tree, int, tree);
|
||||
extern bool objc_have_common_type (tree, tree, int, tree);
|
||||
extern bool objc_diagnose_private_ivar (tree);
|
||||
extern void objc_volatilize_decl (tree);
|
||||
extern tree objc_rewrite_function_call (tree, tree);
|
||||
extern tree objc_message_selector (void);
|
||||
extern tree objc_lookup_ivar (tree, tree);
|
||||
extern void objc_clear_super_receiver (void);
|
||||
extern int objc_is_public (tree, tree);
|
||||
extern tree objc_is_id (tree);
|
||||
extern void objc_declare_alias (tree, tree);
|
||||
extern void objc_declare_class (tree);
|
||||
extern void objc_declare_protocol (tree, tree);
|
||||
extern tree objc_build_message_expr (tree, tree);
|
||||
extern tree objc_finish_message_expr (tree, tree, tree, tree*);
|
||||
extern tree objc_build_selector_expr (location_t, tree);
|
||||
extern tree objc_build_protocol_expr (tree);
|
||||
extern tree objc_build_encode_expr (tree);
|
||||
extern tree objc_build_string_object (tree);
|
||||
extern tree objc_get_protocol_qualified_type (tree, tree);
|
||||
extern tree objc_get_class_reference (tree);
|
||||
extern tree objc_get_class_ivars (tree);
|
||||
extern bool objc_detect_field_duplicates (bool);
|
||||
extern void objc_start_class_interface (tree, tree, tree, tree);
|
||||
extern void objc_start_category_interface (tree, tree, tree, tree);
|
||||
extern void objc_start_protocol (tree, tree, tree);
|
||||
extern void objc_continue_interface (void);
|
||||
extern void objc_finish_interface (void);
|
||||
extern void objc_start_class_implementation (tree, tree);
|
||||
extern void objc_start_category_implementation (tree, tree);
|
||||
extern void objc_continue_implementation (void);
|
||||
extern void objc_finish_implementation (void);
|
||||
extern void objc_set_visibility (objc_ivar_visibility_kind);
|
||||
extern tree objc_build_method_signature (bool, tree, tree, tree, bool);
|
||||
extern void objc_add_method_declaration (bool, tree, tree);
|
||||
extern bool objc_start_method_definition (bool, tree, tree, tree);
|
||||
extern void objc_finish_method_definition (tree);
|
||||
extern void objc_add_instance_variable (tree);
|
||||
extern tree objc_build_keyword_decl (tree, tree, tree, tree);
|
||||
extern tree objc_build_throw_stmt (location_t, tree);
|
||||
extern void objc_begin_try_stmt (location_t, tree);
|
||||
extern tree objc_finish_try_stmt (void);
|
||||
extern void objc_begin_catch_clause (tree);
|
||||
extern void objc_finish_catch_clause (void);
|
||||
extern void objc_build_finally_clause (location_t, tree);
|
||||
extern tree objc_build_synchronized (location_t, tree, tree);
|
||||
extern int objc_static_init_needed_p (void);
|
||||
extern tree objc_generate_static_init_call (tree);
|
||||
extern tree objc_generate_write_barrier (tree, enum tree_code, tree);
|
||||
extern void objc_set_method_opt (bool);
|
||||
extern void objc_finish_foreach_loop (location_t, tree, tree, tree, tree, tree);
|
||||
extern bool objc_method_decl (enum tree_code);
|
||||
extern void objc_add_property_declaration (location_t, tree, bool, bool, bool,
|
||||
bool, bool, bool, tree, tree);
|
||||
extern tree objc_maybe_build_component_ref (tree, tree);
|
||||
extern tree objc_build_class_component_ref (tree, tree);
|
||||
extern tree objc_maybe_build_modify_expr (tree, tree);
|
||||
extern tree objc_build_incr_expr_for_property_ref (location_t, enum tree_code,
|
||||
tree, tree);
|
||||
extern void objc_add_synthesize_declaration (location_t, tree);
|
||||
extern void objc_add_dynamic_declaration (location_t, tree);
|
||||
extern const char * objc_maybe_printable_name (tree, int);
|
||||
extern bool objc_is_property_ref (tree);
|
||||
extern bool objc_string_ref_type_p (tree);
|
||||
extern void objc_check_format_arg (tree, tree);
|
||||
extern void objc_finish_function (void);
|
||||
extern void objc_maybe_warn_exceptions (location_t);
|
||||
|
||||
/* The following are provided by the C and C++ front-ends, and called by
|
||||
ObjC/ObjC++. */
|
||||
extern void *objc_get_current_scope (void);
|
||||
extern void objc_mark_locals_volatile (void *);
|
||||
|
||||
#endif /* ! GCC_C_COMMON_OBJC_H */
|
||||
|
|
@ -0,0 +1,150 @@
|
|||
/* Pragma related interfaces.
|
||||
Copyright (C) 1995-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#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_TASK,
|
||||
PRAGMA_OMP_TASKWAIT,
|
||||
PRAGMA_OMP_TASKYIELD,
|
||||
PRAGMA_OMP_THREADPRIVATE,
|
||||
|
||||
PRAGMA_GCC_PCH_PREPROCESS,
|
||||
|
||||
PRAGMA_FIRST_EXTERNAL
|
||||
} pragma_kind;
|
||||
|
||||
|
||||
/* All clauses defined by OpenMP 2.5 and 3.0.
|
||||
Used internally by both C and C++ parsers. */
|
||||
typedef enum pragma_omp_clause {
|
||||
PRAGMA_OMP_CLAUSE_NONE = 0,
|
||||
|
||||
PRAGMA_OMP_CLAUSE_COLLAPSE,
|
||||
PRAGMA_OMP_CLAUSE_COPYIN,
|
||||
PRAGMA_OMP_CLAUSE_COPYPRIVATE,
|
||||
PRAGMA_OMP_CLAUSE_DEFAULT,
|
||||
PRAGMA_OMP_CLAUSE_FIRSTPRIVATE,
|
||||
PRAGMA_OMP_CLAUSE_IF,
|
||||
PRAGMA_OMP_CLAUSE_LASTPRIVATE,
|
||||
PRAGMA_OMP_CLAUSE_NOWAIT,
|
||||
PRAGMA_OMP_CLAUSE_NUM_THREADS,
|
||||
PRAGMA_OMP_CLAUSE_ORDERED,
|
||||
PRAGMA_OMP_CLAUSE_PRIVATE,
|
||||
PRAGMA_OMP_CLAUSE_REDUCTION,
|
||||
PRAGMA_OMP_CLAUSE_SCHEDULE,
|
||||
PRAGMA_OMP_CLAUSE_SHARED,
|
||||
PRAGMA_OMP_CLAUSE_UNTIED,
|
||||
PRAGMA_OMP_CLAUSE_FINAL,
|
||||
PRAGMA_OMP_CLAUSE_MERGEABLE
|
||||
} pragma_omp_clause;
|
||||
|
||||
extern struct cpp_reader* parse_in;
|
||||
|
||||
/* It's safe to always leave visibility pragma enabled as if
|
||||
visibility is not supported on the host OS platform the
|
||||
statements are ignored. */
|
||||
extern void push_visibility (const char *, int);
|
||||
extern bool pop_visibility (int);
|
||||
|
||||
extern void init_pragma (void);
|
||||
|
||||
/* Front-end wrappers for pragma registration. */
|
||||
typedef void (*pragma_handler_1arg)(struct cpp_reader *);
|
||||
/* A second pragma handler, which adds a void * argument allowing to pass extra
|
||||
data to the handler. */
|
||||
typedef void (*pragma_handler_2arg)(struct cpp_reader *, void *);
|
||||
|
||||
/* This union allows to abstract the different handlers. */
|
||||
union gen_pragma_handler {
|
||||
pragma_handler_1arg handler_1arg;
|
||||
pragma_handler_2arg handler_2arg;
|
||||
};
|
||||
/* Internally used to keep the data of the handler. */
|
||||
struct internal_pragma_handler_d {
|
||||
union gen_pragma_handler handler;
|
||||
/* Permits to know if handler is a pragma_handler_1arg (extra_data is false)
|
||||
or a pragma_handler_2arg (extra_data is true). */
|
||||
bool extra_data;
|
||||
/* A data field which can be used when extra_data is true. */
|
||||
void * data;
|
||||
};
|
||||
typedef struct internal_pragma_handler_d internal_pragma_handler;
|
||||
|
||||
extern void c_register_pragma (const char *space, const char *name,
|
||||
pragma_handler_1arg handler);
|
||||
extern void c_register_pragma_with_data (const char *space, const char *name,
|
||||
pragma_handler_2arg handler,
|
||||
void *data);
|
||||
|
||||
extern void c_register_pragma_with_expansion (const char *space,
|
||||
const char *name,
|
||||
pragma_handler_1arg handler);
|
||||
extern void c_register_pragma_with_expansion_and_data (const char *space,
|
||||
const char *name,
|
||||
pragma_handler_2arg handler,
|
||||
void *data);
|
||||
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 *);
|
||||
|
||||
/* Flags for use with c_lex_with_flags. The values here were picked
|
||||
so that 0 means to translate and join strings. */
|
||||
#define C_LEX_STRING_NO_TRANSLATE 1 /* Do not lex strings into
|
||||
execution character set. */
|
||||
#define C_LEX_STRING_NO_JOIN 2 /* Do not concatenate strings
|
||||
nor translate them into execution
|
||||
character set. */
|
||||
|
||||
/* 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 *,
|
||||
int);
|
||||
|
||||
extern void c_pp_lookup_pragma (unsigned int, const char **, const char **);
|
||||
|
||||
extern GTY(()) tree pragma_extern_prefix;
|
||||
|
||||
#endif /* GCC_C_PRAGMA_H */
|
||||
|
|
@ -0,0 +1,215 @@
|
|||
/* Various declarations for the C and C++ pretty-printers.
|
||||
Copyright (C) 2002-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_C_PRETTY_PRINTER
|
||||
#define GCC_C_PRETTY_PRINTER
|
||||
|
||||
#include "tree.h"
|
||||
#include "c-family/c-common.h"
|
||||
#include "pretty-print.h"
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
pp_c_flag_abstract = 1 << 1,
|
||||
pp_c_flag_gnu_v3 = 1 << 2,
|
||||
pp_c_flag_last_bit = 3
|
||||
} 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 *);
|
||||
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_attributes_display (c_pretty_printer *, tree);
|
||||
void pp_c_cv_qualifiers (c_pretty_printer *pp, int qualifiers, bool func_type);
|
||||
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, va_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_ws_string (c_pretty_printer *, const char *);
|
||||
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 */
|
||||
|
|
@ -0,0 +1,671 @@
|
|||
/* Definitions for C parsing and type checking.
|
||||
Copyright (C) 1987-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_C_TREE_H
|
||||
#define GCC_C_TREE_H
|
||||
|
||||
#include "c-family/c-common.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 *))
|
||||
|
||||
/* 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)
|
||||
|
||||
/* 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 type is defined inside a struct or union type.
|
||||
This is used for -Wc++-compat. */
|
||||
#define C_TYPE_DEFINED_IN_STRUCT(TYPE) TYPE_LANG_FLAG_2 (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 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 \
|
||||
|| (!prototype_p (TREE_TYPE (EXP)) \
|
||||
&& !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)
|
||||
|
||||
/* For a CONSTRUCTOR, whether some initializer contains a
|
||||
subexpression meaning it is not a constant expression. */
|
||||
#define CONSTRUCTOR_NON_CONST(EXPR) TREE_LANG_FLAG_1 (CONSTRUCTOR_CHECK (EXPR))
|
||||
|
||||
/* 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 unary/binary operator of an expression, which may
|
||||
have been changed by fold, STRING_CST for unparenthesized string
|
||||
constants, C_MAYBE_CONST_EXPR for __builtin_constant_p calls
|
||||
(even if parenthesized), for subexpressions, and for non-constant
|
||||
initializers, or ERROR_MARK for other expressions (including
|
||||
parenthesized expressions). */
|
||||
enum tree_code original_code;
|
||||
/* If not NULL, the original type of an expression. This will
|
||||
differ from the type of the value field for an enum constant.
|
||||
The type of an enum constant is a plain integer type, but this
|
||||
field will be the enum type. */
|
||||
tree original_type;
|
||||
};
|
||||
|
||||
/* Type alias for struct c_expr. This allows to use the structure
|
||||
inside the VEC types. */
|
||||
typedef struct c_expr c_expr_t;
|
||||
|
||||
/* A varray of c_expr_t. */
|
||||
|
||||
/* Append a new c_expr_t element to V. */
|
||||
#define C_EXPR_APPEND(V, ELEM) \
|
||||
do { \
|
||||
c_expr_t __elem = (ELEM); \
|
||||
vec_safe_push (V, __elem); \
|
||||
} while (0)
|
||||
|
||||
/* 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 {
|
||||
/* No typespec. This appears only in struct c_declspec. */
|
||||
ctsk_none,
|
||||
/* 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;
|
||||
/* Whether the expression has operands suitable for use in constant
|
||||
expressions. */
|
||||
bool expr_const_operands;
|
||||
/* The specifier itself. */
|
||||
tree spec;
|
||||
/* An expression to be evaluated before the type specifier, in the
|
||||
case of typeof specifiers, or NULL otherwise or if no such
|
||||
expression is required for a particular typeof specifier. In
|
||||
particular, when typeof is applied to an expression of variably
|
||||
modified type, that expression must be evaluated in order to
|
||||
determine array sizes that form part of the type, but the
|
||||
expression itself (as opposed to the array sizes) forms no part
|
||||
of the type and so needs to be recorded separately. */
|
||||
tree expr;
|
||||
};
|
||||
|
||||
/* 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", "_Decimal32", "_Decimal64", "_Decimal128", "_Fract", "_Accum",
|
||||
or none of these. */
|
||||
enum c_typespec_keyword {
|
||||
cts_none,
|
||||
cts_void,
|
||||
cts_bool,
|
||||
cts_char,
|
||||
cts_int,
|
||||
cts_float,
|
||||
cts_int128,
|
||||
cts_double,
|
||||
cts_dfloat32,
|
||||
cts_dfloat64,
|
||||
cts_dfloat128,
|
||||
cts_fract,
|
||||
cts_accum
|
||||
};
|
||||
|
||||
/* This enum lists all the possible declarator specifiers, storage
|
||||
class or attribute that a user can write. There is at least one
|
||||
enumerator per possible declarator specifier in the struct
|
||||
c_declspecs below.
|
||||
|
||||
It is used to index the array of declspec locations in struct
|
||||
c_declspecs. */
|
||||
enum c_declspec_word {
|
||||
cdw_typespec /* A catch-all for a typespec. */,
|
||||
cdw_storage_class /* A catch-all for a storage class */,
|
||||
cdw_attributes,
|
||||
cdw_typedef,
|
||||
cdw_explicit_signed,
|
||||
cdw_deprecated,
|
||||
cdw_default_int,
|
||||
cdw_long,
|
||||
cdw_long_long,
|
||||
cdw_short,
|
||||
cdw_signed,
|
||||
cdw_unsigned,
|
||||
cdw_complex,
|
||||
cdw_inline,
|
||||
cdw_noreturn,
|
||||
cdw_thread,
|
||||
cdw_const,
|
||||
cdw_volatile,
|
||||
cdw_restrict,
|
||||
cdw_saturating,
|
||||
cdw_alignas,
|
||||
cdw_address_space,
|
||||
cdw_number_of_elements /* This one must always be the last
|
||||
enumerator. */
|
||||
};
|
||||
|
||||
/* A sequence of declaration specifiers in C. When a new declaration
|
||||
specifier is added, please update the enum c_declspec_word above
|
||||
accordingly. */
|
||||
struct c_declspecs {
|
||||
source_location locations[cdw_number_of_elements];
|
||||
/* 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;
|
||||
/* Any expression to be evaluated before the type, from a typeof
|
||||
specifier. */
|
||||
tree expr;
|
||||
/* 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;
|
||||
/* The base-2 log of the greatest alignment required by an _Alignas
|
||||
specifier, in bytes, or -1 if no such specifiers with nonzero
|
||||
alignment. */
|
||||
int align_log;
|
||||
/* The storage class specifier, or csc_none if none. */
|
||||
enum c_storage_class storage_class;
|
||||
/* Any type specifier keyword used such as "int", not reflecting
|
||||
modifiers such as "short", or cts_none if none. */
|
||||
ENUM_BITFIELD (c_typespec_keyword) typespec_word : 8;
|
||||
/* The kind of type specifier if one has been seen, ctsk_none
|
||||
otherwise. */
|
||||
ENUM_BITFIELD (c_typespec_kind) typespec_kind : 3;
|
||||
/* Whether any expressions in typeof specifiers may appear in
|
||||
constant expressions. */
|
||||
BOOL_BITFIELD expr_const_operands : 1;
|
||||
/* Whether any declaration specifiers have been seen at all. */
|
||||
BOOL_BITFIELD declspecs_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 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;
|
||||
/* Whether the type defaulted to "int" because there were no type
|
||||
specifiers. */
|
||||
BOOL_BITFIELD default_int_p : 1;
|
||||
/* 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 "_Noreturn" was speciied. */
|
||||
BOOL_BITFIELD noreturn_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;
|
||||
/* Whether "_Sat" was specified. */
|
||||
BOOL_BITFIELD saturating_p : 1;
|
||||
/* Whether any alignment specifier (even with zero alignment) was
|
||||
specified. */
|
||||
BOOL_BITFIELD alignas_p : 1;
|
||||
/* The address space that the declaration belongs to. */
|
||||
addr_space_t address_space;
|
||||
};
|
||||
|
||||
/* 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,
|
||||
/* Parenthesized declarator with nested attributes. */
|
||||
cdk_attrs
|
||||
};
|
||||
|
||||
typedef struct c_arg_tag_d {
|
||||
/* The argument name. */
|
||||
tree id;
|
||||
/* The type of the argument. */
|
||||
tree type;
|
||||
} c_arg_tag;
|
||||
|
||||
|
||||
/* 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. */
|
||||
vec<c_arg_tag, va_gc> *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 compound expression of VLA sizes from the parameters, or NULL.
|
||||
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;
|
||||
location_t id_loc; /* Currently only set for cdk_id, cdk_array. */
|
||||
/* Except for cdk_id, the contained declarator. For cdk_id, NULL. */
|
||||
struct c_declarator *declarator;
|
||||
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;
|
||||
};
|
||||
|
||||
/* Used when parsing an enum. Initialized by start_enum. */
|
||||
struct c_enum_contents
|
||||
{
|
||||
/* While defining an enum type, this is 1 plus the last enumerator
|
||||
constant value. */
|
||||
tree enum_next_value;
|
||||
|
||||
/* Nonzero means that there was overflow computing enum_next_value. */
|
||||
int enum_overflow;
|
||||
};
|
||||
|
||||
/* A type of reference to a static identifier in an inline
|
||||
function. */
|
||||
enum c_inline_static_type {
|
||||
/* Identifier with internal linkage used in function that may be an
|
||||
inline definition (i.e., file-scope static). */
|
||||
csi_internal,
|
||||
/* Modifiable object with static storage duration defined in
|
||||
function that may be an inline definition (i.e., local
|
||||
static). */
|
||||
csi_modifiable
|
||||
};
|
||||
|
||||
|
||||
/* 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 */
|
||||
struct c_spot_bindings;
|
||||
struct c_struct_parse_info;
|
||||
extern struct obstack parser_obstack;
|
||||
extern tree c_break_label;
|
||||
extern tree c_cont_label;
|
||||
|
||||
extern bool global_bindings_p (void);
|
||||
extern void push_scope (void);
|
||||
extern tree pop_scope (void);
|
||||
extern void c_bindings_start_stmt_expr (struct c_spot_bindings *);
|
||||
extern void c_bindings_end_stmt_expr (struct c_spot_bindings *);
|
||||
|
||||
extern void record_inline_static (location_t, tree, tree,
|
||||
enum c_inline_static_type);
|
||||
extern void c_init_decl_processing (void);
|
||||
extern void c_print_identifier (FILE *, tree, int);
|
||||
extern int quals_from_declspecs (const struct c_declspecs *);
|
||||
extern struct c_declarator *build_array_declarator (location_t, tree,
|
||||
struct c_declspecs *,
|
||||
bool, bool);
|
||||
extern tree build_enumerator (location_t, location_t, struct c_enum_contents *,
|
||||
tree, tree);
|
||||
extern tree check_for_loop_decls (location_t, bool);
|
||||
extern void mark_forward_parm_decls (void);
|
||||
extern void declare_parm_level (void);
|
||||
extern void undeclared_variable (location_t, tree);
|
||||
extern tree lookup_label_for_goto (location_t, tree);
|
||||
extern tree declare_label (tree);
|
||||
extern tree define_label (location_t, tree);
|
||||
extern struct c_spot_bindings *c_get_switch_bindings (void);
|
||||
extern void c_release_switch_bindings (struct c_spot_bindings *);
|
||||
extern bool c_check_switch_jump_warnings (struct c_spot_bindings *,
|
||||
location_t, location_t);
|
||||
extern void finish_decl (tree, location_t, tree, tree, tree);
|
||||
extern tree finish_enum (tree, tree, tree);
|
||||
extern void finish_function (void);
|
||||
extern tree finish_struct (location_t, tree, tree, tree,
|
||||
struct c_struct_parse_info *);
|
||||
extern struct c_arg_info *build_arg_info (void);
|
||||
extern struct c_arg_info *get_parm_info (bool, tree);
|
||||
extern tree grokfield (location_t, struct c_declarator *,
|
||||
struct c_declspecs *, tree, tree *);
|
||||
extern tree groktypename (struct c_type_name *, tree *, bool *);
|
||||
extern tree grokparm (const struct c_parm *, tree *);
|
||||
extern tree implicitly_declare (location_t, tree);
|
||||
extern void keep_next_level (void);
|
||||
extern void pending_xref_error (void);
|
||||
extern void c_push_function_context (void);
|
||||
extern void c_pop_function_context (void);
|
||||
extern void push_parm_decl (const struct c_parm *, tree *);
|
||||
extern struct c_declarator *set_array_declarator_inner (struct c_declarator *,
|
||||
struct c_declarator *);
|
||||
extern tree c_builtin_function (tree);
|
||||
extern tree c_builtin_function_ext_scope (tree);
|
||||
extern void shadow_tag (const struct c_declspecs *);
|
||||
extern void shadow_tag_warned (const struct c_declspecs *, int);
|
||||
extern tree start_enum (location_t, struct c_enum_contents *, 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 (location_t, enum tree_code, tree,
|
||||
struct c_struct_parse_info **);
|
||||
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 (location_t, enum tree_code, 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 *);
|
||||
extern struct c_declspecs *build_null_declspecs (void);
|
||||
extern struct c_declspecs *declspecs_add_qual (source_location,
|
||||
struct c_declspecs *, tree);
|
||||
extern struct c_declspecs *declspecs_add_type (location_t,
|
||||
struct c_declspecs *,
|
||||
struct c_typespec);
|
||||
extern struct c_declspecs *declspecs_add_scspec (source_location,
|
||||
struct c_declspecs *, tree);
|
||||
extern struct c_declspecs *declspecs_add_attrs (source_location,
|
||||
struct c_declspecs *, tree);
|
||||
extern struct c_declspecs *declspecs_add_addrspace (source_location,
|
||||
struct c_declspecs *,
|
||||
addr_space_t);
|
||||
extern struct c_declspecs *declspecs_add_alignas (source_location,
|
||||
struct c_declspecs *, tree);
|
||||
extern struct c_declspecs *finish_declspecs (struct c_declspecs *);
|
||||
|
||||
/* in c-objc-common.c */
|
||||
extern bool c_objc_common_init (void);
|
||||
extern bool c_missing_noreturn_ok_p (tree);
|
||||
extern bool c_warn_unused_global_decl (const_tree);
|
||||
extern void c_initialize_diagnostics (diagnostic_context *);
|
||||
extern bool c_vla_unspec_p (tree x, tree fn);
|
||||
|
||||
/* in c-typeck.c */
|
||||
extern int in_alignof;
|
||||
extern int in_sizeof;
|
||||
extern int in_typeof;
|
||||
|
||||
extern tree c_last_sizeof_arg;
|
||||
|
||||
extern struct c_switch *c_switch_stack;
|
||||
|
||||
extern tree c_objc_common_truthvalue_conversion (location_t, tree);
|
||||
extern tree require_complete_type (tree);
|
||||
extern int same_translation_unit_p (const_tree, const_tree);
|
||||
extern int comptypes (tree, tree);
|
||||
extern int comptypes_check_different_types (tree, tree, bool *);
|
||||
extern bool c_vla_type_p (const_tree);
|
||||
extern bool c_mark_addressable (tree);
|
||||
extern void c_incomplete_type_error (const_tree, const_tree);
|
||||
extern tree c_type_promotes_to (tree);
|
||||
extern struct c_expr default_function_array_conversion (location_t,
|
||||
struct c_expr);
|
||||
extern struct c_expr default_function_array_read_conversion (location_t,
|
||||
struct c_expr);
|
||||
extern void mark_exp_read (tree);
|
||||
extern tree composite_type (tree, tree);
|
||||
extern tree build_component_ref (location_t, tree, tree);
|
||||
extern tree build_array_ref (location_t, tree, tree);
|
||||
extern tree build_external_ref (location_t, tree, int, tree *);
|
||||
extern void pop_maybe_used (bool);
|
||||
extern struct c_expr c_expr_sizeof_expr (location_t, struct c_expr);
|
||||
extern struct c_expr c_expr_sizeof_type (location_t, struct c_type_name *);
|
||||
extern struct c_expr parser_build_unary_op (location_t, enum tree_code,
|
||||
struct c_expr);
|
||||
extern struct c_expr parser_build_binary_op (location_t,
|
||||
enum tree_code, struct c_expr,
|
||||
struct c_expr);
|
||||
extern tree build_conditional_expr (location_t, tree, bool, tree, tree,
|
||||
tree, tree);
|
||||
extern tree build_compound_expr (location_t, tree, tree);
|
||||
extern tree c_cast_expr (location_t, struct c_type_name *, tree);
|
||||
extern tree build_c_cast (location_t, tree, tree);
|
||||
extern void store_init_value (location_t, tree, tree, tree);
|
||||
extern void error_init (const char *);
|
||||
extern void pedwarn_init (location_t, int opt, 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, struct obstack *);
|
||||
extern struct c_expr pop_init_level (int, struct obstack *);
|
||||
extern void set_init_index (tree, tree, struct obstack *);
|
||||
extern void set_init_label (tree, struct obstack *);
|
||||
extern void process_init_element (struct c_expr, bool, struct obstack *);
|
||||
extern tree build_compound_literal (location_t, tree, tree, bool);
|
||||
extern void check_compound_literal_type (location_t, struct c_type_name *);
|
||||
extern tree c_start_case (location_t, location_t, tree);
|
||||
extern void c_finish_case (tree);
|
||||
extern tree build_asm_expr (location_t, tree, tree, tree, tree, tree, bool);
|
||||
extern tree build_asm_stmt (tree, tree);
|
||||
extern int c_types_compatible_p (tree, tree);
|
||||
extern tree c_begin_compound_stmt (bool);
|
||||
extern tree c_end_compound_stmt (location_t, tree, bool);
|
||||
extern void c_finish_if_stmt (location_t, tree, tree, tree, bool);
|
||||
extern void c_finish_loop (location_t, tree, tree, tree, tree, tree, bool);
|
||||
extern tree c_begin_stmt_expr (void);
|
||||
extern tree c_finish_stmt_expr (location_t, tree);
|
||||
extern tree c_process_expr_stmt (location_t, tree);
|
||||
extern tree c_finish_expr_stmt (location_t, tree);
|
||||
extern tree c_finish_return (location_t, tree, tree);
|
||||
extern tree c_finish_bc_stmt (location_t, tree *, bool);
|
||||
extern tree c_finish_goto_label (location_t, tree);
|
||||
extern tree c_finish_goto_ptr (location_t, tree);
|
||||
extern tree c_expr_to_decl (tree, bool *, bool *);
|
||||
extern tree c_begin_omp_parallel (void);
|
||||
extern tree c_finish_omp_parallel (location_t, tree, tree);
|
||||
extern tree c_begin_omp_task (void);
|
||||
extern tree c_finish_omp_task (location_t, tree, tree);
|
||||
extern tree c_finish_omp_clauses (tree);
|
||||
extern tree c_build_va_arg (location_t, tree, tree);
|
||||
extern tree c_finish_transaction (location_t, tree, int);
|
||||
|
||||
/* 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;
|
||||
|
||||
/* Mode used to build pointers (VOIDmode means ptr_mode). */
|
||||
|
||||
extern enum machine_mode c_default_pointer_mode;
|
||||
|
||||
/* In c-decl.c */
|
||||
extern void c_finish_incomplete_decl (tree);
|
||||
extern void c_write_global_declarations (void);
|
||||
|
||||
/* In c-errors.c */
|
||||
extern void pedwarn_c90 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_DIAG(3,4);
|
||||
extern void pedwarn_c99 (location_t, int opt, const char *, ...) ATTRIBUTE_GCC_DIAG(3,4);
|
||||
|
||||
#endif /* ! GCC_C_TREE_H */
|
||||
|
|
@ -0,0 +1,186 @@
|
|||
/* Flags on basic blocks and edges.
|
||||
Copyright (C) 2012-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This file defines flags that may appear on basic blocks or on
|
||||
edges. Source files define DEF_BASIC_BLOCK_FLAG or DEF_EDGE_FLAG
|
||||
appropriately before including this file. */
|
||||
|
||||
#if !defined(DEF_BASIC_BLOCK_FLAG) && !defined(DEF_EDGE_FLAG)
|
||||
#error "You must define DEF_BASIC_BLOCK_FLAG or DEF_EDGE_FLAG"
|
||||
#endif
|
||||
|
||||
#ifdef DEF_BASIC_BLOCK_FLAG
|
||||
|
||||
/* Masks for basic_block.flags.
|
||||
|
||||
The format of this file is: DEF_BASIC_BLOCK_FLAG(NAME, IDX).
|
||||
NAME is the name of the basic block flag. A flag BB_#NAME will be
|
||||
created and the name is used in dump_edge_info.
|
||||
IDX is a sequence number that is used to determine the value
|
||||
of the flag, which is 1 << IDX).
|
||||
|
||||
BB_HOT_PARTITION and BB_COLD_PARTITION should be preserved throughout
|
||||
the compilation, so they are never cleared.
|
||||
|
||||
All other flags may be cleared by clear_bb_flags(). It is generally
|
||||
a bad idea to rely on any flags being up-to-date. */
|
||||
|
||||
/* Only set on blocks that have just been created by create_bb. */
|
||||
DEF_BASIC_BLOCK_FLAG(NEW, 0)
|
||||
|
||||
/* Set by find_unreachable_blocks. Do not rely on this being set in any
|
||||
pass. */
|
||||
DEF_BASIC_BLOCK_FLAG(REACHABLE, 1)
|
||||
|
||||
/* Set for blocks in an irreducible loop by loop analysis. */
|
||||
DEF_BASIC_BLOCK_FLAG(IRREDUCIBLE_LOOP, 2)
|
||||
|
||||
/* Set on blocks that may actually not be single-entry single-exit block. */
|
||||
DEF_BASIC_BLOCK_FLAG(SUPERBLOCK, 3)
|
||||
|
||||
/* Set on basic blocks that the scheduler should not touch. This is used
|
||||
by SMS to prevent other schedulers from messing with the loop schedule. */
|
||||
DEF_BASIC_BLOCK_FLAG(DISABLE_SCHEDULE, 4)
|
||||
|
||||
/* Set on blocks that should be put in a hot section. */
|
||||
DEF_BASIC_BLOCK_FLAG(HOT_PARTITION, 5)
|
||||
|
||||
/* Set on blocks that should be put in a cold section. */
|
||||
DEF_BASIC_BLOCK_FLAG(COLD_PARTITION, 6)
|
||||
|
||||
/* Set on block that was duplicated. */
|
||||
DEF_BASIC_BLOCK_FLAG(DUPLICATED, 7)
|
||||
|
||||
/* Set if the label at the top of this block is the target of a non-local goto. */
|
||||
DEF_BASIC_BLOCK_FLAG(NON_LOCAL_GOTO_TARGET, 8)
|
||||
|
||||
/* Set on blocks that are in RTL format. */
|
||||
DEF_BASIC_BLOCK_FLAG(RTL, 9)
|
||||
|
||||
/* Set on blocks that are forwarder blocks.
|
||||
Only used in cfgcleanup.c. */
|
||||
DEF_BASIC_BLOCK_FLAG(FORWARDER_BLOCK, 10)
|
||||
|
||||
/* Set on blocks that cannot be threaded through.
|
||||
Only used in cfgcleanup.c. */
|
||||
DEF_BASIC_BLOCK_FLAG(NONTHREADABLE_BLOCK, 11)
|
||||
|
||||
/* Set on blocks that were modified in some way. This bit is set in
|
||||
df_set_bb_dirty, but not cleared by df_analyze, so it can be used
|
||||
to test whether a block has been modified prior to a df_analyze call. */
|
||||
DEF_BASIC_BLOCK_FLAG(MODIFIED, 12)
|
||||
|
||||
/* A general visited flag for passes to use. */
|
||||
DEF_BASIC_BLOCK_FLAG(VISITED, 13)
|
||||
|
||||
/* Set on blocks that are in a transaction. This is calculated on
|
||||
demand, and is available after calling compute_transaction_bits(). */
|
||||
DEF_BASIC_BLOCK_FLAG(IN_TRANSACTION, 14)
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef DEF_EDGE_FLAG
|
||||
|
||||
/* Masks for edge.flags.
|
||||
|
||||
The format of this file is: DEF_EDGE_FLAG(NAME, IDX, STRING).
|
||||
NAME is the name of the edge flag. A flag EDGE_#NAME will be
|
||||
created and the name is used in dump_edge_info.
|
||||
IDX is a sequence number that is used to determine the value
|
||||
of the flag, which is 1 << IDX). */
|
||||
|
||||
/* 'Straight line' flow. In GIMPLE and in cfglayout mode, all normal
|
||||
edges are fallthru edges. In cfgrtl mode, this flag really means
|
||||
that control flow falls through to the next basic block in the line. */
|
||||
DEF_EDGE_FLAG(FALLTHRU, 0)
|
||||
|
||||
/* Strange flow, like a computed jump or exception handling. Usually
|
||||
this means that the edge cannot be split. */
|
||||
DEF_EDGE_FLAG(ABNORMAL, 1)
|
||||
|
||||
/* Edge out of a basic block that ends with a CALL_INSN with abnormal
|
||||
exit, like an exception or a non-local goto.
|
||||
ABNORMAL_CALL edges also have ABNORMAL set.
|
||||
This flag is only used for the RTL CFG. */
|
||||
DEF_EDGE_FLAG(ABNORMAL_CALL, 2)
|
||||
|
||||
/* Exception edge. Exception handling edges represent possible control
|
||||
transfers from a trapping instruction to an exception handler.
|
||||
EH edges also have ABNORMAL set for the RTL CFG. */
|
||||
DEF_EDGE_FLAG(EH, 3)
|
||||
|
||||
/* Never merge blocks via this edge. This is used for exception handling,
|
||||
to prevent merging away edges to the post-landing-pad basic block.
|
||||
This flag is only used for the RTL CFG. */
|
||||
DEF_EDGE_FLAG(PRESERVE, 4)
|
||||
|
||||
/* Not a real edge. This is used to connect parts of the CFG that do
|
||||
not halt, such as infinite loops and noreturn functions, to the
|
||||
EXIT_BLOCK, so that traversing of the reverse CFG is possible. */
|
||||
DEF_EDGE_FLAG(FAKE, 5)
|
||||
|
||||
/* A back edge, marked in a depth-first search of the CFG. Back edges
|
||||
are hints that this edge may be part of a loop in the CFG. */
|
||||
DEF_EDGE_FLAG(DFS_BACK, 6)
|
||||
|
||||
/* Edge in a part of the CFG that is an irreducible loop. */
|
||||
DEF_EDGE_FLAG(IRREDUCIBLE_LOOP, 7)
|
||||
|
||||
/* Edge taken when controlling predicate is nonzero.
|
||||
This is only used for the GIMPLE CFG. */
|
||||
DEF_EDGE_FLAG(TRUE_VALUE, 8)
|
||||
|
||||
/* Edge taken when controlling predicate is zero.
|
||||
This is only used for the GIMPLE CFG. */
|
||||
DEF_EDGE_FLAG(FALSE_VALUE, 9)
|
||||
|
||||
/* Edge is executable. This is only used in GIMPLE SSA-CCP and VRP.
|
||||
This is only used for the GIMPLE CFG. */
|
||||
DEF_EDGE_FLAG(EXECUTABLE, 10)
|
||||
|
||||
/* Edge crosses between hot and cold sections, when we do partitioning.
|
||||
This flag is only used for the RTL CFG. */
|
||||
DEF_EDGE_FLAG(CROSSING, 11)
|
||||
|
||||
/* Edge from a sibcall CALL_INSN to exit.
|
||||
SIBCALL edges also have ABNORMAL set.
|
||||
This flag is only used for the RTL CFG. */
|
||||
DEF_EDGE_FLAG(SIBCALL, 12)
|
||||
|
||||
/* Candidate for straight line flow. Only used in bb-reorder.c.
|
||||
This flag is only used for the RTL CFG. */
|
||||
DEF_EDGE_FLAG(CAN_FALLTHRU, 13)
|
||||
|
||||
/* Exit of a loop. This is only used in ifcvt.c.
|
||||
This flag is only used for the RTL CFG. */
|
||||
DEF_EDGE_FLAG(LOOP_EXIT, 14)
|
||||
|
||||
/* Uninstrumented edge out of a GIMPLE_TRANSACTION statement. */
|
||||
DEF_EDGE_FLAG(TM_UNINSTRUMENTED, 15)
|
||||
|
||||
/* Abort (over) edge out of a GIMPLE_TRANSACTION statement. */
|
||||
DEF_EDGE_FLAG(TM_ABORT, 16)
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
Local variables:
|
||||
mode:c
|
||||
End:
|
||||
*/
|
||||
|
|
@ -0,0 +1,223 @@
|
|||
/* Hooks for cfg representation specific functions.
|
||||
Copyright (C) 2003-2013 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Only basic-block.h includes this. */
|
||||
|
||||
struct cfg_hooks
|
||||
{
|
||||
/* Name of the corresponding ir. */
|
||||
const char *name;
|
||||
|
||||
/* Debugging. */
|
||||
int (*verify_flow_info) (void);
|
||||
void (*dump_bb) (FILE *, basic_block, int, int);
|
||||
void (*dump_bb_for_graph) (pretty_printer *, basic_block);
|
||||
|
||||
/* 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);
|
||||
|
||||
/* Returns true if it is possible to remove the edge by redirecting it
|
||||
to the destination of the other edge going from its source. */
|
||||
bool (*can_remove_branch_p) (const_edge);
|
||||
|
||||
/* 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) (const_basic_block bb, enum br_predictor predictor);
|
||||
|
||||
/* Return true when block A can be duplicated. */
|
||||
bool (*can_duplicate_block_p) (const_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);
|
||||
|
||||
/* Try to make the edge fallthru. */
|
||||
void (*tidy_fallthru_edge) (edge);
|
||||
|
||||
/* Make the edge non-fallthru. */
|
||||
basic_block (*force_nonfallthru) (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) (const_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 *, edge,
|
||||
unsigned, sbitmap,
|
||||
edge, vec<edge> *,
|
||||
int);
|
||||
|
||||
/* 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);
|
||||
|
||||
/* True if a block contains no executable instructions. */
|
||||
bool (*empty_block_p) (basic_block);
|
||||
|
||||
/* Split a basic block if it ends with a conditional branch and if
|
||||
the other part of the block is not empty. */
|
||||
basic_block (*split_block_before_cond_jump) (basic_block);
|
||||
|
||||
/* Do book-keeping of a basic block for the profile consistency checker. */
|
||||
void (*account_profile_record) (basic_block, int, struct profile_record *);
|
||||
};
|
||||
|
||||
extern void verify_flow_info (void);
|
||||
extern void dump_bb (FILE *, basic_block, int, int);
|
||||
extern void dump_bb_for_graph (pretty_printer *, basic_block);
|
||||
|
||||
extern edge redirect_edge_and_branch (edge, basic_block);
|
||||
extern basic_block redirect_edge_and_branch_force (edge, basic_block);
|
||||
extern bool can_remove_branch_p (const_edge);
|
||||
extern void remove_branch (edge);
|
||||
extern void remove_edge (edge);
|
||||
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 basic_block force_nonfallthru (edge);
|
||||
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 (const_basic_block bb, enum br_predictor predictor);
|
||||
extern bool can_duplicate_block_p (const_basic_block);
|
||||
extern basic_block duplicate_block (basic_block, edge, basic_block);
|
||||
extern bool block_ends_with_call_p (basic_block bb);
|
||||
extern bool empty_block_p (basic_block);
|
||||
extern basic_block split_block_before_cond_jump (basic_block);
|
||||
extern bool block_ends_with_condjump_p (const_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,
|
||||
unsigned int ndupl,
|
||||
sbitmap wont_exit,
|
||||
edge orig,
|
||||
vec<edge> *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 *);
|
||||
|
||||
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, bool);
|
||||
|
||||
void account_profile_record (struct profile_record *, int);
|
||||
|
||||
extern void cfg_layout_initialize (unsigned int);
|
||||
extern void cfg_layout_finalize (void);
|
||||
|
||||
/* Hooks containers. */
|
||||
extern struct cfg_hooks gimple_cfg_hooks;
|
||||
extern struct cfg_hooks rtl_cfg_hooks;
|
||||
extern struct cfg_hooks cfg_layout_rtl_cfg_hooks;
|
||||
|
||||
/* Declarations. */
|
||||
extern enum ir_type current_ir_type (void);
|
||||
extern void rtl_register_cfg_hooks (void);
|
||||
extern void cfg_layout_rtl_register_cfg_hooks (void);
|
||||
extern void gimple_register_cfg_hooks (void);
|
||||
extern struct cfg_hooks get_cfg_hooks (void);
|
||||
extern void set_cfg_hooks (struct cfg_hooks);
|
||||
|
||||
|
|
@ -0,0 +1,733 @@
|
|||
/* Natural loop functions
|
||||
Copyright (C) 1987-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_CFGLOOP_H
|
||||
#define GCC_CFGLOOP_H
|
||||
|
||||
#include "basic-block.h"
|
||||
#include "double-int.h"
|
||||
|
||||
#include "bitmap.h"
|
||||
#include "sbitmap.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 GTY (()) lpt_decision {
|
||||
enum lpt_dec decision;
|
||||
unsigned times;
|
||||
};
|
||||
|
||||
/* The type of extend applied to an IV. */
|
||||
enum iv_extend_code
|
||||
{
|
||||
IV_SIGN_EXTEND,
|
||||
IV_ZERO_EXTEND,
|
||||
IV_UNKNOWN_EXTEND
|
||||
};
|
||||
|
||||
/* The structure describing a bound on number of iterations of a loop. */
|
||||
|
||||
struct GTY ((chain_next ("%h.next"))) nb_iter_bound {
|
||||
/* The statement STMT is executed at most ... */
|
||||
gimple stmt;
|
||||
|
||||
/* ... BOUND + 1 times (BOUND must be an unsigned constant).
|
||||
The + 1 is added for the following reasons:
|
||||
|
||||
a) 0 would otherwise be unused, while we would need to care more about
|
||||
overflows (as MAX + 1 is sometimes produced as the estimate on number
|
||||
of executions of STMT).
|
||||
b) it is consistent with the result of number_of_iterations_exit. */
|
||||
double_int bound;
|
||||
|
||||
/* True if the statement will cause the loop to be leaved the (at most)
|
||||
BOUND + 1-st time it is executed, that is, all the statements after it
|
||||
are executed at most BOUND times. */
|
||||
bool is_exit;
|
||||
|
||||
/* The next bound in the list. */
|
||||
struct nb_iter_bound *next;
|
||||
};
|
||||
|
||||
/* Description of the loop exit. */
|
||||
|
||||
struct GTY (()) loop_exit {
|
||||
/* The exit edge. */
|
||||
edge e;
|
||||
|
||||
/* Previous and next exit in the list of the exits of the loop. */
|
||||
struct loop_exit *prev;
|
||||
struct loop_exit *next;
|
||||
|
||||
/* Next element in the list of loops from that E exits. */
|
||||
struct loop_exit *next_e;
|
||||
};
|
||||
|
||||
typedef struct loop *loop_p;
|
||||
|
||||
/* An integer estimation of the number of iterations. Estimate_state
|
||||
describes what is the state of the estimation. */
|
||||
enum loop_estimation
|
||||
{
|
||||
/* Estimate was not computed yet. */
|
||||
EST_NOT_COMPUTED,
|
||||
/* Estimate is ready. */
|
||||
EST_AVAILABLE
|
||||
};
|
||||
|
||||
/* Structure to hold information for each natural loop. */
|
||||
struct GTY ((chain_next ("%h.next"))) loop {
|
||||
/* Index into loops array. */
|
||||
int num;
|
||||
|
||||
/* Number of loop insns. */
|
||||
unsigned ninsns;
|
||||
|
||||
/* 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;
|
||||
|
||||
/* Average number of executed insns per iteration. */
|
||||
unsigned av_ninsns;
|
||||
|
||||
/* Number of blocks contained within the loop. */
|
||||
unsigned num_nodes;
|
||||
|
||||
/* Superloops of the loop, starting with the outermost loop. */
|
||||
vec<loop_p, va_gc> *superloops;
|
||||
|
||||
/* The first inner (child) loop or NULL if innermost loop. */
|
||||
struct loop *inner;
|
||||
|
||||
/* Link to the next (sibling) loop. */
|
||||
struct loop *next;
|
||||
|
||||
/* Auxiliary info specific to a pass. */
|
||||
PTR GTY ((skip (""))) aux;
|
||||
|
||||
/* The number of times the latch of the loop is executed. This can be an
|
||||
INTEGER_CST, or a symbolic expression representing the number of
|
||||
iterations like "N - 1", or a COND_EXPR containing the runtime
|
||||
conditions under which the number of iterations is non zero.
|
||||
|
||||
Don't access this field directly: number_of_latch_executions
|
||||
computes and caches the computed information in this field. */
|
||||
tree nb_iterations;
|
||||
|
||||
/* An integer guaranteed to be greater or equal to nb_iterations. Only
|
||||
valid if any_upper_bound is true. */
|
||||
double_int nb_iterations_upper_bound;
|
||||
|
||||
/* An integer giving an estimate on nb_iterations. Unlike
|
||||
nb_iterations_upper_bound, there is no guarantee that it is at least
|
||||
nb_iterations. */
|
||||
double_int nb_iterations_estimate;
|
||||
|
||||
bool any_upper_bound;
|
||||
bool any_estimate;
|
||||
|
||||
/* True if the loop can be parallel. */
|
||||
bool can_be_parallel;
|
||||
|
||||
/* True if -Waggressive-loop-optimizations warned about this loop
|
||||
already. */
|
||||
bool warned_aggressive_loop_optimizations;
|
||||
|
||||
/* An integer estimation of the number of iterations. Estimate_state
|
||||
describes what is the state of the estimation. */
|
||||
enum loop_estimation estimate_state;
|
||||
|
||||
/* Upper bound on number of iterations of a loop. */
|
||||
struct nb_iter_bound *bounds;
|
||||
|
||||
/* Head of the cyclic list of the exits of the loop. */
|
||||
struct loop_exit *exits;
|
||||
};
|
||||
|
||||
/* Flags for state of loop structure. */
|
||||
enum
|
||||
{
|
||||
LOOPS_HAVE_PREHEADERS = 1,
|
||||
LOOPS_HAVE_SIMPLE_LATCHES = 2,
|
||||
LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS = 4,
|
||||
LOOPS_HAVE_RECORDED_EXITS = 8,
|
||||
LOOPS_MAY_HAVE_MULTIPLE_LATCHES = 16,
|
||||
LOOP_CLOSED_SSA = 32,
|
||||
LOOPS_NEED_FIXUP = 64,
|
||||
LOOPS_HAVE_FALLTHRU_PREHEADERS = 128
|
||||
};
|
||||
|
||||
#define LOOPS_NORMAL (LOOPS_HAVE_PREHEADERS | LOOPS_HAVE_SIMPLE_LATCHES \
|
||||
| LOOPS_HAVE_MARKED_IRREDUCIBLE_REGIONS)
|
||||
#define AVOID_CFG_MODIFICATIONS (LOOPS_MAY_HAVE_MULTIPLE_LATCHES)
|
||||
|
||||
/* Structure to hold CFG information about natural loops within a function. */
|
||||
struct GTY (()) loops {
|
||||
/* State of loops. */
|
||||
int state;
|
||||
|
||||
/* Array of the loops. */
|
||||
vec<loop_p, va_gc> *larray;
|
||||
|
||||
/* Maps edges to the list of their descriptions as loop exits. Edges
|
||||
whose sources or destinations have loop_father == NULL (which may
|
||||
happen during the cfg manipulations) should not appear in EXITS. */
|
||||
htab_t GTY((param_is (struct loop_exit))) exits;
|
||||
|
||||
/* Pointer to root of loop hierarchy tree. */
|
||||
struct loop *tree_root;
|
||||
};
|
||||
|
||||
/* Loop recognition. */
|
||||
bool bb_loop_header_p (basic_block);
|
||||
extern struct loops *flow_loops_find (struct loops *);
|
||||
extern void disambiguate_loops_with_multiple_latches (void);
|
||||
extern void flow_loops_free (struct loops *);
|
||||
extern void flow_loops_dump (FILE *,
|
||||
void (*)(const struct loop *, FILE *, int), int);
|
||||
extern void flow_loop_dump (const struct loop *, FILE *,
|
||||
void (*)(const struct loop *, FILE *, int), int);
|
||||
struct loop *alloc_loop (void);
|
||||
extern void flow_loop_free (struct loop *);
|
||||
int flow_loop_nodes_find (basic_block, struct loop *);
|
||||
unsigned fix_loop_structure (bitmap changed_bbs);
|
||||
bool mark_irreducible_loops (void);
|
||||
void release_recorded_exits (void);
|
||||
void record_loop_exits (void);
|
||||
void rescan_loop_exit (edge, bool, bool);
|
||||
|
||||
/* 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 void add_loop (struct loop *, 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);
|
||||
struct eni_weights_d;
|
||||
extern unsigned tree_num_loop_insns (struct loop *, struct eni_weights_d *);
|
||||
extern int num_loop_insns (const struct loop *);
|
||||
extern int average_num_loop_insns (const struct loop *);
|
||||
extern unsigned get_loop_level (const struct loop *);
|
||||
extern bool loop_exit_edge_p (const struct loop *, const_edge);
|
||||
extern bool loop_exits_to_bb_p (struct loop *, basic_block);
|
||||
extern bool loop_exits_from_bb_p (struct loop *, basic_block);
|
||||
extern void mark_loop_exit_edges (void);
|
||||
extern location_t get_loop_location (struct loop *loop);
|
||||
|
||||
/* Loops & cfg manipulation. */
|
||||
extern basic_block *get_loop_body (const struct loop *);
|
||||
extern unsigned get_loop_body_with_size (const struct loop *, basic_block *,
|
||||
unsigned);
|
||||
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 basic_block *get_loop_body_in_custom_order (const struct loop *,
|
||||
int (*) (const void *, const void *));
|
||||
|
||||
extern vec<edge> get_loop_exit_edges (const struct loop *);
|
||||
extern edge single_exit (const struct loop *);
|
||||
extern edge single_likely_exit (struct loop *loop);
|
||||
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 loop *);
|
||||
extern void delete_loop (struct loop *);
|
||||
|
||||
enum
|
||||
{
|
||||
CP_SIMPLE_PREHEADERS = 1,
|
||||
CP_FALLTHRU_PREHEADERS = 2
|
||||
};
|
||||
|
||||
basic_block create_preheader (struct loop *, int);
|
||||
extern void create_preheaders (int);
|
||||
extern void force_single_succ_latches (void);
|
||||
|
||||
extern void verify_loop_structure (void);
|
||||
|
||||
/* Loop analysis. */
|
||||
extern bool just_once_each_iteration_p (const struct loop *, const_basic_block);
|
||||
gcov_type expected_loop_iterations_unbounded (const struct loop *);
|
||||
extern unsigned expected_loop_iterations (const struct loop *);
|
||||
extern rtx doloop_condition_get (rtx);
|
||||
|
||||
void estimate_numbers_of_iterations_loop (struct loop *);
|
||||
void record_niter_bound (struct loop *, double_int, bool, bool);
|
||||
bool estimated_loop_iterations (struct loop *, double_int *);
|
||||
bool max_loop_iterations (struct loop *, double_int *);
|
||||
HOST_WIDE_INT estimated_loop_iterations_int (struct loop *);
|
||||
HOST_WIDE_INT max_loop_iterations_int (struct loop *);
|
||||
bool max_stmt_executions (struct loop *, double_int *);
|
||||
bool estimated_stmt_executions (struct loop *, double_int *);
|
||||
HOST_WIDE_INT max_stmt_executions_int (struct loop *);
|
||||
HOST_WIDE_INT estimated_stmt_executions_int (struct loop *);
|
||||
|
||||
/* Loop manipulation. */
|
||||
extern bool can_duplicate_loop_p (const 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 edge create_empty_if_region_on_edge (edge, tree);
|
||||
extern struct loop *create_empty_loop_on_edge (edge, tree, tree, tree, tree,
|
||||
tree *, tree *, struct loop *);
|
||||
extern struct loop * duplicate_loop (struct loop *, struct loop *);
|
||||
extern void copy_loop_info (struct loop *loop, struct loop *target);
|
||||
extern void duplicate_subloops (struct loop *, struct loop *);
|
||||
extern bool duplicate_loop_to_header_edge (struct loop *, edge,
|
||||
unsigned, sbitmap, edge,
|
||||
vec<edge> *, int);
|
||||
extern struct loop *loopify (edge, edge,
|
||||
basic_block, edge, edge, bool,
|
||||
unsigned, unsigned);
|
||||
struct loop * loop_version (struct loop *, void *,
|
||||
basic_block *, unsigned, unsigned, unsigned, bool);
|
||||
extern bool remove_path (edge);
|
||||
extern void unloop (struct loop *, bool *, bitmap);
|
||||
extern void scale_loop_frequencies (struct loop *, int, int);
|
||||
|
||||
/* 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 (IV_SIGN_EXTEND, IV_ZERO_EXTEND,
|
||||
or IV_UNKNOWN_EXTEND). */
|
||||
enum iv_extend_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;
|
||||
|
||||
/* 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 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;
|
||||
}
|
||||
|
||||
/* Accessors for the loop structures. */
|
||||
|
||||
/* Returns the loop with index NUM from current_loops. */
|
||||
|
||||
static inline struct loop *
|
||||
get_loop (unsigned num)
|
||||
{
|
||||
return (*current_loops->larray)[num];
|
||||
}
|
||||
|
||||
/* Returns the number of superloops of LOOP. */
|
||||
|
||||
static inline unsigned
|
||||
loop_depth (const struct loop *loop)
|
||||
{
|
||||
return vec_safe_length (loop->superloops);
|
||||
}
|
||||
|
||||
/* Returns the loop depth of the loop BB belongs to. */
|
||||
|
||||
static inline int
|
||||
bb_loop_depth (const_basic_block bb)
|
||||
{
|
||||
return bb->loop_father ? loop_depth (bb->loop_father) : 0;
|
||||
}
|
||||
|
||||
/* Returns the immediate superloop of LOOP, or NULL if LOOP is the outermost
|
||||
loop. */
|
||||
|
||||
static inline struct loop *
|
||||
loop_outer (const struct loop *loop)
|
||||
{
|
||||
unsigned n = vec_safe_length (loop->superloops);
|
||||
|
||||
if (n == 0)
|
||||
return NULL;
|
||||
|
||||
return (*loop->superloops)[n - 1];
|
||||
}
|
||||
|
||||
/* Returns true if LOOP has at least one exit edge. */
|
||||
|
||||
static inline bool
|
||||
loop_has_exit_edges (const struct loop *loop)
|
||||
{
|
||||
return loop->exits->next->e != NULL;
|
||||
}
|
||||
|
||||
/* Returns the list of loops in current_loops. */
|
||||
|
||||
static inline vec<loop_p, va_gc> *
|
||||
get_loops (void)
|
||||
{
|
||||
if (!current_loops)
|
||||
return NULL;
|
||||
|
||||
return current_loops->larray;
|
||||
}
|
||||
|
||||
/* Returns the number of loops in current_loops (including the removed
|
||||
ones and the fake loop that forms the root of the loop tree). */
|
||||
|
||||
static inline unsigned
|
||||
number_of_loops (void)
|
||||
{
|
||||
if (!current_loops)
|
||||
return 0;
|
||||
|
||||
return vec_safe_length (current_loops->larray);
|
||||
}
|
||||
|
||||
/* Returns true if state of the loops satisfies all properties
|
||||
described by FLAGS. */
|
||||
|
||||
static inline bool
|
||||
loops_state_satisfies_p (unsigned flags)
|
||||
{
|
||||
return (current_loops->state & flags) == flags;
|
||||
}
|
||||
|
||||
/* Sets FLAGS to the loops state. */
|
||||
|
||||
static inline void
|
||||
loops_state_set (unsigned flags)
|
||||
{
|
||||
current_loops->state |= flags;
|
||||
}
|
||||
|
||||
/* Clears FLAGS from the loops state. */
|
||||
|
||||
static inline void
|
||||
loops_state_clear (unsigned flags)
|
||||
{
|
||||
if (!current_loops)
|
||||
return;
|
||||
current_loops->state &= ~flags;
|
||||
}
|
||||
|
||||
/* Loop iterators. */
|
||||
|
||||
/* Flags for loop iteration. */
|
||||
|
||||
enum li_flags
|
||||
{
|
||||
LI_INCLUDE_ROOT = 1, /* Include the fake root of the loop tree. */
|
||||
LI_FROM_INNERMOST = 2, /* Iterate over the loops in the reverse order,
|
||||
starting from innermost ones. */
|
||||
LI_ONLY_INNERMOST = 4 /* Iterate only over innermost loops. */
|
||||
};
|
||||
|
||||
/* The iterator for loops. */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* The list of loops to visit. */
|
||||
vec<int> to_visit;
|
||||
|
||||
/* The index of the actual loop. */
|
||||
unsigned idx;
|
||||
} loop_iterator;
|
||||
|
||||
static inline void
|
||||
fel_next (loop_iterator *li, loop_p *loop)
|
||||
{
|
||||
int anum;
|
||||
|
||||
while (li->to_visit.iterate (li->idx, &anum))
|
||||
{
|
||||
li->idx++;
|
||||
*loop = get_loop (anum);
|
||||
if (*loop)
|
||||
return;
|
||||
}
|
||||
|
||||
li->to_visit.release ();
|
||||
*loop = NULL;
|
||||
}
|
||||
|
||||
static inline void
|
||||
fel_init (loop_iterator *li, loop_p *loop, unsigned flags)
|
||||
{
|
||||
struct loop *aloop;
|
||||
unsigned i;
|
||||
int mn;
|
||||
|
||||
li->idx = 0;
|
||||
if (!current_loops)
|
||||
{
|
||||
li->to_visit.create (0);
|
||||
*loop = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
li->to_visit.create (number_of_loops ());
|
||||
mn = (flags & LI_INCLUDE_ROOT) ? 0 : 1;
|
||||
|
||||
if (flags & LI_ONLY_INNERMOST)
|
||||
{
|
||||
for (i = 0; vec_safe_iterate (current_loops->larray, i, &aloop); i++)
|
||||
if (aloop != NULL
|
||||
&& aloop->inner == NULL
|
||||
&& aloop->num >= mn)
|
||||
li->to_visit.quick_push (aloop->num);
|
||||
}
|
||||
else if (flags & LI_FROM_INNERMOST)
|
||||
{
|
||||
/* Push the loops to LI->TO_VISIT in postorder. */
|
||||
for (aloop = current_loops->tree_root;
|
||||
aloop->inner != NULL;
|
||||
aloop = aloop->inner)
|
||||
continue;
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (aloop->num >= mn)
|
||||
li->to_visit.quick_push (aloop->num);
|
||||
|
||||
if (aloop->next)
|
||||
{
|
||||
for (aloop = aloop->next;
|
||||
aloop->inner != NULL;
|
||||
aloop = aloop->inner)
|
||||
continue;
|
||||
}
|
||||
else if (!loop_outer (aloop))
|
||||
break;
|
||||
else
|
||||
aloop = loop_outer (aloop);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Push the loops to LI->TO_VISIT in preorder. */
|
||||
aloop = current_loops->tree_root;
|
||||
while (1)
|
||||
{
|
||||
if (aloop->num >= mn)
|
||||
li->to_visit.quick_push (aloop->num);
|
||||
|
||||
if (aloop->inner != NULL)
|
||||
aloop = aloop->inner;
|
||||
else
|
||||
{
|
||||
while (aloop != NULL && aloop->next == NULL)
|
||||
aloop = loop_outer (aloop);
|
||||
if (aloop == NULL)
|
||||
break;
|
||||
aloop = aloop->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fel_next (li, loop);
|
||||
}
|
||||
|
||||
#define FOR_EACH_LOOP(LI, LOOP, FLAGS) \
|
||||
for (fel_init (&(LI), &(LOOP), FLAGS); \
|
||||
(LOOP); \
|
||||
fel_next (&(LI), &(LOOP)))
|
||||
|
||||
#define FOR_EACH_LOOP_BREAK(LI) \
|
||||
{ \
|
||||
(LI).to_visit.release (); \
|
||||
break; \
|
||||
}
|
||||
|
||||
/* The properties of the target. */
|
||||
struct target_cfgloop {
|
||||
/* Number of available registers. */
|
||||
unsigned x_target_avail_regs;
|
||||
|
||||
/* Number of available registers that are call-clobbered. */
|
||||
unsigned x_target_clobbered_regs;
|
||||
|
||||
/* Number of registers reserved for temporary expressions. */
|
||||
unsigned x_target_res_regs;
|
||||
|
||||
/* The cost for register when there still is some reserve, but we are
|
||||
approaching the number of available registers. */
|
||||
unsigned x_target_reg_cost[2];
|
||||
|
||||
/* The cost for register when we need to spill. */
|
||||
unsigned x_target_spill_cost[2];
|
||||
};
|
||||
|
||||
extern struct target_cfgloop default_target_cfgloop;
|
||||
#if SWITCHABLE_TARGET
|
||||
extern struct target_cfgloop *this_target_cfgloop;
|
||||
#else
|
||||
#define this_target_cfgloop (&default_target_cfgloop)
|
||||
#endif
|
||||
|
||||
#define target_avail_regs \
|
||||
(this_target_cfgloop->x_target_avail_regs)
|
||||
#define target_clobbered_regs \
|
||||
(this_target_cfgloop->x_target_clobbered_regs)
|
||||
#define target_res_regs \
|
||||
(this_target_cfgloop->x_target_res_regs)
|
||||
#define target_reg_cost \
|
||||
(this_target_cfgloop->x_target_reg_cost)
|
||||
#define target_spill_cost \
|
||||
(this_target_cfgloop->x_target_spill_cost)
|
||||
|
||||
/* Register pressure estimation for induction variable optimizations & loop
|
||||
invariant motion. */
|
||||
extern unsigned estimate_reg_pressure_cost (unsigned, unsigned, bool, bool);
|
||||
extern void init_set_costs (void);
|
||||
|
||||
/* Loop optimizer initialization. */
|
||||
extern void loop_optimizer_init (unsigned);
|
||||
extern void loop_optimizer_finalize (void);
|
||||
|
||||
/* Optimization passes. */
|
||||
extern void unswitch_loops (void);
|
||||
|
||||
enum
|
||||
{
|
||||
UAP_PEEL = 1, /* Enables loop peeling. */
|
||||
UAP_UNROLL = 2, /* Enables unrolling of loops if it seems profitable. */
|
||||
UAP_UNROLL_ALL = 4 /* Enables unrolling of all loops. */
|
||||
};
|
||||
|
||||
extern void unroll_and_peel_loops (int);
|
||||
extern void doloop_optimize_loops (void);
|
||||
extern void move_loop_invariants (void);
|
||||
extern bool finite_loop_p (struct loop *);
|
||||
extern void scale_loop_profile (struct loop *loop, int scale, gcov_type iteration_bound);
|
||||
extern vec<basic_block> get_loop_hot_path (const struct loop *loop);
|
||||
|
||||
/* Returns the outermost loop of the loop nest that contains LOOP.*/
|
||||
static inline struct loop *
|
||||
loop_outermost (struct loop *loop)
|
||||
{
|
||||
unsigned n = vec_safe_length (loop->superloops);
|
||||
|
||||
if (n <= 1)
|
||||
return loop;
|
||||
|
||||
return (*loop->superloops)[1];
|
||||
}
|
||||
|
||||
|
||||
#endif /* GCC_CFGLOOP_H */
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,105 @@
|
|||
/* This file contains the definitions of the cgraph_inline_failed_t
|
||||
enums used in GCC.
|
||||
|
||||
Copyright (C) 2008-2013 Free Software Foundation, Inc.
|
||||
Contributed by Doug Kwan <dougkwan@google.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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* The format of this file is
|
||||
DEFCIFCODE(code, string).
|
||||
|
||||
Where symbol is the enumeration name without the ``''.
|
||||
The argument STRING is a explain the failure. Except for OK,
|
||||
which is a NULL pointer. */
|
||||
|
||||
/* Inlining successful. This must be the first code. */
|
||||
DEFCIFCODE(OK , NULL)
|
||||
|
||||
/* Inlining failed for an unspecified reason. */
|
||||
DEFCIFCODE(UNSPECIFIED , "")
|
||||
|
||||
/* Function has not be considered for inlining. This is the code for
|
||||
functions that have not been rejected for inlining yet. */
|
||||
DEFCIFCODE(FUNCTION_NOT_CONSIDERED, N_("function not considered for inlining"))
|
||||
|
||||
/* Inlining failed owing to unavailable function body. */
|
||||
DEFCIFCODE(BODY_NOT_AVAILABLE, N_("function body not available"))
|
||||
|
||||
/* Extern inline function that has been redefined. */
|
||||
DEFCIFCODE(REDEFINED_EXTERN_INLINE,
|
||||
N_("redefined extern inline functions are not considered for "
|
||||
"inlining"))
|
||||
|
||||
/* Function is not inlinable. */
|
||||
DEFCIFCODE(FUNCTION_NOT_INLINABLE, N_("function not inlinable"))
|
||||
|
||||
/* Function is not overwritable. */
|
||||
DEFCIFCODE(OVERWRITABLE, N_("function body can be overwritten at link time"))
|
||||
|
||||
/* Function is not an inlining candidate. */
|
||||
DEFCIFCODE(FUNCTION_NOT_INLINE_CANDIDATE, N_("function not inline candidate"))
|
||||
|
||||
/* Inlining failed because of various limit parameters. */
|
||||
DEFCIFCODE(LARGE_FUNCTION_GROWTH_LIMIT,
|
||||
N_("--param large-function-growth limit reached"))
|
||||
DEFCIFCODE(LARGE_STACK_FRAME_GROWTH_LIMIT,
|
||||
N_("--param large-stack-frame-growth limit reached"))
|
||||
DEFCIFCODE(MAX_INLINE_INSNS_SINGLE_LIMIT,
|
||||
N_("--param max-inline-insns-single limit reached"))
|
||||
DEFCIFCODE(MAX_INLINE_INSNS_AUTO_LIMIT,
|
||||
N_("--param max-inline-insns-auto limit reached"))
|
||||
DEFCIFCODE(INLINE_UNIT_GROWTH_LIMIT,
|
||||
N_("--param inline-unit-growth limit reached"))
|
||||
|
||||
/* Recursive inlining. */
|
||||
DEFCIFCODE(RECURSIVE_INLINING, N_("recursive inlining"))
|
||||
|
||||
/* Call is unlikely. */
|
||||
DEFCIFCODE(UNLIKELY_CALL, N_("call is unlikely and code size would grow"))
|
||||
|
||||
/* Function is not declared as inline. */
|
||||
DEFCIFCODE(NOT_DECLARED_INLINED,
|
||||
N_("function not declared inline and code size would grow"))
|
||||
|
||||
/* Inlining suppressed due to size optimization. */
|
||||
DEFCIFCODE(OPTIMIZING_FOR_SIZE,
|
||||
N_("optimizing for size and code size would grow"))
|
||||
|
||||
/* Caller and callee disagree on the arguments. */
|
||||
DEFCIFCODE(MISMATCHED_ARGUMENTS, N_("mismatched arguments"))
|
||||
|
||||
/* Call was originally indirect. */
|
||||
DEFCIFCODE(ORIGINALLY_INDIRECT_CALL,
|
||||
N_("originally indirect function call not considered for inlining"))
|
||||
|
||||
/* Ths edge represents an indirect edge with a yet-undetermined callee . */
|
||||
DEFCIFCODE(INDIRECT_UNKNOWN_CALL,
|
||||
N_("indirect function call with a yet undetermined callee"))
|
||||
|
||||
/* We can't inline different EH personalities together. */
|
||||
DEFCIFCODE(EH_PERSONALITY, N_("exception handling personality mismatch"))
|
||||
|
||||
/* We can't inline if the callee can throw non-call exceptions but the
|
||||
caller cannot. */
|
||||
DEFCIFCODE(NON_CALL_EXCEPTIONS, N_("non-call exception handling mismatch"))
|
||||
|
||||
/* We can't inline because of mismatched target specific options. */
|
||||
DEFCIFCODE(TARGET_OPTION_MISMATCH, N_("target specific option mismatch"))
|
||||
|
||||
/* We can't inline because of mismatched optimization levels. */
|
||||
DEFCIFCODE(OPTIMIZATION_MISMATCH, N_("optimization level attribute mismatch"))
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
#ifndef GCC_CONFIG_H
|
||||
#define GCC_CONFIG_H
|
||||
#ifdef GENERATOR_FILE
|
||||
#error config.h is for the host, not build, machine.
|
||||
#endif
|
||||
#include "auto-host.h"
|
||||
#ifdef IN_GCC
|
||||
# include "ansidecl.h"
|
||||
#endif
|
||||
#endif /* GCC_CONFIG_H */
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
/* Functions and structures shared between arm and aarch64.
|
||||
|
||||
Copyright (C) 1991-2013 Free Software Foundation, Inc.
|
||||
Contributed by ARM Ltd.
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation; either version 3, or (at your
|
||||
option) any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
#ifndef GCC_AARCH_COMMON_PROTOS_H
|
||||
#define GCC_AARCH_COMMON_PROTOS_H
|
||||
|
||||
extern int arm_early_load_addr_dep (rtx, rtx);
|
||||
extern int arm_early_store_addr_dep (rtx, rtx);
|
||||
extern int arm_mac_accumulator_is_mul_result (rtx, rtx);
|
||||
extern int arm_mac_accumulator_is_result (rtx, rtx);
|
||||
extern int arm_no_early_alu_shift_dep (rtx, rtx);
|
||||
extern int arm_no_early_alu_shift_value_dep (rtx, rtx);
|
||||
extern int arm_no_early_mul_dep (rtx, rtx);
|
||||
extern int arm_no_early_store_addr_dep (rtx, rtx);
|
||||
extern bool arm_rtx_shift_left_p (rtx);
|
||||
|
||||
/* RTX cost table definitions. These are used when tuning for speed rather
|
||||
than for size and should reflect the _additional_ cost over the cost
|
||||
of the fastest instruction in the machine, which is COSTS_N_INSNS (1).
|
||||
Therefore it's okay for some costs to be 0.
|
||||
Costs may not have a negative value. */
|
||||
struct alu_cost_table
|
||||
{
|
||||
const int arith; /* ADD/SUB. */
|
||||
const int logical; /* AND/ORR/EOR/BIC, etc. */
|
||||
const int shift; /* Simple shift. */
|
||||
const int shift_reg; /* Simple shift by reg. */
|
||||
const int arith_shift; /* Additional when arith also shifts... */
|
||||
const int arith_shift_reg; /* ... and when the shift is by a reg. */
|
||||
const int log_shift; /* Additional when logic also shifts... */
|
||||
const int log_shift_reg; /* ... and when the shift is by a reg. */
|
||||
const int extnd; /* Zero/sign extension. */
|
||||
const int extnd_arith; /* Extend and arith. */
|
||||
const int bfi; /* Bit-field insert. */
|
||||
const int bfx; /* Bit-field extraction. */
|
||||
const int clz; /* Count Leading Zeros. */
|
||||
const int non_exec; /* Extra cost when not executing insn. */
|
||||
const bool non_exec_costs_exec; /* True if non-execution must add the exec
|
||||
cost. */
|
||||
};
|
||||
|
||||
struct mult_cost_table
|
||||
{
|
||||
const int simple;
|
||||
const int flag_setting; /* Additional cost if multiply sets flags. */
|
||||
const int extend;
|
||||
const int add;
|
||||
const int extend_add;
|
||||
const int idiv;
|
||||
};
|
||||
|
||||
/* Calculations of LDM costs are complex. We assume an initial cost
|
||||
(ldm_1st) which will load the number of registers mentioned in
|
||||
ldm_regs_per_insn_1st registers; then each additional
|
||||
ldm_regs_per_insn_subsequent registers cost one more insn.
|
||||
Similarly for STM operations.
|
||||
Therefore the ldm_regs_per_insn_1st/stm_regs_per_insn_1st and
|
||||
ldm_regs_per_insn_subsequent/stm_regs_per_insn_subsequent fields indicate
|
||||
the number of registers loaded/stored and are expressed by a simple integer
|
||||
and not by a COSTS_N_INSNS (N) expression.
|
||||
*/
|
||||
struct mem_cost_table
|
||||
{
|
||||
const int load;
|
||||
const int load_sign_extend; /* Additional to load cost. */
|
||||
const int ldrd; /* Cost of LDRD. */
|
||||
const int ldm_1st;
|
||||
const int ldm_regs_per_insn_1st;
|
||||
const int ldm_regs_per_insn_subsequent;
|
||||
const int loadf; /* SFmode. */
|
||||
const int loadd; /* DFmode. */
|
||||
const int load_unaligned; /* Extra for unaligned loads. */
|
||||
const int store;
|
||||
const int strd;
|
||||
const int stm_1st;
|
||||
const int stm_regs_per_insn_1st;
|
||||
const int stm_regs_per_insn_subsequent;
|
||||
const int storef; /* SFmode. */
|
||||
const int stored; /* DFmode. */
|
||||
const int store_unaligned; /* Extra for unaligned stores. */
|
||||
};
|
||||
|
||||
struct fp_cost_table
|
||||
{
|
||||
const int div;
|
||||
const int mult;
|
||||
const int mult_addsub; /* Non-fused. */
|
||||
const int fma; /* Fused. */
|
||||
const int addsub;
|
||||
const int fpconst; /* Immediate. */
|
||||
const int neg; /* NEG and ABS. */
|
||||
const int compare;
|
||||
const int widen; /* Widen to this size. */
|
||||
const int narrow; /* Narrow from this size. */
|
||||
const int toint;
|
||||
const int fromint;
|
||||
const int roundint; /* V8 round to integral, remains FP format. */
|
||||
};
|
||||
|
||||
struct vector_cost_table
|
||||
{
|
||||
const int alu;
|
||||
};
|
||||
|
||||
struct cpu_cost_table
|
||||
{
|
||||
const struct alu_cost_table alu;
|
||||
const struct mult_cost_table mult[2]; /* SImode and DImode. */
|
||||
const struct mem_cost_table ldst;
|
||||
const struct fp_cost_table fp[2]; /* SFmode and DFmode. */
|
||||
const struct vector_cost_table vect;
|
||||
};
|
||||
|
||||
|
||||
#endif /* GCC_AARCH_COMMON_PROTOS_H */
|
||||
|
|
@ -0,0 +1,303 @@
|
|||
/* Definitions of target machine for GNU compiler, for ARM with a.out
|
||||
Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
Contributed by Richard Earnshaw (rearnsha@armltd.co.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 3, or (at your
|
||||
option) any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef ASM_APP_ON
|
||||
#define ASM_APP_ON ""
|
||||
#endif
|
||||
#ifndef ASM_APP_OFF
|
||||
#define ASM_APP_OFF ""
|
||||
#endif
|
||||
|
||||
/* Switch to the text or data segment. */
|
||||
#define TEXT_SECTION_ASM_OP "\t.text"
|
||||
#define DATA_SECTION_ASM_OP "\t.data"
|
||||
#define BSS_SECTION_ASM_OP "\t.bss"
|
||||
|
||||
/* Note: If USER_LABEL_PREFIX or LOCAL_LABEL_PREFIX are changed,
|
||||
make sure that this change is reflected in the function
|
||||
coff_arm_is_local_label_name() in bfd/coff-arm.c. */
|
||||
#ifndef REGISTER_PREFIX
|
||||
#define REGISTER_PREFIX ""
|
||||
#endif
|
||||
|
||||
#ifndef USER_LABEL_PREFIX
|
||||
#define USER_LABEL_PREFIX "_"
|
||||
#endif
|
||||
|
||||
#ifndef LOCAL_LABEL_PREFIX
|
||||
#define LOCAL_LABEL_PREFIX ""
|
||||
#endif
|
||||
|
||||
/* The assembler's names for the registers. Note that the ?xx registers are
|
||||
there so that VFPv3/NEON registers D16-D31 have the same spacing as D0-D15
|
||||
(each of which is overlaid on two S registers), although there are no
|
||||
actual single-precision registers which correspond to D16-D31. */
|
||||
#ifndef REGISTER_NAMES
|
||||
#define REGISTER_NAMES \
|
||||
{ \
|
||||
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
|
||||
"r8", "r9", "r10", "fp", "ip", "sp", "lr", "pc", \
|
||||
"s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \
|
||||
"s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", \
|
||||
"s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", \
|
||||
"s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", \
|
||||
"d16", "?16", "d17", "?17", "d18", "?18", "d19", "?19", \
|
||||
"d20", "?20", "d21", "?21", "d22", "?22", "d23", "?23", \
|
||||
"d24", "?24", "d25", "?25", "d26", "?26", "d27", "?27", \
|
||||
"d28", "?28", "d29", "?29", "d30", "?30", "d31", "?31", \
|
||||
"wr0", "wr1", "wr2", "wr3", \
|
||||
"wr4", "wr5", "wr6", "wr7", \
|
||||
"wr8", "wr9", "wr10", "wr11", \
|
||||
"wr12", "wr13", "wr14", "wr15", \
|
||||
"wcgr0", "wcgr1", "wcgr2", "wcgr3", \
|
||||
"cc", "vfpcc", "sfp", "afp" \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef ADDITIONAL_REGISTER_NAMES
|
||||
#define ADDITIONAL_REGISTER_NAMES \
|
||||
{ \
|
||||
{"a1", 0}, \
|
||||
{"a2", 1}, \
|
||||
{"a3", 2}, \
|
||||
{"a4", 3}, \
|
||||
{"v1", 4}, \
|
||||
{"v2", 5}, \
|
||||
{"v3", 6}, \
|
||||
{"v4", 7}, \
|
||||
{"v5", 8}, \
|
||||
{"v6", 9}, \
|
||||
{"rfp", 9}, /* Historical. */ \
|
||||
{"sb", 9}, /* Historical. */ \
|
||||
{"v7", 10}, \
|
||||
{"sl", 10}, /* Historical. */ \
|
||||
{"r11", 11}, /* fp */ \
|
||||
{"r12", 12}, /* ip */ \
|
||||
{"r13", 13}, /* sp */ \
|
||||
{"r14", 14}, /* lr */ \
|
||||
{"r15", 15} /* pc */ \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef OVERLAPPING_REGISTER_NAMES
|
||||
#define OVERLAPPING_REGISTER_NAMES \
|
||||
{ \
|
||||
{"d0", FIRST_VFP_REGNUM + 0, 2}, \
|
||||
{"d1", FIRST_VFP_REGNUM + 2, 2}, \
|
||||
{"d2", FIRST_VFP_REGNUM + 4, 2}, \
|
||||
{"d3", FIRST_VFP_REGNUM + 6, 2}, \
|
||||
{"d4", FIRST_VFP_REGNUM + 8, 2}, \
|
||||
{"d5", FIRST_VFP_REGNUM + 10, 2}, \
|
||||
{"d6", FIRST_VFP_REGNUM + 12, 2}, \
|
||||
{"d7", FIRST_VFP_REGNUM + 14, 2}, \
|
||||
{"d8", FIRST_VFP_REGNUM + 16, 2}, \
|
||||
{"d9", FIRST_VFP_REGNUM + 18, 2}, \
|
||||
{"d10", FIRST_VFP_REGNUM + 20, 2}, \
|
||||
{"d11", FIRST_VFP_REGNUM + 22, 2}, \
|
||||
{"d12", FIRST_VFP_REGNUM + 24, 2}, \
|
||||
{"d13", FIRST_VFP_REGNUM + 26, 2}, \
|
||||
{"d14", FIRST_VFP_REGNUM + 28, 2}, \
|
||||
{"d15", FIRST_VFP_REGNUM + 30, 2}, \
|
||||
{"q0", FIRST_VFP_REGNUM + 0, 4}, \
|
||||
{"q1", FIRST_VFP_REGNUM + 4, 4}, \
|
||||
{"q2", FIRST_VFP_REGNUM + 8, 4}, \
|
||||
{"q3", FIRST_VFP_REGNUM + 12, 4}, \
|
||||
{"q4", FIRST_VFP_REGNUM + 16, 4}, \
|
||||
{"q5", FIRST_VFP_REGNUM + 20, 4}, \
|
||||
{"q6", FIRST_VFP_REGNUM + 24, 4}, \
|
||||
{"q7", FIRST_VFP_REGNUM + 28, 4}, \
|
||||
{"q8", FIRST_VFP_REGNUM + 32, 4}, \
|
||||
{"q9", FIRST_VFP_REGNUM + 36, 4}, \
|
||||
{"q10", FIRST_VFP_REGNUM + 40, 4}, \
|
||||
{"q11", FIRST_VFP_REGNUM + 44, 4}, \
|
||||
{"q12", FIRST_VFP_REGNUM + 48, 4}, \
|
||||
{"q13", FIRST_VFP_REGNUM + 52, 4}, \
|
||||
{"q14", FIRST_VFP_REGNUM + 56, 4}, \
|
||||
{"q15", FIRST_VFP_REGNUM + 60, 4} \
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef NO_DOLLAR_IN_LABEL
|
||||
#define NO_DOLLAR_IN_LABEL 1
|
||||
#endif
|
||||
|
||||
/* Generate DBX debugging information. riscix.h will undefine this because
|
||||
the native assembler does not support stabs. */
|
||||
#define DBX_DEBUGGING_INFO 1
|
||||
|
||||
/* Acorn dbx moans about continuation chars, so don't use any. */
|
||||
#ifndef DBX_CONTIN_LENGTH
|
||||
#define DBX_CONTIN_LENGTH 0
|
||||
#endif
|
||||
|
||||
/* Output a function label definition. */
|
||||
#ifndef ASM_DECLARE_FUNCTION_NAME
|
||||
#define ASM_DECLARE_FUNCTION_NAME(STREAM, NAME, DECL) \
|
||||
do \
|
||||
{ \
|
||||
ARM_DECLARE_FUNCTION_NAME (STREAM, NAME, DECL); \
|
||||
ASM_OUTPUT_LABEL (STREAM, NAME); \
|
||||
} \
|
||||
while (0)
|
||||
#endif
|
||||
|
||||
/* Globalizing directive for a label. */
|
||||
#define GLOBAL_ASM_OP "\t.global\t"
|
||||
|
||||
/* Make an internal label into a string. */
|
||||
#ifndef ASM_GENERATE_INTERNAL_LABEL
|
||||
#define ASM_GENERATE_INTERNAL_LABEL(STRING, PREFIX, NUM) \
|
||||
sprintf (STRING, "*%s%s%u", LOCAL_LABEL_PREFIX, PREFIX, (unsigned int)(NUM))
|
||||
#endif
|
||||
|
||||
/* Output an element of a dispatch table. */
|
||||
#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
|
||||
do \
|
||||
{ \
|
||||
gcc_assert (!TARGET_THUMB2); \
|
||||
asm_fprintf (STREAM, "\t.word\t%LL%d\n", VALUE); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
|
||||
/* Thumb-2 always uses addr_diff_elf so that the Table Branch instructions
|
||||
can be used. For non-pic code where the offsets do not suitable for
|
||||
TBB/TBH the elements are output as absolute labels. */
|
||||
#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
|
||||
do \
|
||||
{ \
|
||||
if (TARGET_ARM) \
|
||||
asm_fprintf (STREAM, "\tb\t%LL%d\n", VALUE); \
|
||||
else if (TARGET_THUMB1) \
|
||||
{ \
|
||||
if (flag_pic || optimize_size) \
|
||||
{ \
|
||||
switch (GET_MODE(body)) \
|
||||
{ \
|
||||
case QImode: \
|
||||
asm_fprintf (STREAM, "\t.byte\t(%LL%d-%LL%d)/2\n", \
|
||||
VALUE, REL); \
|
||||
break; \
|
||||
case HImode: /* TBH */ \
|
||||
asm_fprintf (STREAM, "\t.2byte\t(%LL%d-%LL%d)/2\n", \
|
||||
VALUE, REL); \
|
||||
break; \
|
||||
case SImode: \
|
||||
asm_fprintf (STREAM, "\t.word\t%LL%d-%LL%d\n", \
|
||||
VALUE, REL); \
|
||||
break; \
|
||||
default: \
|
||||
gcc_unreachable(); \
|
||||
} \
|
||||
} \
|
||||
else \
|
||||
asm_fprintf (STREAM, "\t.word\t%LL%d+1\n", VALUE); \
|
||||
} \
|
||||
else /* Thumb-2 */ \
|
||||
{ \
|
||||
switch (GET_MODE(body)) \
|
||||
{ \
|
||||
case QImode: /* TBB */ \
|
||||
asm_fprintf (STREAM, "\t.byte\t(%LL%d-%LL%d)/2\n", \
|
||||
VALUE, REL); \
|
||||
break; \
|
||||
case HImode: /* TBH */ \
|
||||
asm_fprintf (STREAM, "\t.2byte\t(%LL%d-%LL%d)/2\n", \
|
||||
VALUE, REL); \
|
||||
break; \
|
||||
case SImode: \
|
||||
if (flag_pic) \
|
||||
asm_fprintf (STREAM, "\t.word\t%LL%d+1-%LL%d\n", VALUE, REL); \
|
||||
else \
|
||||
asm_fprintf (STREAM, "\t.word\t%LL%d+1\n", VALUE); \
|
||||
break; \
|
||||
default: \
|
||||
gcc_unreachable(); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
|
||||
#undef ASM_OUTPUT_ASCII
|
||||
#define ASM_OUTPUT_ASCII(STREAM, PTR, LEN) \
|
||||
output_ascii_pseudo_op (STREAM, (const unsigned char *) (PTR), LEN)
|
||||
|
||||
/* Output a gap. In fact we fill it with nulls. */
|
||||
#undef ASM_OUTPUT_SKIP
|
||||
#define ASM_OUTPUT_SKIP(STREAM, NBYTES) \
|
||||
fprintf (STREAM, "\t.space\t%d\n", (int) (NBYTES))
|
||||
|
||||
/* Align output to a power of two. Horrible /bin/as. */
|
||||
#ifndef ASM_OUTPUT_ALIGN
|
||||
#define ASM_OUTPUT_ALIGN(STREAM, POWER) \
|
||||
do \
|
||||
{ \
|
||||
register int amount = 1 << (POWER); \
|
||||
\
|
||||
if (amount == 2) \
|
||||
fprintf (STREAM, "\t.even\n"); \
|
||||
else if (amount != 1) \
|
||||
fprintf (STREAM, "\t.align\t%d\n", amount - 4); \
|
||||
} \
|
||||
while (0)
|
||||
#endif
|
||||
|
||||
/* Output a common block. */
|
||||
#ifndef ASM_OUTPUT_COMMON
|
||||
#define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
|
||||
do \
|
||||
{ \
|
||||
fprintf (STREAM, "\t.comm\t"); \
|
||||
assemble_name (STREAM, NAME); \
|
||||
asm_fprintf (STREAM, ", %d\t%@ %d\n", \
|
||||
(int)(ROUNDED), (int)(SIZE)); \
|
||||
} \
|
||||
while (0)
|
||||
#endif
|
||||
|
||||
/* Output a local common block. /bin/as can't do this, so hack a
|
||||
`.space' into the bss segment. Note that this is *bad* practice,
|
||||
which is guaranteed NOT to work since it doesn't define STATIC
|
||||
COMMON space but merely STATIC BSS space. */
|
||||
#ifndef ASM_OUTPUT_ALIGNED_LOCAL
|
||||
#define ASM_OUTPUT_ALIGNED_LOCAL(STREAM, NAME, SIZE, ALIGN) \
|
||||
do \
|
||||
{ \
|
||||
switch_to_section (bss_section); \
|
||||
ASM_OUTPUT_ALIGN (STREAM, floor_log2 (ALIGN / BITS_PER_UNIT)); \
|
||||
ASM_OUTPUT_LABEL (STREAM, NAME); \
|
||||
fprintf (STREAM, "\t.space\t%d\n", (int)(SIZE)); \
|
||||
} \
|
||||
while (0)
|
||||
#endif
|
||||
|
||||
/* Output a zero-initialized block. */
|
||||
#ifndef ASM_OUTPUT_ALIGNED_BSS
|
||||
#define ASM_OUTPUT_ALIGNED_BSS(STREAM, DECL, NAME, SIZE, ALIGN) \
|
||||
asm_output_aligned_bss (STREAM, DECL, NAME, SIZE, ALIGN)
|
||||
#endif
|
||||
|
||||
#ifndef ASM_COMMENT_START
|
||||
#define ASM_COMMENT_START "@"
|
||||
#endif
|
||||
|
||||
/* This works for GAS and some other assemblers. */
|
||||
#define SET_ASM_OP "\t.set\t"
|
||||
|
|
@ -0,0 +1,141 @@
|
|||
/* ARM CPU Cores
|
||||
Copyright (C) 2003-2013 Free Software Foundation, Inc.
|
||||
Written by CodeSourcery, LLC
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Before using #include to read this file, define a macro:
|
||||
|
||||
ARM_CORE(CORE_NAME, CORE_IDENT, ARCH, FLAGS, COSTS)
|
||||
|
||||
The CORE_NAME is the name of the core, represented as a string constant.
|
||||
The CORE_IDENT is the name of the core, represented as an identifier.
|
||||
ARCH is the architecture revision implemented by the chip.
|
||||
FLAGS are the bitwise-or of the traits that apply to that core.
|
||||
This need not include flags implied by the architecture.
|
||||
COSTS is the name of the rtx_costs routine to use.
|
||||
|
||||
If you update this table, you must update the "tune" attribute in
|
||||
arm.md.
|
||||
|
||||
Some tools assume no whitespace up to the first "," in each entry. */
|
||||
|
||||
/* V2/V2A Architecture Processors */
|
||||
ARM_CORE("arm2", arm2, 2, FL_CO_PROC | FL_MODE26, slowmul)
|
||||
ARM_CORE("arm250", arm250, 2, FL_CO_PROC | FL_MODE26, slowmul)
|
||||
ARM_CORE("arm3", arm3, 2, FL_CO_PROC | FL_MODE26, slowmul)
|
||||
|
||||
/* V3 Architecture Processors */
|
||||
ARM_CORE("arm6", arm6, 3, FL_CO_PROC | FL_MODE26, slowmul)
|
||||
ARM_CORE("arm60", arm60, 3, FL_CO_PROC | FL_MODE26, slowmul)
|
||||
ARM_CORE("arm600", arm600, 3, FL_CO_PROC | FL_MODE26 | FL_WBUF, slowmul)
|
||||
ARM_CORE("arm610", arm610, 3, FL_MODE26 | FL_WBUF, slowmul)
|
||||
ARM_CORE("arm620", arm620, 3, FL_CO_PROC | FL_MODE26 | FL_WBUF, slowmul)
|
||||
ARM_CORE("arm7", arm7, 3, FL_CO_PROC | FL_MODE26, slowmul)
|
||||
ARM_CORE("arm7d", arm7d, 3, FL_CO_PROC | FL_MODE26, slowmul)
|
||||
ARM_CORE("arm7di", arm7di, 3, FL_CO_PROC | FL_MODE26, slowmul)
|
||||
ARM_CORE("arm70", arm70, 3, FL_CO_PROC | FL_MODE26, slowmul)
|
||||
ARM_CORE("arm700", arm700, 3, FL_CO_PROC | FL_MODE26 | FL_WBUF, slowmul)
|
||||
ARM_CORE("arm700i", arm700i, 3, FL_CO_PROC | FL_MODE26 | FL_WBUF, slowmul)
|
||||
ARM_CORE("arm710", arm710, 3, FL_MODE26 | FL_WBUF, slowmul)
|
||||
ARM_CORE("arm720", arm720, 3, FL_MODE26 | FL_WBUF, slowmul)
|
||||
ARM_CORE("arm710c", arm710c, 3, FL_MODE26 | FL_WBUF, slowmul)
|
||||
ARM_CORE("arm7100", arm7100, 3, FL_MODE26 | FL_WBUF, slowmul)
|
||||
ARM_CORE("arm7500", arm7500, 3, FL_MODE26 | FL_WBUF, slowmul)
|
||||
/* Doesn't have an external co-proc, but does have embedded fpa. */
|
||||
ARM_CORE("arm7500fe", arm7500fe, 3, FL_CO_PROC | FL_MODE26 | FL_WBUF, slowmul)
|
||||
|
||||
/* V3M Architecture Processors */
|
||||
/* arm7m doesn't exist on its own, but only with D, ("and", and I), but
|
||||
those don't alter the code, so arm7m is sometimes used. */
|
||||
ARM_CORE("arm7m", arm7m, 3M, FL_CO_PROC | FL_MODE26, fastmul)
|
||||
ARM_CORE("arm7dm", arm7dm, 3M, FL_CO_PROC | FL_MODE26, fastmul)
|
||||
ARM_CORE("arm7dmi", arm7dmi, 3M, FL_CO_PROC | FL_MODE26, fastmul)
|
||||
|
||||
/* V4 Architecture Processors */
|
||||
ARM_CORE("arm8", arm8, 4, FL_MODE26 | FL_LDSCHED, fastmul)
|
||||
ARM_CORE("arm810", arm810, 4, FL_MODE26 | FL_LDSCHED, fastmul)
|
||||
ARM_CORE("strongarm", strongarm, 4, FL_MODE26 | FL_LDSCHED | FL_STRONG, strongarm)
|
||||
ARM_CORE("strongarm110", strongarm110, 4, FL_MODE26 | FL_LDSCHED | FL_STRONG, strongarm)
|
||||
ARM_CORE("strongarm1100", strongarm1100, 4, FL_MODE26 | FL_LDSCHED | FL_STRONG, strongarm)
|
||||
ARM_CORE("strongarm1110", strongarm1110, 4, FL_MODE26 | FL_LDSCHED | FL_STRONG, strongarm)
|
||||
ARM_CORE("fa526", fa526, 4, FL_LDSCHED, fastmul)
|
||||
ARM_CORE("fa626", fa626, 4, FL_LDSCHED, fastmul)
|
||||
|
||||
/* V4T Architecture Processors */
|
||||
ARM_CORE("arm7tdmi", arm7tdmi, 4T, FL_CO_PROC , fastmul)
|
||||
ARM_CORE("arm7tdmi-s", arm7tdmis, 4T, FL_CO_PROC , fastmul)
|
||||
ARM_CORE("arm710t", arm710t, 4T, FL_WBUF, fastmul)
|
||||
ARM_CORE("arm720t", arm720t, 4T, FL_WBUF, fastmul)
|
||||
ARM_CORE("arm740t", arm740t, 4T, FL_WBUF, fastmul)
|
||||
ARM_CORE("arm9", arm9, 4T, FL_LDSCHED, fastmul)
|
||||
ARM_CORE("arm9tdmi", arm9tdmi, 4T, FL_LDSCHED, fastmul)
|
||||
ARM_CORE("arm920", arm920, 4T, FL_LDSCHED, fastmul)
|
||||
ARM_CORE("arm920t", arm920t, 4T, FL_LDSCHED, fastmul)
|
||||
ARM_CORE("arm922t", arm922t, 4T, FL_LDSCHED, fastmul)
|
||||
ARM_CORE("arm940t", arm940t, 4T, FL_LDSCHED, fastmul)
|
||||
ARM_CORE("ep9312", ep9312, 4T, FL_LDSCHED, fastmul)
|
||||
|
||||
/* V5T Architecture Processors */
|
||||
ARM_CORE("arm10tdmi", arm10tdmi, 5T, FL_LDSCHED, fastmul)
|
||||
ARM_CORE("arm1020t", arm1020t, 5T, FL_LDSCHED, fastmul)
|
||||
|
||||
/* V5TE Architecture Processors */
|
||||
ARM_CORE("arm9e", arm9e, 5TE, FL_LDSCHED, 9e)
|
||||
ARM_CORE("arm946e-s", arm946es, 5TE, FL_LDSCHED, 9e)
|
||||
ARM_CORE("arm966e-s", arm966es, 5TE, FL_LDSCHED, 9e)
|
||||
ARM_CORE("arm968e-s", arm968es, 5TE, FL_LDSCHED, 9e)
|
||||
ARM_CORE("arm10e", arm10e, 5TE, FL_LDSCHED, fastmul)
|
||||
ARM_CORE("arm1020e", arm1020e, 5TE, FL_LDSCHED, fastmul)
|
||||
ARM_CORE("arm1022e", arm1022e, 5TE, FL_LDSCHED, fastmul)
|
||||
ARM_CORE("xscale", xscale, 5TE, FL_LDSCHED | FL_STRONG | FL_XSCALE, xscale)
|
||||
ARM_CORE("iwmmxt", iwmmxt, 5TE, FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT, xscale)
|
||||
ARM_CORE("iwmmxt2", iwmmxt2, 5TE, FL_LDSCHED | FL_STRONG | FL_XSCALE | FL_IWMMXT | FL_IWMMXT2, xscale)
|
||||
ARM_CORE("fa606te", fa606te, 5TE, FL_LDSCHED, 9e)
|
||||
ARM_CORE("fa626te", fa626te, 5TE, FL_LDSCHED, 9e)
|
||||
ARM_CORE("fmp626", fmp626, 5TE, FL_LDSCHED, 9e)
|
||||
ARM_CORE("fa726te", fa726te, 5TE, FL_LDSCHED, fa726te)
|
||||
|
||||
/* V5TEJ Architecture Processors */
|
||||
ARM_CORE("arm926ej-s", arm926ejs, 5TEJ, FL_LDSCHED, 9e)
|
||||
ARM_CORE("arm1026ej-s", arm1026ejs, 5TEJ, FL_LDSCHED, 9e)
|
||||
|
||||
/* V6 Architecture Processors */
|
||||
ARM_CORE("arm1136j-s", arm1136js, 6J, FL_LDSCHED, 9e)
|
||||
ARM_CORE("arm1136jf-s", arm1136jfs, 6J, FL_LDSCHED | FL_VFPV2, 9e)
|
||||
ARM_CORE("arm1176jz-s", arm1176jzs, 6ZK, FL_LDSCHED, 9e)
|
||||
ARM_CORE("arm1176jzf-s", arm1176jzfs, 6ZK, FL_LDSCHED | FL_VFPV2, 9e)
|
||||
ARM_CORE("mpcorenovfp", mpcorenovfp, 6K, FL_LDSCHED, 9e)
|
||||
ARM_CORE("mpcore", mpcore, 6K, FL_LDSCHED | FL_VFPV2, 9e)
|
||||
ARM_CORE("arm1156t2-s", arm1156t2s, 6T2, FL_LDSCHED, v6t2)
|
||||
ARM_CORE("arm1156t2f-s", arm1156t2fs, 6T2, FL_LDSCHED | FL_VFPV2, v6t2)
|
||||
ARM_CORE("generic-armv7-a", genericv7a, 7A, FL_LDSCHED, cortex)
|
||||
ARM_CORE("cortex-a5", cortexa5, 7A, FL_LDSCHED, cortex_a5)
|
||||
ARM_CORE("cortex-a7", cortexa7, 7A, FL_LDSCHED | FL_THUMB_DIV | FL_ARM_DIV, cortex)
|
||||
ARM_CORE("cortex-a8", cortexa8, 7A, FL_LDSCHED, cortex)
|
||||
ARM_CORE("cortex-a9", cortexa9, 7A, FL_LDSCHED, cortex_a9)
|
||||
ARM_CORE("cortex-a15", cortexa15, 7A, FL_LDSCHED | FL_THUMB_DIV | FL_ARM_DIV, cortex_a15)
|
||||
ARM_CORE("cortex-r4", cortexr4, 7R, FL_LDSCHED, cortex)
|
||||
ARM_CORE("cortex-r4f", cortexr4f, 7R, FL_LDSCHED, cortex)
|
||||
ARM_CORE("cortex-r5", cortexr5, 7R, FL_LDSCHED | FL_ARM_DIV, cortex)
|
||||
ARM_CORE("cortex-r7", cortexr7, 7R, FL_LDSCHED | FL_ARM_DIV, cortex)
|
||||
ARM_CORE("cortex-m4", cortexm4, 7EM, FL_LDSCHED, v7m)
|
||||
ARM_CORE("cortex-m3", cortexm3, 7M, FL_LDSCHED, v7m)
|
||||
ARM_CORE("cortex-m1", cortexm1, 6M, FL_LDSCHED, v6m)
|
||||
ARM_CORE("cortex-m0", cortexm0, 6M, FL_LDSCHED, v6m)
|
||||
ARM_CORE("cortex-m0plus", cortexm0plus, 6M, FL_LDSCHED, v6m)
|
||||
ARM_CORE("marvell-pj4", marvell_pj4, 7A, FL_LDSCHED, 9e)
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
/* Definitions for option handling for ARM.
|
||||
Copyright (C) 1991-2013 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 3, or (at your
|
||||
option) any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef ARM_OPTS_H
|
||||
#define ARM_OPTS_H
|
||||
|
||||
/* The various ARM cores. */
|
||||
enum processor_type
|
||||
{
|
||||
#define ARM_CORE(NAME, IDENT, ARCH, FLAGS, COSTS) \
|
||||
IDENT,
|
||||
#include "arm-cores.def"
|
||||
#undef ARM_CORE
|
||||
/* Used to indicate that no processor has been specified. */
|
||||
arm_none
|
||||
};
|
||||
|
||||
/* Which __fp16 format to use.
|
||||
The enumeration values correspond to the numbering for the
|
||||
Tag_ABI_FP_16bit_format attribute.
|
||||
*/
|
||||
enum arm_fp16_format_type
|
||||
{
|
||||
ARM_FP16_FORMAT_NONE = 0,
|
||||
ARM_FP16_FORMAT_IEEE = 1,
|
||||
ARM_FP16_FORMAT_ALTERNATIVE = 2
|
||||
};
|
||||
|
||||
/* Which ABI to use. */
|
||||
enum arm_abi_type
|
||||
{
|
||||
ARM_ABI_APCS,
|
||||
ARM_ABI_ATPCS,
|
||||
ARM_ABI_AAPCS,
|
||||
ARM_ABI_IWMMXT,
|
||||
ARM_ABI_AAPCS_LINUX
|
||||
};
|
||||
|
||||
enum float_abi_type
|
||||
{
|
||||
ARM_FLOAT_ABI_SOFT,
|
||||
ARM_FLOAT_ABI_SOFTFP,
|
||||
ARM_FLOAT_ABI_HARD
|
||||
};
|
||||
|
||||
/* Which thread pointer access sequence to use. */
|
||||
enum arm_tp_type {
|
||||
TP_AUTO,
|
||||
TP_SOFT,
|
||||
TP_CP15
|
||||
};
|
||||
|
||||
/* Which TLS scheme to use. */
|
||||
enum arm_tls_type {
|
||||
TLS_GNU,
|
||||
TLS_GNU2
|
||||
};
|
||||
#endif
|
||||
|
|
@ -0,0 +1,293 @@
|
|||
/* Prototypes for exported functions defined in arm.c and pe.c
|
||||
Copyright (C) 1999-2013 Free Software Foundation, Inc.
|
||||
Contributed by Richard Earnshaw (rearnsha@arm.com)
|
||||
Minor hacks by Nick Clifton (nickc@cygnus.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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_ARM_PROTOS_H
|
||||
#define GCC_ARM_PROTOS_H
|
||||
|
||||
extern enum unwind_info_type arm_except_unwind_info (struct gcc_options *);
|
||||
extern int use_return_insn (int, rtx);
|
||||
extern enum reg_class arm_regno_class (int);
|
||||
extern void arm_load_pic_register (unsigned long);
|
||||
extern int arm_volatile_func (void);
|
||||
extern void arm_expand_prologue (void);
|
||||
extern void arm_expand_epilogue (bool);
|
||||
extern void thumb2_expand_return (void);
|
||||
extern const char *arm_strip_name_encoding (const char *);
|
||||
extern void arm_asm_output_labelref (FILE *, const char *);
|
||||
extern void thumb2_asm_output_opcode (FILE *);
|
||||
extern unsigned long arm_current_func_type (void);
|
||||
extern HOST_WIDE_INT arm_compute_initial_elimination_offset (unsigned int,
|
||||
unsigned int);
|
||||
extern HOST_WIDE_INT thumb_compute_initial_elimination_offset (unsigned int,
|
||||
unsigned int);
|
||||
extern unsigned int arm_dbx_register_number (unsigned int);
|
||||
extern void arm_output_fn_unwind (FILE *, bool);
|
||||
|
||||
|
||||
#ifdef RTX_CODE
|
||||
extern bool arm_vector_mode_supported_p (enum machine_mode);
|
||||
extern bool arm_small_register_classes_for_mode_p (enum machine_mode);
|
||||
extern int arm_hard_regno_mode_ok (unsigned int, enum machine_mode);
|
||||
extern bool arm_modes_tieable_p (enum machine_mode, enum machine_mode);
|
||||
extern int const_ok_for_arm (HOST_WIDE_INT);
|
||||
extern int const_ok_for_op (HOST_WIDE_INT, enum rtx_code);
|
||||
extern int const_ok_for_dimode_op (HOST_WIDE_INT, enum rtx_code);
|
||||
extern int arm_split_constant (RTX_CODE, enum machine_mode, rtx,
|
||||
HOST_WIDE_INT, rtx, rtx, int);
|
||||
extern int legitimate_pic_operand_p (rtx);
|
||||
extern rtx legitimize_pic_address (rtx, enum machine_mode, rtx);
|
||||
extern rtx legitimize_tls_address (rtx, rtx);
|
||||
extern int arm_legitimate_address_outer_p (enum machine_mode, rtx, RTX_CODE, int);
|
||||
extern int thumb_legitimate_offset_p (enum machine_mode, HOST_WIDE_INT);
|
||||
extern bool arm_legitimize_reload_address (rtx *, enum machine_mode, int, int,
|
||||
int);
|
||||
extern rtx thumb_legitimize_reload_address (rtx *, enum machine_mode, int, int,
|
||||
int);
|
||||
extern int thumb1_legitimate_address_p (enum machine_mode, rtx, int);
|
||||
extern bool ldm_stm_operation_p (rtx, bool, enum machine_mode mode,
|
||||
bool, bool);
|
||||
extern int arm_const_double_rtx (rtx);
|
||||
extern int vfp3_const_double_rtx (rtx);
|
||||
extern int neon_immediate_valid_for_move (rtx, enum machine_mode, rtx *, int *);
|
||||
extern int neon_immediate_valid_for_logic (rtx, enum machine_mode, int, rtx *,
|
||||
int *);
|
||||
extern int neon_immediate_valid_for_shift (rtx, enum machine_mode, rtx *,
|
||||
int *, bool);
|
||||
extern char *neon_output_logic_immediate (const char *, rtx *,
|
||||
enum machine_mode, int, int);
|
||||
extern char *neon_output_shift_immediate (const char *, char, rtx *,
|
||||
enum machine_mode, int, bool);
|
||||
extern void neon_pairwise_reduce (rtx, rtx, enum machine_mode,
|
||||
rtx (*) (rtx, rtx, rtx));
|
||||
extern rtx neon_make_constant (rtx);
|
||||
extern void neon_expand_vector_init (rtx, rtx);
|
||||
extern void neon_lane_bounds (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
|
||||
extern void neon_const_bounds (rtx, HOST_WIDE_INT, HOST_WIDE_INT);
|
||||
extern HOST_WIDE_INT neon_element_bits (enum machine_mode);
|
||||
extern void neon_reinterpret (rtx, rtx);
|
||||
extern void neon_emit_pair_result_insn (enum machine_mode,
|
||||
rtx (*) (rtx, rtx, rtx, rtx),
|
||||
rtx, rtx, rtx);
|
||||
extern void neon_disambiguate_copy (rtx *, rtx *, rtx *, unsigned int);
|
||||
extern void neon_split_vcombine (rtx op[3]);
|
||||
extern enum reg_class coproc_secondary_reload_class (enum machine_mode, rtx,
|
||||
bool);
|
||||
extern bool arm_tls_referenced_p (rtx);
|
||||
|
||||
extern int arm_coproc_mem_operand (rtx, bool);
|
||||
extern int neon_vector_mem_operand (rtx, int);
|
||||
extern int neon_struct_mem_operand (rtx);
|
||||
extern int arm_no_early_store_addr_dep (rtx, rtx);
|
||||
extern int arm_early_store_addr_dep (rtx, rtx);
|
||||
extern int arm_early_load_addr_dep (rtx, rtx);
|
||||
extern int arm_no_early_alu_shift_dep (rtx, rtx);
|
||||
extern int arm_no_early_alu_shift_value_dep (rtx, rtx);
|
||||
extern int arm_no_early_mul_dep (rtx, rtx);
|
||||
extern int arm_mac_accumulator_is_result (rtx, rtx);
|
||||
extern int arm_mac_accumulator_is_mul_result (rtx, rtx);
|
||||
|
||||
extern int tls_mentioned_p (rtx);
|
||||
extern int symbol_mentioned_p (rtx);
|
||||
extern int label_mentioned_p (rtx);
|
||||
extern RTX_CODE minmax_code (rtx);
|
||||
extern bool arm_sat_operator_match (rtx, rtx, int *, bool *);
|
||||
extern int adjacent_mem_locations (rtx, rtx);
|
||||
extern bool gen_ldm_seq (rtx *, int, bool);
|
||||
extern bool gen_stm_seq (rtx *, int);
|
||||
extern bool gen_const_stm_seq (rtx *, int);
|
||||
extern rtx arm_gen_load_multiple (int *, int, rtx, int, rtx, HOST_WIDE_INT *);
|
||||
extern rtx arm_gen_store_multiple (int *, int, rtx, int, rtx, HOST_WIDE_INT *);
|
||||
extern bool offset_ok_for_ldrd_strd (HOST_WIDE_INT);
|
||||
extern bool operands_ok_ldrd_strd (rtx, rtx, rtx, HOST_WIDE_INT, bool, bool);
|
||||
extern int arm_gen_movmemqi (rtx *);
|
||||
extern enum machine_mode arm_select_cc_mode (RTX_CODE, rtx, rtx);
|
||||
extern enum machine_mode arm_select_dominance_cc_mode (rtx, rtx,
|
||||
HOST_WIDE_INT);
|
||||
extern rtx arm_gen_compare_reg (RTX_CODE, rtx, rtx, rtx);
|
||||
extern rtx arm_gen_return_addr_mask (void);
|
||||
extern void arm_reload_in_hi (rtx *);
|
||||
extern void arm_reload_out_hi (rtx *);
|
||||
extern int arm_max_const_double_inline_cost (void);
|
||||
extern int arm_const_double_inline_cost (rtx);
|
||||
extern bool arm_const_double_by_parts (rtx);
|
||||
extern bool arm_const_double_by_immediates (rtx);
|
||||
extern const char *fp_immediate_constant (rtx);
|
||||
extern void arm_emit_call_insn (rtx, rtx);
|
||||
extern const char *output_call (rtx *);
|
||||
extern const char *output_call_mem (rtx *);
|
||||
void arm_emit_movpair (rtx, rtx);
|
||||
extern const char *output_mov_long_double_arm_from_arm (rtx *);
|
||||
extern const char *output_move_double (rtx *, bool, int *count);
|
||||
extern const char *output_move_quad (rtx *);
|
||||
extern int arm_count_output_move_double_insns (rtx *);
|
||||
extern const char *output_move_vfp (rtx *operands);
|
||||
extern const char *output_move_neon (rtx *operands);
|
||||
extern int arm_attr_length_move_neon (rtx);
|
||||
extern int arm_address_offset_is_imm (rtx);
|
||||
extern const char *output_add_immediate (rtx *);
|
||||
extern const char *arithmetic_instr (rtx, int);
|
||||
extern void output_ascii_pseudo_op (FILE *, const unsigned char *, int);
|
||||
extern const char *output_return_instruction (rtx, bool, bool, bool);
|
||||
extern void arm_poke_function_name (FILE *, const char *);
|
||||
extern void arm_final_prescan_insn (rtx);
|
||||
extern int arm_debugger_arg_offset (int, rtx);
|
||||
extern bool arm_is_long_call_p (tree);
|
||||
extern int arm_emit_vector_const (FILE *, rtx);
|
||||
extern void arm_emit_fp16_const (rtx c);
|
||||
extern const char * arm_output_load_gr (rtx *);
|
||||
extern const char *vfp_output_fstmd (rtx *);
|
||||
extern void arm_output_multireg_pop (rtx *, bool, rtx, bool, bool);
|
||||
extern void arm_set_return_address (rtx, rtx);
|
||||
extern int arm_eliminable_register (rtx);
|
||||
extern const char *arm_output_shift(rtx *, int);
|
||||
extern const char *arm_output_iwmmxt_shift_immediate (const char *, rtx *, bool);
|
||||
extern const char *arm_output_iwmmxt_tinsr (rtx *);
|
||||
extern unsigned int arm_sync_loop_insns (rtx , rtx *);
|
||||
extern int arm_attr_length_push_multi(rtx, rtx);
|
||||
extern void arm_expand_compare_and_swap (rtx op[]);
|
||||
extern void arm_split_compare_and_swap (rtx op[]);
|
||||
extern void arm_split_atomic_op (enum rtx_code, rtx, rtx, rtx, rtx, rtx, rtx);
|
||||
extern rtx arm_load_tp (rtx);
|
||||
|
||||
#if defined TREE_CODE
|
||||
extern void arm_init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx, tree);
|
||||
extern bool arm_pad_arg_upward (enum machine_mode, const_tree);
|
||||
extern bool arm_pad_reg_upward (enum machine_mode, tree, int);
|
||||
#endif
|
||||
extern int arm_apply_result_size (void);
|
||||
|
||||
#endif /* RTX_CODE */
|
||||
|
||||
/* Thumb functions. */
|
||||
extern void arm_init_expanders (void);
|
||||
extern const char *thumb1_unexpanded_epilogue (void);
|
||||
extern void thumb1_expand_prologue (void);
|
||||
extern void thumb1_expand_epilogue (void);
|
||||
extern const char *thumb1_output_interwork (void);
|
||||
#ifdef TREE_CODE
|
||||
extern int is_called_in_ARM_mode (tree);
|
||||
#endif
|
||||
extern int thumb_shiftable_const (unsigned HOST_WIDE_INT);
|
||||
#ifdef RTX_CODE
|
||||
extern enum arm_cond_code maybe_get_arm_condition_code (rtx);
|
||||
extern void thumb1_final_prescan_insn (rtx);
|
||||
extern void thumb2_final_prescan_insn (rtx);
|
||||
extern const char *thumb_load_double_from_address (rtx *);
|
||||
extern const char *thumb_output_move_mem_multiple (int, rtx *);
|
||||
extern const char *thumb_call_via_reg (rtx);
|
||||
extern void thumb_expand_movmemqi (rtx *);
|
||||
extern rtx arm_return_addr (int, rtx);
|
||||
extern void thumb_reload_out_hi (rtx *);
|
||||
extern void thumb_reload_in_hi (rtx *);
|
||||
extern void thumb_set_return_address (rtx, rtx);
|
||||
extern const char *thumb1_output_casesi (rtx *);
|
||||
extern const char *thumb2_output_casesi (rtx *);
|
||||
#endif
|
||||
|
||||
/* Defined in pe.c. */
|
||||
extern int arm_dllexport_name_p (const char *);
|
||||
extern int arm_dllimport_name_p (const char *);
|
||||
|
||||
#ifdef TREE_CODE
|
||||
extern void arm_pe_unique_section (tree, int);
|
||||
extern void arm_pe_encode_section_info (tree, rtx, int);
|
||||
extern int arm_dllexport_p (tree);
|
||||
extern int arm_dllimport_p (tree);
|
||||
extern void arm_mark_dllexport (tree);
|
||||
extern void arm_mark_dllimport (tree);
|
||||
#endif
|
||||
|
||||
extern void arm_pr_long_calls (struct cpp_reader *);
|
||||
extern void arm_pr_no_long_calls (struct cpp_reader *);
|
||||
extern void arm_pr_long_calls_off (struct cpp_reader *);
|
||||
|
||||
extern void arm_lang_object_attributes_init(void);
|
||||
|
||||
extern const char *arm_mangle_type (const_tree);
|
||||
|
||||
extern void arm_order_regs_for_local_alloc (void);
|
||||
|
||||
/* Vectorizer cost model implementation. */
|
||||
struct cpu_vec_costs {
|
||||
const int scalar_stmt_cost; /* Cost of any scalar operation, excluding
|
||||
load and store. */
|
||||
const int scalar_load_cost; /* Cost of scalar load. */
|
||||
const int scalar_store_cost; /* Cost of scalar store. */
|
||||
const int vec_stmt_cost; /* Cost of any vector operation, excluding
|
||||
load, store, vector-to-scalar and
|
||||
scalar-to-vector operation. */
|
||||
const int vec_to_scalar_cost; /* Cost of vect-to-scalar operation. */
|
||||
const int scalar_to_vec_cost; /* Cost of scalar-to-vector operation. */
|
||||
const int vec_align_load_cost; /* Cost of aligned vector load. */
|
||||
const int vec_unalign_load_cost; /* Cost of unaligned vector load. */
|
||||
const int vec_unalign_store_cost; /* Cost of unaligned vector load. */
|
||||
const int vec_store_cost; /* Cost of vector store. */
|
||||
const int cond_taken_branch_cost; /* Cost of taken branch for vectorizer
|
||||
cost model. */
|
||||
const int cond_not_taken_branch_cost;/* Cost of not taken branch for
|
||||
vectorizer cost model. */
|
||||
};
|
||||
|
||||
#ifdef RTX_CODE
|
||||
/* This needs to be here because we need RTX_CODE and similar. */
|
||||
|
||||
struct cpu_cost_table;
|
||||
|
||||
struct tune_params
|
||||
{
|
||||
bool (*rtx_costs) (rtx, RTX_CODE, RTX_CODE, int *, bool);
|
||||
const struct cpu_cost_table *insn_extra_cost;
|
||||
bool (*sched_adjust_cost) (rtx, rtx, rtx, int *);
|
||||
int constant_limit;
|
||||
/* Maximum number of instructions to conditionalise in
|
||||
arm_final_prescan_insn. */
|
||||
int max_insns_skipped;
|
||||
int num_prefetch_slots;
|
||||
int l1_cache_size;
|
||||
int l1_cache_line_size;
|
||||
bool prefer_constant_pool;
|
||||
int (*branch_cost) (bool, bool);
|
||||
/* Prefer STRD/LDRD instructions over PUSH/POP/LDM/STM. */
|
||||
bool prefer_ldrd_strd;
|
||||
/* The preference for non short cirtcuit operation when optimizing for
|
||||
performance. The first element covers Thumb state and the second one
|
||||
is for ARM state. */
|
||||
bool logical_op_non_short_circuit[2];
|
||||
/* Vectorizer costs. */
|
||||
const struct cpu_vec_costs* vec_costs;
|
||||
};
|
||||
|
||||
extern const struct tune_params *current_tune;
|
||||
extern int vfp3_const_double_for_fract_bits (rtx);
|
||||
|
||||
extern void arm_emit_coreregs_64bit_shift (enum rtx_code, rtx, rtx, rtx, rtx,
|
||||
rtx);
|
||||
extern bool arm_validize_comparison (rtx *, rtx *, rtx *);
|
||||
#endif /* RTX_CODE */
|
||||
|
||||
extern void arm_expand_vec_perm (rtx target, rtx op0, rtx op1, rtx sel);
|
||||
extern bool arm_expand_vec_perm_const (rtx target, rtx op0, rtx op1, rtx sel);
|
||||
|
||||
extern bool arm_autoinc_modes_ok_p (enum machine_mode, enum arm_auto_incmodes);
|
||||
|
||||
extern void arm_emit_eabi_attribute (const char *, int, int);
|
||||
|
||||
#endif /* ! GCC_ARM_PROTOS_H */
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,147 @@
|
|||
/* Configuration file for ARM BPABI targets.
|
||||
Copyright (C) 2004-2013 Free Software Foundation, Inc.
|
||||
Contributed by CodeSourcery, LLC
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published
|
||||
by the Free Software Foundation; either version 3, or (at your
|
||||
option) any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Use the AAPCS ABI by default. */
|
||||
#define ARM_DEFAULT_ABI ARM_ABI_AAPCS
|
||||
|
||||
/* Assume that AAPCS ABIs should adhere to the full BPABI. */
|
||||
#define TARGET_BPABI (TARGET_AAPCS_BASED)
|
||||
|
||||
/* BPABI targets use EABI frame unwinding tables. */
|
||||
#undef ARM_UNWIND_INFO
|
||||
#define ARM_UNWIND_INFO 1
|
||||
|
||||
/* Section 4.1 of the AAPCS requires the use of VFP format. */
|
||||
#undef FPUTYPE_DEFAULT
|
||||
#define FPUTYPE_DEFAULT "vfp"
|
||||
|
||||
/* TARGET_BIG_ENDIAN_DEFAULT is set in
|
||||
config.gcc for big endian configurations. */
|
||||
#if TARGET_BIG_ENDIAN_DEFAULT
|
||||
#define TARGET_ENDIAN_DEFAULT MASK_BIG_END
|
||||
#else
|
||||
#define TARGET_ENDIAN_DEFAULT 0
|
||||
#endif
|
||||
|
||||
/* EABI targets should enable interworking by default. */
|
||||
#undef TARGET_DEFAULT
|
||||
#define TARGET_DEFAULT (MASK_INTERWORK | TARGET_ENDIAN_DEFAULT)
|
||||
|
||||
/* The ARM BPABI functions return a boolean; they use no special
|
||||
calling convention. */
|
||||
#define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) TARGET_BPABI
|
||||
|
||||
/* The BPABI integer comparison routines return { -1, 0, 1 }. */
|
||||
#define TARGET_LIB_INT_CMP_BIASED !TARGET_BPABI
|
||||
|
||||
#define TARGET_FIX_V4BX_SPEC " %{mcpu=arm8|mcpu=arm810|mcpu=strongarm*"\
|
||||
"|march=armv4|mcpu=fa526|mcpu=fa626:--fix-v4bx}"
|
||||
|
||||
#if TARGET_BIG_ENDIAN_DEFAULT
|
||||
#define BE8_LINK_SPEC \
|
||||
" %{!mlittle-endian:%{march=armv7-a|mcpu=cortex-a5 \
|
||||
|mcpu=cortex-a7 \
|
||||
|mcpu=cortex-a8|mcpu=cortex-a9|mcpu=cortex-a15 \
|
||||
|mcpu=marvell-pj4 \
|
||||
|mcpu=generic-armv7-a \
|
||||
|march=armv7-m|mcpu=cortex-m3 \
|
||||
|march=armv7e-m|mcpu=cortex-m4 \
|
||||
|march=armv6-m|mcpu=cortex-m0 \
|
||||
|march=armv8-a \
|
||||
:%{!r:--be8}}}"
|
||||
#else
|
||||
#define BE8_LINK_SPEC \
|
||||
" %{mbig-endian:%{march=armv7-a|mcpu=cortex-a5 \
|
||||
|mcpu=cortex-a7 \
|
||||
|mcpu=cortex-a8|mcpu=cortex-a9|mcpu=cortex-a15 \
|
||||
|mcpu=marvell-pj4 \
|
||||
|mcpu=generic-armv7-a \
|
||||
|march=armv7-m|mcpu=cortex-m3 \
|
||||
|march=armv7e-m|mcpu=cortex-m4 \
|
||||
|march=armv6-m|mcpu=cortex-m0 \
|
||||
|march=armv8-a \
|
||||
:%{!r:--be8}}}"
|
||||
#endif
|
||||
|
||||
/* Tell the assembler to build BPABI binaries. */
|
||||
#undef SUBTARGET_EXTRA_ASM_SPEC
|
||||
#define SUBTARGET_EXTRA_ASM_SPEC \
|
||||
"%{mabi=apcs-gnu|mabi=atpcs:-meabi=gnu;:-meabi=5}" TARGET_FIX_V4BX_SPEC
|
||||
|
||||
#ifndef SUBTARGET_EXTRA_LINK_SPEC
|
||||
#define SUBTARGET_EXTRA_LINK_SPEC ""
|
||||
#endif
|
||||
|
||||
/* The generic link spec in elf.h does not support shared libraries. */
|
||||
#define BPABI_LINK_SPEC \
|
||||
"%{mbig-endian:-EB} %{mlittle-endian:-EL} " \
|
||||
"%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} " \
|
||||
"-X" SUBTARGET_EXTRA_LINK_SPEC TARGET_FIX_V4BX_SPEC BE8_LINK_SPEC
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC BPABI_LINK_SPEC
|
||||
|
||||
/* The BPABI requires that we always use an out-of-line implementation
|
||||
of RTTI comparison, even if the target supports weak symbols,
|
||||
because the same object file might be used on a target that does
|
||||
not support merging symbols across DLL boundaries. This macro is
|
||||
broken out separately so that it can be used within
|
||||
TARGET_OS_CPP_BUILTINS in configuration files for systems based on
|
||||
the BPABI. */
|
||||
#define TARGET_BPABI_CPP_BUILTINS() \
|
||||
do \
|
||||
{ \
|
||||
builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); \
|
||||
} \
|
||||
while (false)
|
||||
|
||||
#undef TARGET_OS_CPP_BUILTINS
|
||||
#define TARGET_OS_CPP_BUILTINS() \
|
||||
TARGET_BPABI_CPP_BUILTINS()
|
||||
|
||||
/* The BPABI specifies the use of .{init,fini}_array. Therefore, we
|
||||
do not want GCC to put anything into the .{init,fini} sections. */
|
||||
#undef INIT_SECTION_ASM_OP
|
||||
#undef FINI_SECTION_ASM_OP
|
||||
#define INIT_ARRAY_SECTION_ASM_OP ARM_EABI_CTORS_SECTION_OP
|
||||
#define FINI_ARRAY_SECTION_ASM_OP ARM_EABI_DTORS_SECTION_OP
|
||||
|
||||
/* The legacy _mcount implementation assumes r11 points to a
|
||||
4-word APCS frame. This is generally not true for EABI targets,
|
||||
particularly not in Thumb mode. We assume the mcount
|
||||
implementation does not require a counter variable (No Counter).
|
||||
Note that __gnu_mcount_nc will be entered with a misaligned stack.
|
||||
This is OK because it uses a special calling convention anyway. */
|
||||
|
||||
#undef NO_PROFILE_COUNTERS
|
||||
#define NO_PROFILE_COUNTERS 1
|
||||
#undef ARM_FUNCTION_PROFILER
|
||||
#define ARM_FUNCTION_PROFILER(STREAM, LABELNO) \
|
||||
{ \
|
||||
fprintf (STREAM, "\tpush\t{lr}\n"); \
|
||||
fprintf (STREAM, "\tbl\t__gnu_mcount_nc\n"); \
|
||||
}
|
||||
|
||||
#undef SUBTARGET_FRAME_POINTER_REQUIRED
|
||||
#define SUBTARGET_FRAME_POINTER_REQUIRED 0
|
||||
|
||||
/* __gnu_mcount_nc restores the original LR value before returning. Ensure
|
||||
that there is no unnecessary hook set up. */
|
||||
#undef PROFILE_HOOK
|
||||
|
|
@ -0,0 +1,159 @@
|
|||
/* Definitions of target machine for GNU compiler.
|
||||
For ARM with ELF obj format.
|
||||
Copyright (C) 1995-2013 Free Software Foundation, Inc.
|
||||
Contributed by Philip Blundell <philb@gnu.org> and
|
||||
Catherine Moore <clm@cygnus.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 3, or (at your
|
||||
option) any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef OBJECT_FORMAT_ELF
|
||||
#error elf.h included before elfos.h
|
||||
#endif
|
||||
|
||||
#ifndef LOCAL_LABEL_PREFIX
|
||||
#define LOCAL_LABEL_PREFIX "."
|
||||
#endif
|
||||
|
||||
#ifndef SUBTARGET_CPP_SPEC
|
||||
#define SUBTARGET_CPP_SPEC "-D__ELF__"
|
||||
#endif
|
||||
|
||||
#ifndef SUBTARGET_EXTRA_SPECS
|
||||
#define SUBTARGET_EXTRA_SPECS \
|
||||
{ "subtarget_extra_asm_spec", SUBTARGET_EXTRA_ASM_SPEC }, \
|
||||
{ "subtarget_asm_float_spec", SUBTARGET_ASM_FLOAT_SPEC }, \
|
||||
SUBSUBTARGET_EXTRA_SPECS
|
||||
#endif
|
||||
|
||||
#ifndef SUBTARGET_EXTRA_ASM_SPEC
|
||||
#define SUBTARGET_EXTRA_ASM_SPEC ""
|
||||
#endif
|
||||
|
||||
#ifndef SUBTARGET_ASM_FLOAT_SPEC
|
||||
#define SUBTARGET_ASM_FLOAT_SPEC "\
|
||||
%{mapcs-float:-mfloat}"
|
||||
#endif
|
||||
|
||||
#undef SUBSUBTARGET_EXTRA_SPECS
|
||||
#define SUBSUBTARGET_EXTRA_SPECS
|
||||
|
||||
#ifndef ASM_SPEC
|
||||
#define ASM_SPEC "\
|
||||
%{mbig-endian:-EB} \
|
||||
%{mlittle-endian:-EL} \
|
||||
%(asm_cpu_spec) \
|
||||
%{mapcs-*:-mapcs-%*} \
|
||||
%(subtarget_asm_float_spec) \
|
||||
%{mthumb-interwork:-mthumb-interwork} \
|
||||
%{mfloat-abi=*} %{mfpu=*} \
|
||||
%(subtarget_extra_asm_spec)"
|
||||
#endif
|
||||
|
||||
/* The ARM uses @ are a comment character so we need to redefine
|
||||
TYPE_OPERAND_FMT. */
|
||||
#undef TYPE_OPERAND_FMT
|
||||
#define TYPE_OPERAND_FMT "%%%s"
|
||||
|
||||
/* We might need a ARM specific header to function declarations. */
|
||||
#undef ASM_DECLARE_FUNCTION_NAME
|
||||
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
|
||||
do \
|
||||
{ \
|
||||
ARM_DECLARE_FUNCTION_NAME (FILE, NAME, DECL); \
|
||||
ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
|
||||
ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
|
||||
ASM_OUTPUT_LABEL(FILE, NAME); \
|
||||
ARM_OUTPUT_FN_UNWIND (FILE, TRUE); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* We might need an ARM specific trailer for function declarations. */
|
||||
#undef ASM_DECLARE_FUNCTION_SIZE
|
||||
#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
|
||||
do \
|
||||
{ \
|
||||
ARM_OUTPUT_FN_UNWIND (FILE, FALSE); \
|
||||
if (!flag_inhibit_size_directive) \
|
||||
ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* Define this macro if jump tables (for `tablejump' insns) should be
|
||||
output in the text section, along with the assembler instructions.
|
||||
Otherwise, the readonly data section is used. */
|
||||
/* We put ARM and Thumb-2 jump tables in the text section, because it makes
|
||||
the code more efficient, but for Thumb-1 it's better to put them out of
|
||||
band unless we are generating compressed tables. */
|
||||
#define JUMP_TABLES_IN_TEXT_SECTION \
|
||||
(TARGET_32BIT || (TARGET_THUMB && (optimize_size || flag_pic)))
|
||||
|
||||
#ifndef LINK_SPEC
|
||||
#define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} -X"
|
||||
#endif
|
||||
|
||||
/* Run-time Target Specification. */
|
||||
#ifndef TARGET_DEFAULT
|
||||
#define TARGET_DEFAULT (MASK_APCS_FRAME)
|
||||
#endif
|
||||
|
||||
#ifndef MULTILIB_DEFAULTS
|
||||
#define MULTILIB_DEFAULTS \
|
||||
{ "marm", "mlittle-endian", "mfloat-abi=soft", "mno-thumb-interwork", "fno-leading-underscore" }
|
||||
#endif
|
||||
|
||||
#define TARGET_ASM_FILE_START_APP_OFF true
|
||||
#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
|
||||
|
||||
|
||||
/* Output an element in the static constructor array. */
|
||||
#undef TARGET_ASM_CONSTRUCTOR
|
||||
#define TARGET_ASM_CONSTRUCTOR arm_elf_asm_constructor
|
||||
|
||||
#undef TARGET_ASM_DESTRUCTOR
|
||||
#define TARGET_ASM_DESTRUCTOR arm_elf_asm_destructor
|
||||
|
||||
/* For PIC code we need to explicitly specify (PLT) and (GOT) relocs. */
|
||||
#define NEED_PLT_RELOC flag_pic
|
||||
#define NEED_GOT_RELOC flag_pic
|
||||
|
||||
/* The ELF assembler handles GOT addressing differently to NetBSD. */
|
||||
#define GOT_PCREL 0
|
||||
|
||||
/* Align output to a power of two. Note ".align 0" is redundant,
|
||||
and also GAS will treat it as ".align 2" which we do not want. */
|
||||
#define ASM_OUTPUT_ALIGN(STREAM, POWER) \
|
||||
do \
|
||||
{ \
|
||||
if ((POWER) > 0) \
|
||||
fprintf (STREAM, "\t.align\t%d\n", POWER); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* Horrible hack: We want to prevent some libgcc routines being included
|
||||
for some multilibs. */
|
||||
#ifndef __ARM_ARCH_6M__
|
||||
#undef L_fixdfsi
|
||||
#undef L_fixunsdfsi
|
||||
#undef L_truncdfsf2
|
||||
#undef L_fixsfsi
|
||||
#undef L_fixunssfsi
|
||||
#undef L_floatdidf
|
||||
#undef L_floatdisf
|
||||
#undef L_floatundidf
|
||||
#undef L_floatundisf
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
/* Definitions for non-Linux based ARM systems using ELF
|
||||
Copyright (C) 1998-2013 Free Software Foundation, Inc.
|
||||
Contributed by Catherine Moore <clm@cygnus.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 3, or (at your
|
||||
option) any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* elfos.h should have already been included. Now just override
|
||||
any conflicting definitions and add any extras. */
|
||||
|
||||
/* Run-time Target Specification. */
|
||||
|
||||
/* Default to using software floating point. */
|
||||
#ifndef TARGET_DEFAULT
|
||||
#define TARGET_DEFAULT (0)
|
||||
#endif
|
||||
|
||||
/* Now we define the strings used to build the spec file. */
|
||||
#define UNKNOWN_ELF_STARTFILE_SPEC " crti%O%s crtbegin%O%s crt0%O%s"
|
||||
|
||||
#undef STARTFILE_SPEC
|
||||
#define STARTFILE_SPEC UNKNOWN_ELF_STARTFILE_SPEC
|
||||
|
||||
#define UNKNOWN_ELF_ENDFILE_SPEC "crtend%O%s crtn%O%s"
|
||||
|
||||
#undef ENDFILE_SPEC
|
||||
#define ENDFILE_SPEC UNKNOWN_ELF_ENDFILE_SPEC
|
||||
|
||||
/* The __USES_INITFINI__ define is tested in newlib/libc/sys/arm/crt0.S
|
||||
to see if it needs to invoked _init() and _fini(). */
|
||||
#undef SUBTARGET_CPP_SPEC
|
||||
#define SUBTARGET_CPP_SPEC "-D__USES_INITFINI__"
|
||||
|
||||
#undef PREFERRED_DEBUGGING_TYPE
|
||||
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
|
||||
|
||||
/* Return a nonzero value if DECL has a section attribute. */
|
||||
#define IN_NAMED_SECTION_P(DECL) \
|
||||
((TREE_CODE (DECL) == FUNCTION_DECL || TREE_CODE (DECL) == VAR_DECL) \
|
||||
&& DECL_SECTION_NAME (DECL) != NULL_TREE)
|
||||
|
||||
#undef ASM_OUTPUT_ALIGNED_BSS
|
||||
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
|
||||
do \
|
||||
{ \
|
||||
if (IN_NAMED_SECTION_P (DECL)) \
|
||||
switch_to_section (get_named_section (DECL, NULL, 0)); \
|
||||
else \
|
||||
switch_to_section (bss_section); \
|
||||
\
|
||||
ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \
|
||||
\
|
||||
last_assemble_variable_decl = DECL; \
|
||||
ASM_DECLARE_OBJECT_NAME (FILE, NAME, DECL); \
|
||||
ASM_OUTPUT_SKIP (FILE, SIZE ? (int)(SIZE) : 1); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#undef ASM_OUTPUT_ALIGNED_DECL_LOCAL
|
||||
#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \
|
||||
do \
|
||||
{ \
|
||||
if ((DECL) != NULL && IN_NAMED_SECTION_P (DECL)) \
|
||||
switch_to_section (get_named_section (DECL, NULL, 0)); \
|
||||
else \
|
||||
switch_to_section (bss_section); \
|
||||
\
|
||||
ASM_OUTPUT_ALIGN (FILE, floor_log2 (ALIGN / BITS_PER_UNIT)); \
|
||||
ASM_OUTPUT_LABEL (FILE, NAME); \
|
||||
fprintf (FILE, "\t.space\t%d\n", SIZE ? (int)(SIZE) : 1); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
#ifndef SUBTARGET_CPU_DEFAULT
|
||||
#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm7tdmi
|
||||
#endif
|
||||
|
||||
/* The libgcc udivmod functions may throw exceptions. If newlib is
|
||||
configured to support long longs in I/O, then printf will depend on
|
||||
udivmoddi4, which will depend on the exception unwind routines,
|
||||
which will depend on abort, which is defined in libc. */
|
||||
#undef LINK_GCC_C_SEQUENCE_SPEC
|
||||
#define LINK_GCC_C_SEQUENCE_SPEC "--start-group %G %L --end-group"
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
/* Definitions needed when using stabs embedded in ELF sections.
|
||||
Copyright (C) 1999-2013 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* This file may be included by any ELF target which wishes to
|
||||
support -gstabs generating stabs in sections, as produced by gas
|
||||
and understood by gdb. */
|
||||
|
||||
#ifndef GCC_DBX_ELF_H
|
||||
#define GCC_DBX_ELF_H
|
||||
|
||||
/* Output DBX (stabs) debugging information if doing -gstabs. */
|
||||
|
||||
#define DBX_DEBUGGING_INFO 1
|
||||
|
||||
/* Make LBRAC and RBRAC addresses relative to the start of the
|
||||
function. The native Solaris stabs debugging format works this
|
||||
way, gdb expects it, and it reduces the number of relocation
|
||||
entries... */
|
||||
|
||||
#define DBX_BLOCKS_FUNCTION_RELATIVE 1
|
||||
|
||||
/* ... but, to make this work, functions must appear prior to line info. */
|
||||
|
||||
#define DBX_FUNCTION_FIRST
|
||||
|
||||
/* When generating stabs debugging, use N_BINCL entries. */
|
||||
|
||||
#define DBX_USE_BINCL
|
||||
|
||||
/* There is no limit to the length of stabs strings. */
|
||||
|
||||
#ifndef DBX_CONTIN_LENGTH
|
||||
#define DBX_CONTIN_LENGTH 0
|
||||
#endif
|
||||
|
||||
/* Like block addresses, stabs line numbers are relative to the
|
||||
current function. */
|
||||
|
||||
#define DBX_LINES_FUNCTION_RELATIVE 1
|
||||
|
||||
/* Generate a blank trailing N_SO to mark the end of the .o file, since
|
||||
we can't depend upon the linker to mark .o file boundaries with
|
||||
embedded stabs. */
|
||||
|
||||
#define DBX_OUTPUT_NULL_N_SO_AT_MAIN_SOURCE_FILE_END
|
||||
|
||||
#endif /* ! GCC_DBX_ELF_H */
|
||||
|
|
@ -0,0 +1,435 @@
|
|||
/* elfos.h -- operating system specific defines to be used when
|
||||
targeting GCC for some generic ELF system
|
||||
Copyright (C) 1991-2013 Free Software Foundation, Inc.
|
||||
Based on svr4.h contributed by Ron Guilmette (rfg@netcom.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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#define TARGET_OBJFMT_CPP_BUILTINS() \
|
||||
do \
|
||||
{ \
|
||||
builtin_define ("__ELF__"); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* Define a symbol indicating that we are using elfos.h.
|
||||
Some CPU specific configuration files use this. */
|
||||
#define USING_ELFOS_H
|
||||
|
||||
/* The prefix to add to user-visible assembler symbols.
|
||||
|
||||
For ELF systems the convention is *not* to prepend a leading
|
||||
underscore onto user-level symbol names. */
|
||||
|
||||
#undef USER_LABEL_PREFIX
|
||||
#define USER_LABEL_PREFIX ""
|
||||
|
||||
/* The biggest alignment supported by ELF in bits. 32-bit ELF
|
||||
supports section alignment up to (0x80000000 * 8), while
|
||||
64-bit ELF supports (0x8000000000000000 * 8). If this macro
|
||||
is not defined, the default is the largest alignment supported
|
||||
by 32-bit ELF and representable on a 32-bit host. Use this
|
||||
macro to limit the alignment which can be specified using
|
||||
the `__attribute__ ((aligned (N)))' construct. */
|
||||
#ifndef MAX_OFILE_ALIGNMENT
|
||||
#define MAX_OFILE_ALIGNMENT (((unsigned int) 1 << 28) * 8)
|
||||
#endif
|
||||
|
||||
/* Use periods rather than dollar signs in special g++ assembler names. */
|
||||
|
||||
#define NO_DOLLAR_IN_LABEL
|
||||
|
||||
/* Writing `int' for a bit-field forces int alignment for the structure. */
|
||||
|
||||
#ifndef PCC_BITFIELD_TYPE_MATTERS
|
||||
#define PCC_BITFIELD_TYPE_MATTERS 1
|
||||
#endif
|
||||
|
||||
/* All ELF targets can support DWARF-2. */
|
||||
|
||||
#define DWARF2_DEBUGGING_INFO 1
|
||||
|
||||
/* The GNU tools operate better with dwarf2, and it is required by some
|
||||
psABI's. Since we don't have any native tools to be compatible with,
|
||||
default to dwarf2. */
|
||||
|
||||
#ifndef PREFERRED_DEBUGGING_TYPE
|
||||
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
|
||||
#endif
|
||||
|
||||
/* All SVR4 targets use the ELF object file format. */
|
||||
#define OBJECT_FORMAT_ELF
|
||||
|
||||
|
||||
/* Output #ident as a .ident. */
|
||||
|
||||
#undef TARGET_ASM_OUTPUT_IDENT
|
||||
#define TARGET_ASM_OUTPUT_IDENT default_asm_output_ident_directive
|
||||
|
||||
#undef SET_ASM_OP
|
||||
#define SET_ASM_OP "\t.set\t"
|
||||
|
||||
/* Most svr4 assemblers want a .file directive at the beginning of
|
||||
their input file. */
|
||||
#define TARGET_ASM_FILE_START_FILE_DIRECTIVE true
|
||||
|
||||
/* This is how to allocate empty space in some section. The .zero
|
||||
pseudo-op is used for this on most svr4 assemblers. */
|
||||
|
||||
#define SKIP_ASM_OP "\t.zero\t"
|
||||
|
||||
#undef ASM_OUTPUT_SKIP
|
||||
#define ASM_OUTPUT_SKIP(FILE, SIZE) \
|
||||
fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\
|
||||
SKIP_ASM_OP, (SIZE))
|
||||
|
||||
/* This is how to store into the string LABEL
|
||||
the symbol_ref name of an internal numbered label where
|
||||
PREFIX is the class of label and NUM is the number within the class.
|
||||
This is suitable for output with `assemble_name'.
|
||||
|
||||
For most svr4 systems, the convention is that any symbol which begins
|
||||
with a period is not put into the linker symbol table by the assembler. */
|
||||
|
||||
#undef ASM_GENERATE_INTERNAL_LABEL
|
||||
#define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
|
||||
do \
|
||||
{ \
|
||||
char *__p; \
|
||||
(LABEL)[0] = '*'; \
|
||||
(LABEL)[1] = '.'; \
|
||||
__p = stpcpy (&(LABEL)[2], PREFIX); \
|
||||
sprint_ul (__p, (unsigned long) (NUM)); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* Output the label which precedes a jumptable. Note that for all svr4
|
||||
systems where we actually generate jumptables (which is to say every
|
||||
svr4 target except i386, where we use casesi instead) we put the jump-
|
||||
tables into the .rodata section and since other stuff could have been
|
||||
put into the .rodata section prior to any given jumptable, we have to
|
||||
make sure that the location counter for the .rodata section gets pro-
|
||||
perly re-aligned prior to the actual beginning of the jump table. */
|
||||
|
||||
#undef ALIGN_ASM_OP
|
||||
#define ALIGN_ASM_OP "\t.align\t"
|
||||
|
||||
#ifndef ASM_OUTPUT_BEFORE_CASE_LABEL
|
||||
#define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE, PREFIX, NUM, TABLE) \
|
||||
ASM_OUTPUT_ALIGN ((FILE), 2);
|
||||
#endif
|
||||
|
||||
#undef ASM_OUTPUT_CASE_LABEL
|
||||
#define ASM_OUTPUT_CASE_LABEL(FILE, PREFIX, NUM, JUMPTABLE) \
|
||||
do \
|
||||
{ \
|
||||
ASM_OUTPUT_BEFORE_CASE_LABEL (FILE, PREFIX, NUM, JUMPTABLE) \
|
||||
(*targetm.asm_out.internal_label) (FILE, PREFIX, NUM); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* The standard SVR4 assembler seems to require that certain builtin
|
||||
library routines (e.g. .udiv) be explicitly declared as .globl
|
||||
in each assembly file where they are referenced. */
|
||||
|
||||
#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
|
||||
(*targetm.asm_out.globalize_label) (FILE, XSTR (FUN, 0))
|
||||
|
||||
/* This says how to output assembler code to declare an
|
||||
uninitialized external linkage data object. Under SVR4,
|
||||
the linker seems to want the alignment of data objects
|
||||
to depend on their types. We do exactly that here. */
|
||||
|
||||
#define COMMON_ASM_OP "\t.comm\t"
|
||||
|
||||
#undef ASM_OUTPUT_ALIGNED_COMMON
|
||||
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
|
||||
do \
|
||||
{ \
|
||||
fprintf ((FILE), "%s", COMMON_ASM_OP); \
|
||||
assemble_name ((FILE), (NAME)); \
|
||||
fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n", \
|
||||
(SIZE), (ALIGN) / BITS_PER_UNIT); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* This says how to output assembler code to declare an
|
||||
uninitialized internal linkage data object. Under SVR4,
|
||||
the linker seems to want the alignment of data objects
|
||||
to depend on their types. We do exactly that here. */
|
||||
|
||||
#define LOCAL_ASM_OP "\t.local\t"
|
||||
|
||||
#undef ASM_OUTPUT_ALIGNED_LOCAL
|
||||
#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \
|
||||
do \
|
||||
{ \
|
||||
fprintf ((FILE), "%s", LOCAL_ASM_OP); \
|
||||
assemble_name ((FILE), (NAME)); \
|
||||
fprintf ((FILE), "\n"); \
|
||||
ASM_OUTPUT_ALIGNED_COMMON (FILE, NAME, SIZE, ALIGN); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* This is the pseudo-op used to generate a contiguous sequence of byte
|
||||
values from a double-quoted string WITHOUT HAVING A TERMINATING NUL
|
||||
AUTOMATICALLY APPENDED. This is the same for most svr4 assemblers. */
|
||||
|
||||
#undef ASCII_DATA_ASM_OP
|
||||
#define ASCII_DATA_ASM_OP "\t.ascii\t"
|
||||
|
||||
/* Support a read-only data section. */
|
||||
#define READONLY_DATA_SECTION_ASM_OP "\t.section\t.rodata"
|
||||
|
||||
/* On svr4, we *do* have support for the .init and .fini sections, and we
|
||||
can put stuff in there to be executed before and after `main'. We let
|
||||
crtstuff.c and other files know this by defining the following symbols.
|
||||
The definitions say how to change sections to the .init and .fini
|
||||
sections. This is the same for all known svr4 assemblers. */
|
||||
|
||||
#define INIT_SECTION_ASM_OP "\t.section\t.init"
|
||||
#define FINI_SECTION_ASM_OP "\t.section\t.fini"
|
||||
|
||||
/* Output assembly directive to move to the beginning of current section. */
|
||||
#ifdef HAVE_GAS_SUBSECTION_ORDERING
|
||||
# define ASM_SECTION_START_OP "\t.subsection\t-1"
|
||||
# define ASM_OUTPUT_SECTION_START(FILE) \
|
||||
fprintf ((FILE), "%s\n", ASM_SECTION_START_OP)
|
||||
#endif
|
||||
|
||||
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
|
||||
|
||||
/* Switch into a generic section. */
|
||||
#define TARGET_ASM_NAMED_SECTION default_elf_asm_named_section
|
||||
|
||||
#undef TARGET_ASM_SELECT_RTX_SECTION
|
||||
#define TARGET_ASM_SELECT_RTX_SECTION default_elf_select_rtx_section
|
||||
#undef TARGET_ASM_SELECT_SECTION
|
||||
#define TARGET_ASM_SELECT_SECTION default_elf_select_section
|
||||
#undef TARGET_HAVE_SWITCHABLE_BSS_SECTIONS
|
||||
#define TARGET_HAVE_SWITCHABLE_BSS_SECTIONS true
|
||||
|
||||
/* Define the strings used for the special svr4 .type and .size directives.
|
||||
These strings generally do not vary from one system running svr4 to
|
||||
another, but if a given system (e.g. m88k running svr) needs to use
|
||||
different pseudo-op names for these, they may be overridden in the
|
||||
file which includes this one. */
|
||||
|
||||
#define TYPE_ASM_OP "\t.type\t"
|
||||
#define SIZE_ASM_OP "\t.size\t"
|
||||
|
||||
/* This is how we tell the assembler that a symbol is weak. */
|
||||
|
||||
#define ASM_WEAKEN_LABEL(FILE, NAME) \
|
||||
do \
|
||||
{ \
|
||||
fputs ("\t.weak\t", (FILE)); \
|
||||
assemble_name ((FILE), (NAME)); \
|
||||
fputc ('\n', (FILE)); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* The following macro defines the format used to output the second
|
||||
operand of the .type assembler directive. Different svr4 assemblers
|
||||
expect various different forms for this operand. The one given here
|
||||
is just a default. You may need to override it in your machine-
|
||||
specific tm.h file (depending upon the particulars of your assembler). */
|
||||
|
||||
#define TYPE_OPERAND_FMT "@%s"
|
||||
|
||||
/* Write the extra assembler code needed to declare a function's result.
|
||||
Most svr4 assemblers don't require any special declaration of the
|
||||
result value, but there are exceptions. */
|
||||
|
||||
#ifndef ASM_DECLARE_RESULT
|
||||
#define ASM_DECLARE_RESULT(FILE, RESULT)
|
||||
#endif
|
||||
|
||||
/* These macros generate the special .type and .size directives which
|
||||
are used to set the corresponding fields of the linker symbol table
|
||||
entries in an ELF object file under SVR4. These macros also output
|
||||
the starting labels for the relevant functions/objects. */
|
||||
|
||||
/* Write the extra assembler code needed to declare a function properly.
|
||||
Some svr4 assemblers need to also have something extra said about the
|
||||
function's return value. We allow for that here. */
|
||||
|
||||
#ifndef ASM_DECLARE_FUNCTION_NAME
|
||||
#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
|
||||
do \
|
||||
{ \
|
||||
ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \
|
||||
ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \
|
||||
ASM_OUTPUT_FUNCTION_LABEL (FILE, NAME, DECL); \
|
||||
} \
|
||||
while (0)
|
||||
#endif
|
||||
|
||||
/* Write the extra assembler code needed to declare an object properly. */
|
||||
|
||||
#ifdef HAVE_GAS_GNU_UNIQUE_OBJECT
|
||||
#define USE_GNU_UNIQUE_OBJECT 1
|
||||
#else
|
||||
#define USE_GNU_UNIQUE_OBJECT 0
|
||||
#endif
|
||||
|
||||
#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \
|
||||
do \
|
||||
{ \
|
||||
HOST_WIDE_INT size; \
|
||||
\
|
||||
/* For template static data member instantiations or \
|
||||
inline fn local statics and their guard variables, use \
|
||||
gnu_unique_object so that they will be combined even under \
|
||||
RTLD_LOCAL. Don't use gnu_unique_object for typeinfo, \
|
||||
vtables and other read-only artificial decls. */ \
|
||||
if (USE_GNU_UNIQUE_OBJECT && DECL_ONE_ONLY (DECL) \
|
||||
&& (!DECL_ARTIFICIAL (DECL) || !TREE_READONLY (DECL))) \
|
||||
ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "gnu_unique_object"); \
|
||||
else \
|
||||
ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \
|
||||
\
|
||||
size_directive_output = 0; \
|
||||
if (!flag_inhibit_size_directive \
|
||||
&& (DECL) && DECL_SIZE (DECL)) \
|
||||
{ \
|
||||
size_directive_output = 1; \
|
||||
size = int_size_in_bytes (TREE_TYPE (DECL)); \
|
||||
ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \
|
||||
} \
|
||||
\
|
||||
ASM_OUTPUT_LABEL (FILE, NAME); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* Output the size directive for a decl in rest_of_decl_compilation
|
||||
in the case where we did not do so before the initializer.
|
||||
Once we find the error_mark_node, we know that the value of
|
||||
size_directive_output was set
|
||||
by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */
|
||||
|
||||
#undef ASM_FINISH_DECLARE_OBJECT
|
||||
#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END)\
|
||||
do \
|
||||
{ \
|
||||
const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
|
||||
HOST_WIDE_INT size; \
|
||||
\
|
||||
if (!flag_inhibit_size_directive \
|
||||
&& DECL_SIZE (DECL) \
|
||||
&& ! AT_END && TOP_LEVEL \
|
||||
&& DECL_INITIAL (DECL) == error_mark_node \
|
||||
&& !size_directive_output) \
|
||||
{ \
|
||||
size_directive_output = 1; \
|
||||
size = int_size_in_bytes (TREE_TYPE (DECL)); \
|
||||
ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size); \
|
||||
} \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* This is how to declare the size of a function. */
|
||||
#ifndef ASM_DECLARE_FUNCTION_SIZE
|
||||
#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
|
||||
do \
|
||||
{ \
|
||||
if (!flag_inhibit_size_directive) \
|
||||
ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \
|
||||
} \
|
||||
while (0)
|
||||
#endif
|
||||
|
||||
/* A table of bytes codes used by the ASM_OUTPUT_ASCII and
|
||||
ASM_OUTPUT_LIMITED_STRING macros. Each byte in the table
|
||||
corresponds to a particular byte value [0..255]. For any
|
||||
given byte value, if the value in the corresponding table
|
||||
position is zero, the given character can be output directly.
|
||||
If the table value is 1, the byte must be output as a \ooo
|
||||
octal escape. If the tables value is anything else, then the
|
||||
byte value should be output as a \ followed by the value
|
||||
in the table. Note that we can use standard UN*X escape
|
||||
sequences for many control characters, but we don't use
|
||||
\a to represent BEL because some svr4 assemblers (e.g. on
|
||||
the i386) don't know about that. Also, we don't use \v
|
||||
since some versions of gas, such as 2.2 did not accept it. */
|
||||
|
||||
#define ELF_ASCII_ESCAPES \
|
||||
"\1\1\1\1\1\1\1\1btn\1fr\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
|
||||
\0\0\"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
|
||||
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\\\0\0\0\
|
||||
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\
|
||||
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
|
||||
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
|
||||
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\
|
||||
\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1\1"
|
||||
|
||||
/* Some svr4 assemblers have a limit on the number of characters which
|
||||
can appear in the operand of a .string directive. If your assembler
|
||||
has such a limitation, you should define STRING_LIMIT to reflect that
|
||||
limit. Note that at least some svr4 assemblers have a limit on the
|
||||
actual number of bytes in the double-quoted string, and that they
|
||||
count each character in an escape sequence as one byte. Thus, an
|
||||
escape sequence like \377 would count as four bytes.
|
||||
|
||||
If your target assembler doesn't support the .string directive, you
|
||||
should define this to zero.
|
||||
*/
|
||||
|
||||
#define ELF_STRING_LIMIT ((unsigned) 256)
|
||||
|
||||
#define STRING_ASM_OP "\t.string\t"
|
||||
|
||||
/* The routine used to output NUL terminated strings. We use a special
|
||||
version of this for most svr4 targets because doing so makes the
|
||||
generated assembly code more compact (and thus faster to assemble)
|
||||
as well as more readable, especially for targets like the i386
|
||||
(where the only alternative is to output character sequences as
|
||||
comma separated lists of numbers). */
|
||||
|
||||
#define ASM_OUTPUT_LIMITED_STRING(FILE, STR) \
|
||||
default_elf_asm_output_limited_string ((FILE), (STR))
|
||||
|
||||
/* The routine used to output sequences of byte values. We use a special
|
||||
version of this for most svr4 targets because doing so makes the
|
||||
generated assembly code more compact (and thus faster to assemble)
|
||||
as well as more readable. Note that if we find subparts of the
|
||||
character sequence which end with NUL (and which are shorter than
|
||||
STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */
|
||||
|
||||
#undef ASM_OUTPUT_ASCII
|
||||
#define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
|
||||
default_elf_asm_output_ascii ((FILE), (STR), (LENGTH));
|
||||
|
||||
/* Allow the use of the -frecord-gcc-switches switch via the
|
||||
elf_record_gcc_switches function defined in varasm.c. */
|
||||
#undef TARGET_ASM_RECORD_GCC_SWITCHES
|
||||
#define TARGET_ASM_RECORD_GCC_SWITCHES elf_record_gcc_switches
|
||||
|
||||
/* A C statement (sans semicolon) to output to the stdio stream STREAM
|
||||
any text necessary for declaring the name of an external symbol
|
||||
named NAME which is referenced in this compilation but not defined.
|
||||
It is needed to properly support non-default visibility. */
|
||||
|
||||
#ifndef ASM_OUTPUT_EXTERNAL
|
||||
#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
|
||||
default_elf_asm_output_external (FILE, DECL, NAME)
|
||||
#endif
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
/* Definitions for ELF systems with .init_array/.fini_array section
|
||||
support.
|
||||
Copyright (C) 2011-2013 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 3, or (at your
|
||||
option) any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
|
||||
License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifdef HAVE_INITFINI_ARRAY_SUPPORT
|
||||
|
||||
#define USE_INITFINI_ARRAY
|
||||
|
||||
#undef INIT_SECTION_ASM_OP
|
||||
#undef FINI_SECTION_ASM_OP
|
||||
|
||||
#undef INIT_ARRAY_SECTION_ASM_OP
|
||||
#define INIT_ARRAY_SECTION_ASM_OP
|
||||
|
||||
#undef FINI_ARRAY_SECTION_ASM_OP
|
||||
#define FINI_ARRAY_SECTION_ASM_OP
|
||||
|
||||
/* Use .init_array/.fini_array section for constructors and destructors. */
|
||||
#undef TARGET_ASM_CONSTRUCTOR
|
||||
#define TARGET_ASM_CONSTRUCTOR default_elf_init_array_asm_out_constructor
|
||||
#undef TARGET_ASM_DESTRUCTOR
|
||||
#define TARGET_ASM_DESTRUCTOR default_elf_fini_array_asm_out_destructor
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
/* Definitions for <stdint.h> types on systems using newlib.
|
||||
Copyright (C) 2008-2013 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* newlib uses 32-bit long in certain cases for all non-SPU
|
||||
targets. */
|
||||
#ifndef STDINT_LONG32
|
||||
#define STDINT_LONG32 (LONG_TYPE_SIZE == 32)
|
||||
#endif
|
||||
|
||||
#define SIG_ATOMIC_TYPE "int"
|
||||
|
||||
/* The newlib logic actually checks for sizes greater than 32 rather
|
||||
than equal to 64 for various 64-bit types. */
|
||||
|
||||
#define INT8_TYPE (CHAR_TYPE_SIZE == 8 ? "signed char" : 0)
|
||||
#define INT16_TYPE (SHORT_TYPE_SIZE == 16 ? "short int" : INT_TYPE_SIZE == 16 ? "int" : CHAR_TYPE_SIZE == 16 ? "signed char" : 0)
|
||||
#define INT32_TYPE (STDINT_LONG32 ? "long int" : INT_TYPE_SIZE == 32 ? "int" : SHORT_TYPE_SIZE == 32 ? "short int" : CHAR_TYPE_SIZE == 32 ? "signed char" : 0)
|
||||
#define INT64_TYPE (LONG_TYPE_SIZE == 64 ? "long int" : LONG_LONG_TYPE_SIZE == 64 ? "long long int" : INT_TYPE_SIZE == 64 ? "int" : 0)
|
||||
#define UINT8_TYPE (CHAR_TYPE_SIZE == 8 ? "unsigned char" : 0)
|
||||
#define UINT16_TYPE (SHORT_TYPE_SIZE == 16 ? "short unsigned int" : INT_TYPE_SIZE == 16 ? "unsigned int" : CHAR_TYPE_SIZE == 16 ? "unsigned char" : 0)
|
||||
#define UINT32_TYPE (STDINT_LONG32 ? "long unsigned int" : INT_TYPE_SIZE == 32 ? "unsigned int" : SHORT_TYPE_SIZE == 32 ? "short unsigned int" : CHAR_TYPE_SIZE == 32 ? "unsigned char" : 0)
|
||||
#define UINT64_TYPE (LONG_TYPE_SIZE == 64 ? "long unsigned int" : LONG_LONG_TYPE_SIZE == 64 ? "long long unsigned int" : INT_TYPE_SIZE == 64 ? "unsigned int" : 0)
|
||||
|
||||
#define INT_LEAST8_TYPE (INT8_TYPE ? INT8_TYPE : INT16_TYPE ? INT16_TYPE : INT32_TYPE ? INT32_TYPE : INT64_TYPE ? INT64_TYPE : 0)
|
||||
#define INT_LEAST16_TYPE (INT16_TYPE ? INT16_TYPE : INT32_TYPE ? INT32_TYPE : INT64_TYPE ? INT64_TYPE : 0)
|
||||
#define INT_LEAST32_TYPE (INT32_TYPE ? INT32_TYPE : INT64_TYPE ? INT64_TYPE : 0)
|
||||
#define INT_LEAST64_TYPE INT64_TYPE
|
||||
#define UINT_LEAST8_TYPE (UINT8_TYPE ? UINT8_TYPE : UINT16_TYPE ? UINT16_TYPE : UINT32_TYPE ? UINT32_TYPE : UINT64_TYPE ? UINT64_TYPE : 0)
|
||||
#define UINT_LEAST16_TYPE (UINT16_TYPE ? UINT16_TYPE : UINT32_TYPE ? UINT32_TYPE : UINT64_TYPE ? UINT64_TYPE : 0)
|
||||
#define UINT_LEAST32_TYPE (UINT32_TYPE ? UINT32_TYPE : UINT64_TYPE ? UINT64_TYPE : 0)
|
||||
#define UINT_LEAST64_TYPE UINT64_TYPE
|
||||
|
||||
#define INT_FAST8_TYPE (INT_TYPE_SIZE >= 8 ? "int" : INT_LEAST8_TYPE)
|
||||
#define INT_FAST16_TYPE (INT_TYPE_SIZE >= 16 ? "int" : INT_LEAST16_TYPE)
|
||||
#define INT_FAST32_TYPE (INT_TYPE_SIZE >= 32 ? "int" : INT_LEAST32_TYPE)
|
||||
#define INT_FAST64_TYPE (INT_TYPE_SIZE >= 64 ? "int" : INT_LEAST64_TYPE)
|
||||
#define UINT_FAST8_TYPE (INT_TYPE_SIZE >= 8 ? "unsigned int" : UINT_LEAST8_TYPE)
|
||||
#define UINT_FAST16_TYPE (INT_TYPE_SIZE >= 16 ? "unsigned int" : UINT_LEAST16_TYPE)
|
||||
#define UINT_FAST32_TYPE (INT_TYPE_SIZE >= 32 ? "unsigned int" : UINT_LEAST32_TYPE)
|
||||
#define UINT_FAST64_TYPE (INT_TYPE_SIZE >= 64 ? "unsigned int" : UINT_LEAST64_TYPE)
|
||||
|
||||
/* Newlib uses the unsigned type corresponding to ptrdiff_t for
|
||||
uintptr_t; this is the same as size_t for most newlib-using
|
||||
targets. */
|
||||
#define INTPTR_TYPE PTRDIFF_TYPE
|
||||
#ifndef UINTPTR_TYPE
|
||||
#define UINTPTR_TYPE SIZE_TYPE
|
||||
#endif
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
/* Dummy definitions of VxWorks-related macros
|
||||
Copyright (C) 2007-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* True if we're targeting VxWorks. */
|
||||
#ifndef TARGET_VXWORKS
|
||||
#define TARGET_VXWORKS 0
|
||||
#endif
|
||||
|
||||
/* True if generating code for a VxWorks RTP. */
|
||||
#ifndef TARGET_VXWORKS_RTP
|
||||
#define TARGET_VXWORKS_RTP false
|
||||
#endif
|
||||
|
||||
/* The symbol that points to an RTP's table of GOTs. */
|
||||
#define VXWORKS_GOTT_BASE (gcc_unreachable (), "")
|
||||
|
||||
/* The symbol that holds the index of the current module's GOT in
|
||||
VXWORKS_GOTT_BASE. */
|
||||
#define VXWORKS_GOTT_INDEX (gcc_unreachable (), "")
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
/* Generated automatically. */
|
||||
static const char configuration_arguments[] = "/home/build/work/GCC-4-8-build/src/gcc/configure --target=arm-none-eabi --prefix=/home/build/work/GCC-4-8-build/install-native --libexecdir=/home/build/work/GCC-4-8-build/install-native/lib --infodir=/home/build/work/GCC-4-8-build/install-native/share/doc/gcc-arm-none-eabi/info --mandir=/home/build/work/GCC-4-8-build/install-native/share/doc/gcc-arm-none-eabi/man --htmldir=/home/build/work/GCC-4-8-build/install-native/share/doc/gcc-arm-none-eabi/html --pdfdir=/home/build/work/GCC-4-8-build/install-native/share/doc/gcc-arm-none-eabi/pdf --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --with-python-dir=share/gcc-arm-none-eabi --with-sysroot=/home/build/work/GCC-4-8-build/install-native/arm-none-eabi --build=i686-linux-gnu --host=i686-linux-gnu --with-gmp=/home/build/work/GCC-4-8-build/build-native/host-libs/usr --with-mpfr=/home/build/work/GCC-4-8-build/build-native/host-libs/usr --with-mpc=/home/build/work/GCC-4-8-build/build-native/host-libs/usr --with-isl=/home/build/work/GCC-4-8-build/build-native/host-libs/usr --with-cloog=/home/build/work/GCC-4-8-build/build-native/host-libs/usr --with-libelf=/home/build/work/GCC-4-8-build/build-native/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors' --with-multilib-list=armv6-m,armv7-m,armv7e-m,armv7-r";
|
||||
static const char thread_model[] = "single";
|
||||
|
||||
static const struct {
|
||||
const char *name, *value;
|
||||
} configure_default_options[] = { { NULL, NULL} };
|
||||
|
|
@ -0,0 +1,208 @@
|
|||
/* GCC core type declarations.
|
||||
Copyright (C) 2002-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
Under Section 7 of GPL version 3, you are granted additional
|
||||
permissions described in the GCC Runtime Library Exception, version
|
||||
3.1, as published by the Free Software Foundation.
|
||||
|
||||
You should have received a copy of the GNU General Public License and
|
||||
a copy of the GCC Runtime Library Exception along with this program;
|
||||
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* Provide forward declarations of core types which are referred to by
|
||||
most of the compiler. This allows header files to use these types
|
||||
(e.g. in function prototypes) without concern for whether the full
|
||||
definitions are visible. Some other declarations that need to be
|
||||
universally visible are here, too.
|
||||
|
||||
In the context of tconfig.h, most of these have special definitions
|
||||
which prevent them from being used except in further type
|
||||
declarations. This is a kludge; the right thing is to avoid
|
||||
including the "tm.h" header set in the context of tconfig.h, but
|
||||
we're not there yet. */
|
||||
|
||||
#ifndef GCC_CORETYPES_H
|
||||
#define GCC_CORETYPES_H
|
||||
|
||||
#ifndef GTY
|
||||
#define GTY(x) /* nothing - marker for gengtype */
|
||||
#endif
|
||||
|
||||
#ifndef USED_FOR_TARGET
|
||||
|
||||
struct bitmap_head_def;
|
||||
typedef struct bitmap_head_def *bitmap;
|
||||
typedef const struct bitmap_head_def *const_bitmap;
|
||||
struct simple_bitmap_def;
|
||||
typedef struct simple_bitmap_def *sbitmap;
|
||||
typedef const struct simple_bitmap_def *const_sbitmap;
|
||||
struct rtx_def;
|
||||
typedef struct rtx_def *rtx;
|
||||
typedef const struct rtx_def *const_rtx;
|
||||
struct rtvec_def;
|
||||
typedef struct rtvec_def *rtvec;
|
||||
typedef const struct rtvec_def *const_rtvec;
|
||||
union tree_node;
|
||||
typedef union tree_node *tree;
|
||||
typedef const union tree_node *const_tree;
|
||||
union gimple_statement_d;
|
||||
typedef union gimple_statement_d *gimple;
|
||||
typedef const union gimple_statement_d *const_gimple;
|
||||
typedef gimple gimple_seq;
|
||||
union section;
|
||||
typedef union section section;
|
||||
struct gcc_options;
|
||||
struct cl_target_option;
|
||||
struct cl_optimization;
|
||||
struct cl_option;
|
||||
struct cl_decoded_option;
|
||||
struct cl_option_handlers;
|
||||
struct diagnostic_context;
|
||||
typedef struct diagnostic_context diagnostic_context;
|
||||
struct pretty_print_info;
|
||||
typedef struct pretty_print_info pretty_printer;
|
||||
|
||||
/* Address space number for named address space support. */
|
||||
typedef unsigned char addr_space_t;
|
||||
|
||||
/* The value of addr_space_t that represents the generic address space. */
|
||||
#define ADDR_SPACE_GENERIC 0
|
||||
#define ADDR_SPACE_GENERIC_P(AS) ((AS) == ADDR_SPACE_GENERIC)
|
||||
|
||||
/* The major intermediate representations of GCC. */
|
||||
enum ir_type {
|
||||
IR_GIMPLE,
|
||||
IR_RTL_CFGRTL,
|
||||
IR_RTL_CFGLAYOUT
|
||||
};
|
||||
|
||||
/* Provide forward struct declaration so that we don't have to include
|
||||
all of cpplib.h whenever a random prototype includes a pointer.
|
||||
Note that the cpp_reader and cpp_token typedefs remain part of
|
||||
cpplib.h. */
|
||||
|
||||
struct cpp_reader;
|
||||
struct cpp_token;
|
||||
|
||||
/* The thread-local storage model associated with a given VAR_DECL
|
||||
or SYMBOL_REF. This isn't used much, but both trees and RTL refer
|
||||
to it, so it's here. */
|
||||
enum tls_model {
|
||||
TLS_MODEL_NONE,
|
||||
TLS_MODEL_EMULATED,
|
||||
TLS_MODEL_REAL,
|
||||
TLS_MODEL_GLOBAL_DYNAMIC = TLS_MODEL_REAL,
|
||||
TLS_MODEL_LOCAL_DYNAMIC,
|
||||
TLS_MODEL_INITIAL_EXEC,
|
||||
TLS_MODEL_LOCAL_EXEC
|
||||
};
|
||||
|
||||
/* Types of unwind/exception handling info that can be generated. */
|
||||
|
||||
enum unwind_info_type
|
||||
{
|
||||
UI_NONE,
|
||||
UI_SJLJ,
|
||||
UI_DWARF2,
|
||||
UI_TARGET,
|
||||
UI_SEH
|
||||
};
|
||||
|
||||
/* Callgraph node profile representation. */
|
||||
enum node_frequency {
|
||||
/* This function most likely won't be executed at all.
|
||||
(set only when profile feedback is available or via function attribute). */
|
||||
NODE_FREQUENCY_UNLIKELY_EXECUTED,
|
||||
/* For functions that are known to be executed once (i.e. constructors, destructors
|
||||
and main function. */
|
||||
NODE_FREQUENCY_EXECUTED_ONCE,
|
||||
/* The default value. */
|
||||
NODE_FREQUENCY_NORMAL,
|
||||
/* Optimize this function hard
|
||||
(set only when profile feedback is available or via function attribute). */
|
||||
NODE_FREQUENCY_HOT
|
||||
};
|
||||
|
||||
/* Possible initialization status of a variable. When requested
|
||||
by the user, this information is tracked and recorded in the DWARF
|
||||
debug information, along with the variable's location. */
|
||||
enum var_init_status
|
||||
{
|
||||
VAR_INIT_STATUS_UNKNOWN,
|
||||
VAR_INIT_STATUS_UNINITIALIZED,
|
||||
VAR_INIT_STATUS_INITIALIZED
|
||||
};
|
||||
|
||||
|
||||
struct edge_def;
|
||||
typedef struct edge_def *edge;
|
||||
typedef const struct edge_def *const_edge;
|
||||
struct basic_block_def;
|
||||
typedef struct basic_block_def *basic_block;
|
||||
typedef const struct basic_block_def *const_basic_block;
|
||||
|
||||
#define obstack_chunk_alloc ((void *(*) (long)) xmalloc)
|
||||
#define obstack_chunk_free ((void (*) (void *)) free)
|
||||
#define OBSTACK_CHUNK_SIZE 0
|
||||
#define gcc_obstack_init(OBSTACK) \
|
||||
_obstack_begin ((OBSTACK), OBSTACK_CHUNK_SIZE, 0, \
|
||||
obstack_chunk_alloc, \
|
||||
obstack_chunk_free)
|
||||
|
||||
/* enum reg_class is target specific, so it should not appear in
|
||||
target-independent code or interfaces, like the target hook declarations
|
||||
in target.h. */
|
||||
typedef int reg_class_t;
|
||||
|
||||
#else
|
||||
|
||||
struct _dont_use_rtx_here_;
|
||||
struct _dont_use_rtvec_here_;
|
||||
union _dont_use_tree_here_;
|
||||
#define rtx struct _dont_use_rtx_here_ *
|
||||
#define const_rtx struct _dont_use_rtx_here_ *
|
||||
#define rtvec struct _dont_use_rtvec_here *
|
||||
#define const_rtvec struct _dont_use_rtvec_here *
|
||||
#define tree union _dont_use_tree_here_ *
|
||||
#define const_tree union _dont_use_tree_here_ *
|
||||
|
||||
#endif
|
||||
|
||||
/* Memory model types for the __atomic* builtins.
|
||||
This must match the order in libstdc++-v3/include/bits/atomic_base.h. */
|
||||
enum memmodel
|
||||
{
|
||||
MEMMODEL_RELAXED = 0,
|
||||
MEMMODEL_CONSUME = 1,
|
||||
MEMMODEL_ACQUIRE = 2,
|
||||
MEMMODEL_RELEASE = 3,
|
||||
MEMMODEL_ACQ_REL = 4,
|
||||
MEMMODEL_SEQ_CST = 5,
|
||||
MEMMODEL_LAST = 6
|
||||
};
|
||||
|
||||
/* Suppose that higher bits are target dependant. */
|
||||
#define MEMMODEL_MASK ((1<<16)-1)
|
||||
|
||||
/* Support for user-provided GGC and PCH markers. The first parameter
|
||||
is a pointer to a pointer, the second a cookie. */
|
||||
typedef void (*gt_pointer_operator) (void *, void *);
|
||||
|
||||
#if !defined (HAVE_UCHAR)
|
||||
typedef unsigned char uchar;
|
||||
#endif
|
||||
|
||||
#endif /* coretypes.h */
|
||||
|
|
@ -0,0 +1,479 @@
|
|||
/* 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-2013 Free Software Foundation, Inc.
|
||||
Hacked by Michael Tiemann (tiemann@cygnus.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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
/* An OFFSET_REF is used in two situations:
|
||||
|
||||
1. An expression of the form `A::m' where `A' is a class and `m' is
|
||||
a non-static member. In this case, operand 0 will be a TYPE
|
||||
(corresponding to `A') and operand 1 will be a FIELD_DECL,
|
||||
BASELINK, or TEMPLATE_ID_EXPR (corresponding to `m').
|
||||
|
||||
The expression is a pointer-to-member if its address is taken,
|
||||
but simply denotes a member of the object if its address is not
|
||||
taken.
|
||||
|
||||
This form is only used during the parsing phase; once semantic
|
||||
analysis has taken place they are eliminated.
|
||||
|
||||
2. An expression of the form `x.*p'. In this case, operand 0 will
|
||||
be an expression corresponding to `x' and operand 1 will be an
|
||||
expression with pointer-to-member type. */
|
||||
DEFTREECODE (OFFSET_REF, "offset_ref", tcc_reference, 2)
|
||||
|
||||
/* A pointer-to-member constant. For a pointer-to-member constant
|
||||
`X::Y' The PTRMEM_CST_CLASS is the RECORD_TYPE for `X' and the
|
||||
PTRMEM_CST_MEMBER is the _DECL for `Y'. */
|
||||
DEFTREECODE (PTRMEM_CST, "ptrmem_cst", tcc_constant, 0)
|
||||
|
||||
/* For NEW_EXPR, operand 0 is the placement list.
|
||||
Operand 1 is the new-declarator.
|
||||
Operand 2 is the number of elements in the array.
|
||||
Operand 3 is the initializer. */
|
||||
DEFTREECODE (NEW_EXPR, "nw_expr", tcc_expression, 4)
|
||||
DEFTREECODE (VEC_NEW_EXPR, "vec_nw_expr", tcc_expression, 3)
|
||||
|
||||
/* For DELETE_EXPR, operand 0 is the store to be destroyed.
|
||||
Operand 1 is the value to pass to the destroying function
|
||||
saying whether the store should be deallocated as well. */
|
||||
DEFTREECODE (DELETE_EXPR, "dl_expr", tcc_expression, 2)
|
||||
DEFTREECODE (VEC_DELETE_EXPR, "vec_dl_expr", tcc_expression, 2)
|
||||
|
||||
/* Value is reference to particular overloaded class method.
|
||||
Operand 0 is the class, operand 1 is the field
|
||||
The COMPLEXITY field holds the class level (usually 0). */
|
||||
DEFTREECODE (SCOPE_REF, "scope_ref", tcc_reference, 2)
|
||||
|
||||
/* When composing an object with a member, this is the result.
|
||||
Operand 0 is the object. Operand 1 is the member (usually
|
||||
a dereferenced pointer to member). */
|
||||
DEFTREECODE (MEMBER_REF, "member_ref", tcc_reference, 2)
|
||||
|
||||
/* Type conversion operator in C++. TREE_TYPE is type that this
|
||||
operator converts to. Operand is expression to be converted. */
|
||||
DEFTREECODE (TYPE_EXPR, "type_expr", tcc_expression, 1)
|
||||
|
||||
/* AGGR_INIT_EXPRs have a variably-sized representation similar to
|
||||
that of CALL_EXPRs. Operand 0 is an INTEGER_CST node containing the
|
||||
operand count, operand 1 is the function which performs initialization,
|
||||
operand 2 is the slot which was allocated for this expression, and
|
||||
the remaining operands are the arguments to the initialization function. */
|
||||
DEFTREECODE (AGGR_INIT_EXPR, "aggr_init_expr", tcc_vl_exp, 3)
|
||||
|
||||
/* Initialization of an array from another array, expressed at a high level
|
||||
so that it works with TARGET_EXPR. Operand 0 is the target, operand 1
|
||||
is the initializer. */
|
||||
DEFTREECODE (VEC_INIT_EXPR, "vec_init_expr", tcc_expression, 2)
|
||||
|
||||
/* A throw expression. operand 0 is the expression, if there was one,
|
||||
else it is NULL_TREE. */
|
||||
DEFTREECODE (THROW_EXPR, "throw_expr", tcc_expression, 1)
|
||||
|
||||
/* An empty class object. The TREE_TYPE gives the class type. We use
|
||||
these to avoid actually creating instances of the empty classes. */
|
||||
DEFTREECODE (EMPTY_CLASS_EXPR, "empty_class_expr", tcc_expression, 0)
|
||||
|
||||
/* A reference to a member function or member functions from a base
|
||||
class. BASELINK_FUNCTIONS gives the FUNCTION_DECL,
|
||||
TEMPLATE_DECL, OVERLOAD, or TEMPLATE_ID_EXPR corresponding to the
|
||||
functions. BASELINK_BINFO gives the base from which the functions
|
||||
come, i.e., the base to which the `this' pointer must be converted
|
||||
before the functions are called. BASELINK_ACCESS_BINFO gives the
|
||||
base used to name the functions.
|
||||
|
||||
A BASELINK is an expression; the TREE_TYPE of the BASELINK gives
|
||||
the type of the expression. This type is either a FUNCTION_TYPE,
|
||||
METHOD_TYPE, or `unknown_type_node' indicating that the function is
|
||||
overloaded. */
|
||||
DEFTREECODE (BASELINK, "baselink", tcc_exceptional, 0)
|
||||
|
||||
/* Template definition. The following fields have the specified uses,
|
||||
although there are other macros in cp-tree.h that should be used for
|
||||
accessing this data.
|
||||
DECL_ARGUMENTS template parm vector
|
||||
DECL_TEMPLATE_INFO template text &c
|
||||
DECL_VINDEX list of instantiations already produced;
|
||||
only done for functions so far
|
||||
For class template:
|
||||
DECL_INITIAL associated templates (methods &c)
|
||||
DECL_TEMPLATE_RESULT null
|
||||
For non-class templates:
|
||||
TREE_TYPE type of object to be constructed
|
||||
DECL_TEMPLATE_RESULT decl for object to be created
|
||||
(e.g., FUNCTION_DECL with tmpl parms used)
|
||||
*/
|
||||
DEFTREECODE (TEMPLATE_DECL, "template_decl", tcc_declaration, 0)
|
||||
|
||||
/* Index into a template parameter list. The TEMPLATE_PARM_IDX gives
|
||||
the index (from 0) of the parameter, while the TEMPLATE_PARM_LEVEL
|
||||
gives the level (from 1) of the parameter.
|
||||
|
||||
Here's an example:
|
||||
|
||||
template <class T> // Index 0, Level 1.
|
||||
struct S
|
||||
{
|
||||
template <class U, // Index 0, Level 2.
|
||||
class V> // Index 1, Level 2.
|
||||
void f();
|
||||
};
|
||||
|
||||
The DESCENDANTS will be a chain of TEMPLATE_PARM_INDEXs descended
|
||||
from this one. The first descendant will have the same IDX, but
|
||||
its LEVEL will be one less. The TREE_CHAIN field is used to chain
|
||||
together the descendants. The TEMPLATE_PARM_DECL is the
|
||||
declaration of this parameter, either a TYPE_DECL or CONST_DECL.
|
||||
The TEMPLATE_PARM_ORIG_LEVEL is the LEVEL of the most distant
|
||||
parent, i.e., the LEVEL that the parameter originally had when it
|
||||
was declared. For example, if we instantiate S<int>, we will have:
|
||||
|
||||
struct S<int>
|
||||
{
|
||||
template <class U, // Index 0, Level 1, Orig Level 2
|
||||
class V> // Index 1, Level 1, Orig Level 2
|
||||
void f();
|
||||
};
|
||||
|
||||
The LEVEL is the level of the parameter when we are worrying about
|
||||
the types of things; the ORIG_LEVEL is the level when we are
|
||||
worrying about instantiating things. */
|
||||
DEFTREECODE (TEMPLATE_PARM_INDEX, "template_parm_index", tcc_exceptional, 0)
|
||||
|
||||
/* Index into a template parameter list for template template parameters.
|
||||
This parameter must be a type. The TYPE_FIELDS value will be a
|
||||
TEMPLATE_PARM_INDEX.
|
||||
|
||||
It is used without template arguments like TT in C<TT>,
|
||||
TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO is NULL_TREE
|
||||
and TYPE_NAME is a TEMPLATE_DECL. */
|
||||
DEFTREECODE (TEMPLATE_TEMPLATE_PARM, "template_template_parm", tcc_type, 0)
|
||||
|
||||
/* The ordering of the following codes is optimized for the checking
|
||||
macros in tree.h. Changing the order will degrade the speed of the
|
||||
compiler. TEMPLATE_TYPE_PARM, TYPENAME_TYPE, TYPEOF_TYPE,
|
||||
BOUND_TEMPLATE_TEMPLATE_PARM. */
|
||||
|
||||
/* Index into a template parameter list. This parameter must be a type.
|
||||
The type.values field will be a TEMPLATE_PARM_INDEX. */
|
||||
DEFTREECODE (TEMPLATE_TYPE_PARM, "template_type_parm", tcc_type, 0)
|
||||
|
||||
/* A type designated by `typename T::t'. TYPE_CONTEXT is `T',
|
||||
TYPE_NAME is an IDENTIFIER_NODE for `t'. If the type was named via
|
||||
template-id, TYPENAME_TYPE_FULLNAME will hold the TEMPLATE_ID_EXPR.
|
||||
TREE_TYPE is always NULL. */
|
||||
DEFTREECODE (TYPENAME_TYPE, "typename_type", tcc_type, 0)
|
||||
|
||||
/* A type designated by `__typeof (expr)'. TYPEOF_TYPE_EXPR is the
|
||||
expression in question. */
|
||||
DEFTREECODE (TYPEOF_TYPE, "typeof_type", tcc_type, 0)
|
||||
|
||||
/* Like TEMPLATE_TEMPLATE_PARM it is used with bound template arguments
|
||||
like TT<int>.
|
||||
In this case, TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO contains the
|
||||
template name and its bound arguments. TYPE_NAME is a TYPE_DECL. */
|
||||
DEFTREECODE (BOUND_TEMPLATE_TEMPLATE_PARM, "bound_template_template_parm",
|
||||
tcc_type, 0)
|
||||
|
||||
/* For template template argument of the form `T::template C'.
|
||||
TYPE_CONTEXT is `T', the template parameter dependent object.
|
||||
TYPE_NAME is an IDENTIFIER_NODE for `C', the member class template. */
|
||||
DEFTREECODE (UNBOUND_CLASS_TEMPLATE, "unbound_class_template", tcc_type, 0)
|
||||
|
||||
/* A using declaration. USING_DECL_SCOPE contains the specified
|
||||
scope. In a member using decl, unless DECL_DEPENDENT_P is true,
|
||||
USING_DECL_DECLS contains the _DECL or OVERLOAD so named. This is
|
||||
not an alias, but is later expanded into multiple aliases. */
|
||||
DEFTREECODE (USING_DECL, "using_decl", tcc_declaration, 0)
|
||||
|
||||
/* A using directive. The operand is USING_STMT_NAMESPACE. */
|
||||
DEFTREECODE (USING_STMT, "using_stmt", tcc_statement, 1)
|
||||
|
||||
/* An un-parsed default argument. Holds a vector of input tokens and
|
||||
a vector of places where the argument was instantiated before
|
||||
parsing had occurred. */
|
||||
DEFTREECODE (DEFAULT_ARG, "default_arg", tcc_exceptional, 0)
|
||||
|
||||
/* An uninstantiated noexcept-specification. DEFERRED_NOEXCEPT_PATTERN is
|
||||
the pattern from the template, and DEFERRED_NOEXCEPT_ARGS are the
|
||||
template arguments to substitute into the pattern when needed. */
|
||||
DEFTREECODE (DEFERRED_NOEXCEPT, "deferred_noexcept", tcc_exceptional, 0)
|
||||
|
||||
/* A template-id, like foo<int>. The first operand is the template.
|
||||
The second is NULL if there are no explicit arguments, or a
|
||||
TREE_VEC of arguments. The template will be a FUNCTION_DECL,
|
||||
TEMPLATE_DECL, or an OVERLOAD. If the template-id refers to a
|
||||
member template, the template may be an IDENTIFIER_NODE. */
|
||||
DEFTREECODE (TEMPLATE_ID_EXPR, "template_id_expr", tcc_expression, 2)
|
||||
|
||||
/* A list-like node for chaining overloading candidates. TREE_TYPE is
|
||||
the original name, and the parameter is the FUNCTION_DECL. */
|
||||
DEFTREECODE (OVERLOAD, "overload", tcc_exceptional, 0)
|
||||
|
||||
/* A pseudo-destructor, of the form "OBJECT.~DESTRUCTOR" or
|
||||
"OBJECT.SCOPE::~DESTRUCTOR. The first operand is the OBJECT. The
|
||||
second operand (if non-NULL) is the SCOPE. The third operand is
|
||||
the TYPE node corresponding to the DESTRUCTOR. The type of the
|
||||
first operand will always be a scalar type.
|
||||
|
||||
The type of a PSEUDO_DTOR_EXPR is always "void", even though it can
|
||||
be used as if it were a zero-argument function. We handle the
|
||||
function-call case specially, and giving it "void" type prevents it
|
||||
being used in expressions in ways that are not permitted. */
|
||||
DEFTREECODE (PSEUDO_DTOR_EXPR, "pseudo_dtor_expr", tcc_expression, 3)
|
||||
|
||||
/* A whole bunch of tree codes for the initial, superficial parsing of
|
||||
templates. */
|
||||
DEFTREECODE (MODOP_EXPR, "modop_expr", tcc_expression, 3)
|
||||
DEFTREECODE (CAST_EXPR, "cast_expr", tcc_unary, 1)
|
||||
DEFTREECODE (REINTERPRET_CAST_EXPR, "reinterpret_cast_expr", tcc_unary, 1)
|
||||
DEFTREECODE (CONST_CAST_EXPR, "const_cast_expr", tcc_unary, 1)
|
||||
DEFTREECODE (STATIC_CAST_EXPR, "static_cast_expr", tcc_unary, 1)
|
||||
DEFTREECODE (DYNAMIC_CAST_EXPR, "dynamic_cast_expr", tcc_unary, 1)
|
||||
DEFTREECODE (IMPLICIT_CONV_EXPR, "implicit_conv_expr", tcc_unary, 1)
|
||||
DEFTREECODE (DOTSTAR_EXPR, "dotstar_expr", tcc_expression, 2)
|
||||
DEFTREECODE (TYPEID_EXPR, "typeid_expr", tcc_expression, 1)
|
||||
DEFTREECODE (NOEXCEPT_EXPR, "noexcept_expr", tcc_unary, 1)
|
||||
|
||||
/* A placeholder for an expression that is not type-dependent, but
|
||||
does occur in a template. When an expression that is not
|
||||
type-dependent appears in a larger expression, we must compute the
|
||||
type of that larger expression. That computation would normally
|
||||
modify the original expression, which would change the mangling of
|
||||
that expression if it appeared in a template argument list. In
|
||||
that situation, we create a NON_DEPENDENT_EXPR to take the place of
|
||||
the original expression. The expression is the only operand -- it
|
||||
is only needed for diagnostics. */
|
||||
DEFTREECODE (NON_DEPENDENT_EXPR, "non_dependent_expr", tcc_expression, 1)
|
||||
|
||||
/* CTOR_INITIALIZER is a placeholder in template code for a call to
|
||||
setup_vtbl_pointer (and appears in all functions, not just ctors). */
|
||||
DEFTREECODE (CTOR_INITIALIZER, "ctor_initializer", tcc_expression, 1)
|
||||
|
||||
DEFTREECODE (TRY_BLOCK, "try_block", tcc_statement, 2)
|
||||
|
||||
DEFTREECODE (EH_SPEC_BLOCK, "eh_spec_block", tcc_statement, 2)
|
||||
|
||||
/* A HANDLER wraps a catch handler for the HANDLER_TYPE. If this is
|
||||
CATCH_ALL_TYPE, then the handler catches all types. The declaration of
|
||||
the catch variable is in HANDLER_PARMS, and the body block in
|
||||
HANDLER_BODY. */
|
||||
DEFTREECODE (HANDLER, "handler", tcc_statement, 2)
|
||||
|
||||
/* A MUST_NOT_THROW_EXPR wraps an expression that may not
|
||||
throw, and must call terminate if it does. The second argument
|
||||
is a condition, used in templates to express noexcept (condition). */
|
||||
DEFTREECODE (MUST_NOT_THROW_EXPR, "must_not_throw_expr", tcc_expression, 2)
|
||||
|
||||
/* A CLEANUP_STMT marks the point at which a declaration is fully
|
||||
constructed. The CLEANUP_EXPR is run on behalf of CLEANUP_DECL
|
||||
when CLEANUP_BODY completes. */
|
||||
DEFTREECODE (CLEANUP_STMT, "cleanup_stmt", tcc_statement, 3)
|
||||
|
||||
/* Represents an 'if' statement. The operands are IF_COND,
|
||||
THEN_CLAUSE, and ELSE_CLAUSE, and the current scope, respectively. */
|
||||
/* ??? It is currently still necessary to distinguish between IF_STMT
|
||||
and COND_EXPR for the benefit of templates. */
|
||||
DEFTREECODE (IF_STMT, "if_stmt", tcc_statement, 4)
|
||||
|
||||
/* Used to represent a `for' statement. The operands are
|
||||
FOR_INIT_STMT, FOR_COND, FOR_EXPR, and FOR_BODY, respectively. */
|
||||
DEFTREECODE (FOR_STMT, "for_stmt", tcc_statement, 5)
|
||||
|
||||
/* Used to represent a range-based `for' statement. The operands are
|
||||
RANGE_FOR_DECL, RANGE_FOR_EXPR, RANGE_FOR_BODY, and RANGE_FOR_SCOPE,
|
||||
respectively. Only used in templates. */
|
||||
DEFTREECODE (RANGE_FOR_STMT, "range_for_stmt", tcc_statement, 4)
|
||||
|
||||
/* Used to represent a 'while' statement. The operands are WHILE_COND
|
||||
and WHILE_BODY, respectively. */
|
||||
DEFTREECODE (WHILE_STMT, "while_stmt", tcc_statement, 2)
|
||||
|
||||
/* Used to represent a 'do' statement. The operands are DO_BODY and
|
||||
DO_COND, respectively. */
|
||||
DEFTREECODE (DO_STMT, "do_stmt", tcc_statement, 2)
|
||||
|
||||
/* Used to represent a 'break' statement. */
|
||||
DEFTREECODE (BREAK_STMT, "break_stmt", tcc_statement, 0)
|
||||
|
||||
/* Used to represent a 'continue' statement. */
|
||||
DEFTREECODE (CONTINUE_STMT, "continue_stmt", tcc_statement, 0)
|
||||
|
||||
/* Used to represent a 'switch' statement. The operands are
|
||||
SWITCH_STMT_COND, SWITCH_STMT_BODY, SWITCH_STMT_TYPE, and
|
||||
SWITCH_STMT_SCOPE, respectively. */
|
||||
DEFTREECODE (SWITCH_STMT, "switch_stmt", tcc_statement, 4)
|
||||
|
||||
/* Used to represent an expression statement. Use `EXPR_STMT_EXPR' to
|
||||
obtain the expression. */
|
||||
DEFTREECODE (EXPR_STMT, "expr_stmt", tcc_expression, 1)
|
||||
|
||||
DEFTREECODE (TAG_DEFN, "tag_defn", tcc_expression, 0)
|
||||
|
||||
/* Represents an 'offsetof' expression during template expansion. */
|
||||
DEFTREECODE (OFFSETOF_EXPR, "offsetof_expr", tcc_expression, 1)
|
||||
|
||||
/* Represents the -> operator during template expansion. */
|
||||
DEFTREECODE (ARROW_EXPR, "arrow_expr", tcc_expression, 1)
|
||||
|
||||
/* Represents an '__alignof__' expression during template
|
||||
expansion. */
|
||||
DEFTREECODE (ALIGNOF_EXPR, "alignof_expr", tcc_expression, 1)
|
||||
|
||||
/* Represents an Objective-C++ '@encode' expression during template
|
||||
expansion. */
|
||||
DEFTREECODE (AT_ENCODE_EXPR, "at_encode_expr", tcc_expression, 1)
|
||||
|
||||
/* A STMT_EXPR represents a statement-expression during template
|
||||
expansion. This is the GCC extension { ( ... ) }. The
|
||||
STMT_EXPR_STMT is the statement given by the expression. */
|
||||
DEFTREECODE (STMT_EXPR, "stmt_expr", tcc_expression, 1)
|
||||
|
||||
/* Unary plus. Operand 0 is the expression to which the unary plus
|
||||
is applied. */
|
||||
DEFTREECODE (UNARY_PLUS_EXPR, "unary_plus_expr", tcc_unary, 1)
|
||||
|
||||
/** C++0x extensions. */
|
||||
|
||||
/* A static assertion. This is a C++0x extension.
|
||||
STATIC_ASSERT_CONDITION contains the condition that is being
|
||||
checked. STATIC_ASSERT_MESSAGE contains the message (a string
|
||||
literal) to be displayed if the condition fails to hold. */
|
||||
DEFTREECODE (STATIC_ASSERT, "static_assert", tcc_exceptional, 0)
|
||||
|
||||
/* Represents an argument pack of types (or templates). An argument
|
||||
pack stores zero or more arguments that will be used to instantiate
|
||||
a parameter pack.
|
||||
|
||||
ARGUMENT_PACK_ARGS retrieves the arguments stored in the argument
|
||||
pack.
|
||||
|
||||
Example:
|
||||
template<typename... Values>
|
||||
class tuple { ... };
|
||||
|
||||
tuple<int, float, double> t;
|
||||
|
||||
Values is a (template) parameter pack. When tuple<int, float,
|
||||
double> is instantiated, the Values parameter pack is instantiated
|
||||
with the argument pack <int, float, double>. ARGUMENT_PACK_ARGS will
|
||||
be a TREE_VEC containing int, float, and double. */
|
||||
DEFTREECODE (TYPE_ARGUMENT_PACK, "type_argument_pack", tcc_type, 0)
|
||||
|
||||
/* Represents an argument pack of values, which can be used either for
|
||||
non-type template arguments or function call arguments.
|
||||
|
||||
NONTYPE_ARGUMENT_PACK plays precisely the same role as
|
||||
TYPE_ARGUMENT_PACK, but will be used for packing non-type template
|
||||
arguments (e.g., "int... Dimensions") or function arguments ("const
|
||||
Args&... args"). */
|
||||
DEFTREECODE (NONTYPE_ARGUMENT_PACK, "nontype_argument_pack", tcc_expression, 1)
|
||||
|
||||
/* Represents a type expression that will be expanded into a list of
|
||||
types when instantiated with one or more argument packs.
|
||||
|
||||
PACK_EXPANSION_PATTERN retrieves the expansion pattern. This is
|
||||
the type or expression that we will substitute into with each
|
||||
argument in an argument pack.
|
||||
|
||||
SET_PACK_EXPANSION_PATTERN sets the expansion pattern.
|
||||
|
||||
PACK_EXPANSION_PARAMETER_PACKS contains a TREE_LIST of the parameter
|
||||
packs that are used in this pack expansion.
|
||||
|
||||
Example:
|
||||
template<typename... Values>
|
||||
struct tied : tuple<Values&...> {
|
||||
// ...
|
||||
};
|
||||
|
||||
The derivation from tuple contains a TYPE_PACK_EXPANSION for the
|
||||
template arguments. Its PACK_EXPANSION_PATTERN is "Values&" and its
|
||||
PACK_EXPANSION_PARAMETER_PACKS will contain "Values". */
|
||||
DEFTREECODE (TYPE_PACK_EXPANSION, "type_pack_expansion", tcc_type, 0)
|
||||
|
||||
/* Represents an expression that will be expanded into a list of
|
||||
expressions when instantiated with one or more argument packs.
|
||||
|
||||
EXPR_PACK_EXPANSION plays precisely the same role as TYPE_PACK_EXPANSION,
|
||||
but will be used for expressions. */
|
||||
DEFTREECODE (EXPR_PACK_EXPANSION, "expr_pack_expansion", tcc_expression, 3)
|
||||
|
||||
/* Selects the Ith parameter out of an argument pack. This node will
|
||||
be used when instantiating pack expansions; see
|
||||
tsubst_pack_expansion.
|
||||
|
||||
ARGUMENT_PACK_SELECT_FROM_PACK contains the *_ARGUMENT_PACK node
|
||||
from which the argument will be selected.
|
||||
|
||||
ARGUMENT_PACK_SELECT_INDEX contains the index into the argument
|
||||
pack that will be returned by this ARGUMENT_PACK_SELECT node. The
|
||||
index is a machine integer. */
|
||||
DEFTREECODE (ARGUMENT_PACK_SELECT, "argument_pack_select", tcc_exceptional, 0)
|
||||
|
||||
/** C++ extensions. */
|
||||
|
||||
/* Represents a trait expression during template expansion. */
|
||||
DEFTREECODE (TRAIT_EXPR, "trait_expr", tcc_exceptional, 0)
|
||||
|
||||
/* A lambda expression. This is a C++0x extension.
|
||||
LAMBDA_EXPR_DEFAULT_CAPTURE_MODE is an enum for the default, which may be
|
||||
none.
|
||||
LAMBDA_EXPR_CAPTURE_LIST holds the capture-list, including `this'.
|
||||
LAMBDA_EXPR_THIS_CAPTURE goes straight to the capture of `this', if it exists.
|
||||
LAMBDA_EXPR_PENDING_PROXIES is a vector of capture proxies which need to
|
||||
be pushed once scope returns to the lambda.
|
||||
LAMBDA_EXPR_MUTABLE_P signals whether this lambda was declared mutable.
|
||||
LAMBDA_EXPR_RETURN_TYPE holds the return type, if it was specified. */
|
||||
DEFTREECODE (LAMBDA_EXPR, "lambda_expr", tcc_exceptional, 0)
|
||||
|
||||
/* The declared type of an expression. This is a C++0x extension.
|
||||
DECLTYPE_TYPE_EXPR is the expression whose type we are computing.
|
||||
DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P states whether the
|
||||
expression was parsed as an id-expression or a member access
|
||||
expression. When false, it was parsed as a full expression.
|
||||
DECLTYPE_FOR_LAMBDA_CAPTURE is set if we want lambda capture semantics.
|
||||
DECLTYPE_FOR_LAMBDA_RETURN is set if we want lambda return deduction. */
|
||||
DEFTREECODE (DECLTYPE_TYPE, "decltype_type", tcc_type, 0)
|
||||
|
||||
/* A type designated by `__underlying_type (type)'.
|
||||
UNDERLYING_TYPE_TYPE is the type in question. */
|
||||
DEFTREECODE (UNDERLYING_TYPE, "underlying_type", tcc_type, 0)
|
||||
|
||||
/* A type designated by one of the bases type traits.
|
||||
BASES_TYPE is the type in question. */
|
||||
DEFTREECODE (BASES, "bases", tcc_type, 0)
|
||||
|
||||
/* Used to represent the template information stored by template
|
||||
specializations.
|
||||
The accessors are:
|
||||
TI_TEMPLATE the template declaration associated to the specialization
|
||||
TI_ARGS the arguments of the template specialization
|
||||
TI_TYPEDEFS_NEEDING_ACCESS_CHECKING the vector of typedefs used in
|
||||
the pattern of the template for which access check is needed at template
|
||||
instantiation time. */
|
||||
DEFTREECODE (TEMPLATE_INFO, "template_info", tcc_exceptional, 0)
|
||||
|
||||
/*
|
||||
Local variables:
|
||||
mode:c
|
||||
End:
|
||||
*/
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,79 @@
|
|||
/* Interface for the GNU C++ pretty-printer.
|
||||
Copyright (C) 2003-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_CXX_PRETTY_PRINT_H
|
||||
#define GCC_CXX_PRETTY_PRINT_H
|
||||
|
||||
#include "c-family/c-pretty-print.h"
|
||||
|
||||
#undef pp_c_base
|
||||
#define pp_c_base(PP) (&(PP)->c_base)
|
||||
|
||||
typedef enum
|
||||
{
|
||||
/* Ask for a qualified-id. */
|
||||
pp_cxx_flag_default_argument = 1 << pp_c_flag_last_bit
|
||||
|
||||
} cxx_pretty_printer_flags;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
c_pretty_printer c_base;
|
||||
/* This is the enclosing scope of the entity being pretty-printed. */
|
||||
tree enclosing_scope;
|
||||
} cxx_pretty_printer;
|
||||
|
||||
#define pp_cxx_cv_qualifier_seq(PP, T) \
|
||||
pp_c_type_qualifier_list (pp_c_base (PP), T)
|
||||
|
||||
#define pp_cxx_whitespace(PP) pp_c_whitespace (pp_c_base (PP))
|
||||
#define pp_cxx_left_paren(PP) pp_c_left_paren (pp_c_base (PP))
|
||||
#define pp_cxx_right_paren(PP) pp_c_right_paren (pp_c_base (PP))
|
||||
#define pp_cxx_left_brace(PP) pp_c_left_brace (pp_c_base (PP))
|
||||
#define pp_cxx_right_brace(PP) pp_c_right_brace (pp_c_base (PP))
|
||||
#define pp_cxx_left_bracket(PP) pp_c_left_bracket (pp_c_base (PP))
|
||||
#define pp_cxx_right_bracket(PP) pp_c_right_bracket (pp_c_base (PP))
|
||||
#define pp_cxx_dot(PP) pp_c_dot (pp_c_base (PP))
|
||||
#define pp_cxx_ampersand(PP) pp_c_ampersand (pp_c_base (PP))
|
||||
#define pp_cxx_star(PP) pp_c_star (pp_c_base (PP))
|
||||
#define pp_cxx_arrow(PP) pp_c_arrow (pp_c_base (PP))
|
||||
#define pp_cxx_semicolon(PP) pp_c_semicolon (pp_c_base (PP))
|
||||
#define pp_cxx_complement(PP) pp_c_complement (pp_c_base (PP))
|
||||
|
||||
#define pp_cxx_ws_string(PP, I) pp_c_ws_string (pp_c_base (PP), I)
|
||||
#define pp_cxx_identifier(PP, I) pp_c_identifier (pp_c_base (PP), I)
|
||||
#define pp_cxx_tree_identifier(PP, T) \
|
||||
pp_c_tree_identifier (pp_c_base (PP), T)
|
||||
|
||||
void pp_cxx_pretty_printer_init (cxx_pretty_printer *);
|
||||
void pp_cxx_begin_template_argument_list (cxx_pretty_printer *);
|
||||
void pp_cxx_end_template_argument_list (cxx_pretty_printer *);
|
||||
void pp_cxx_colon_colon (cxx_pretty_printer *);
|
||||
void pp_cxx_separate_with (cxx_pretty_printer *, int);
|
||||
|
||||
void pp_cxx_declaration (cxx_pretty_printer *, tree);
|
||||
void pp_cxx_canonical_template_parameter (cxx_pretty_printer *, tree);
|
||||
void pp_cxx_trait_expression (cxx_pretty_printer *, tree);
|
||||
void pp_cxx_va_arg_expression (cxx_pretty_printer *, tree);
|
||||
void pp_cxx_offsetof_expression (cxx_pretty_printer *, tree);
|
||||
void pp_cxx_userdef_literal (cxx_pretty_printer *, tree);
|
||||
|
||||
|
||||
#endif /* GCC_CXX_PRETTY_PRINT_H */
|
||||
|
|
@ -0,0 +1,369 @@
|
|||
/* Declarations for C++ name lookup routines.
|
||||
Copyright (C) 2003-2013 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_CP_NAME_LOOKUP_H
|
||||
#define GCC_CP_NAME_LOOKUP_H
|
||||
|
||||
#include "c-family/c-common.h"
|
||||
|
||||
/* The type of dictionary used to map names to types declared at
|
||||
a given scope. */
|
||||
typedef struct binding_table_s *binding_table;
|
||||
typedef struct binding_entry_s *binding_entry;
|
||||
|
||||
/* The type of a routine repeatedly called by binding_table_foreach. */
|
||||
typedef void (*bt_foreach_proc) (binding_entry, void *);
|
||||
|
||||
struct GTY(()) binding_entry_s {
|
||||
binding_entry chain;
|
||||
tree name;
|
||||
tree type;
|
||||
};
|
||||
|
||||
/* These macros indicate the initial chains count for binding_table. */
|
||||
#define SCOPE_DEFAULT_HT_SIZE (1 << 3)
|
||||
#define CLASS_SCOPE_HT_SIZE (1 << 3)
|
||||
#define NAMESPACE_ORDINARY_HT_SIZE (1 << 5)
|
||||
#define NAMESPACE_STD_HT_SIZE (1 << 8)
|
||||
#define GLOBAL_SCOPE_HT_SIZE (1 << 8)
|
||||
|
||||
extern void binding_table_foreach (binding_table, bt_foreach_proc, void *);
|
||||
extern binding_entry binding_table_find (binding_table, tree);
|
||||
|
||||
/* Datatype that represents binding established by a declaration between
|
||||
a name and a C++ entity. */
|
||||
typedef struct cxx_binding cxx_binding;
|
||||
|
||||
/* The datatype used to implement C++ scope. */
|
||||
typedef struct cp_binding_level cp_binding_level;
|
||||
|
||||
/* Nonzero if this binding is for a local scope, as opposed to a class
|
||||
or namespace scope. */
|
||||
#define LOCAL_BINDING_P(NODE) ((NODE)->is_local)
|
||||
|
||||
/* True if NODE->value is from a base class of the class which is
|
||||
currently being defined. */
|
||||
#define INHERITED_VALUE_BINDING_P(NODE) ((NODE)->value_is_inherited)
|
||||
|
||||
struct GTY(()) cxx_binding {
|
||||
/* Link to chain together various bindings for this name. */
|
||||
cxx_binding *previous;
|
||||
/* The non-type entity this name is bound to. */
|
||||
tree value;
|
||||
/* The type entity this name is bound to. */
|
||||
tree type;
|
||||
/* The scope at which this binding was made. */
|
||||
cp_binding_level *scope;
|
||||
unsigned value_is_inherited : 1;
|
||||
unsigned is_local : 1;
|
||||
};
|
||||
|
||||
/* Datatype used to temporarily save C++ bindings (for implicit
|
||||
instantiations purposes and like). Implemented in decl.c. */
|
||||
typedef struct GTY(()) cxx_saved_binding {
|
||||
/* The name of the current binding. */
|
||||
tree identifier;
|
||||
/* The binding we're saving. */
|
||||
cxx_binding *binding;
|
||||
tree real_type_value;
|
||||
} cxx_saved_binding;
|
||||
|
||||
|
||||
extern tree identifier_type_value (tree);
|
||||
extern void set_identifier_type_value (tree, tree);
|
||||
extern void pop_binding (tree, tree);
|
||||
extern tree constructor_name (tree);
|
||||
extern bool constructor_name_p (tree, tree);
|
||||
|
||||
/* The kinds of scopes we recognize. */
|
||||
typedef enum scope_kind {
|
||||
sk_block = 0, /* An ordinary block scope. This enumerator must
|
||||
have the value zero because "cp_binding_level"
|
||||
is initialized by using "memset" to set the
|
||||
contents to zero, and the default scope kind
|
||||
is "sk_block". */
|
||||
sk_cleanup, /* A scope for (pseudo-)scope for cleanup. It is
|
||||
pseudo in that it is transparent to name lookup
|
||||
activities. */
|
||||
sk_try, /* A try-block. */
|
||||
sk_catch, /* A catch-block. */
|
||||
sk_for, /* The scope of the variable declared in a
|
||||
for-init-statement. */
|
||||
sk_cond, /* The scope of the variable declared in the condition
|
||||
of an if or switch statement. */
|
||||
sk_function_parms, /* The scope containing function parameters. */
|
||||
sk_class, /* The scope containing the members of a class. */
|
||||
sk_scoped_enum, /* The scope containing the enumertors of a C++0x
|
||||
scoped enumeration. */
|
||||
sk_namespace, /* The scope containing the members of a
|
||||
namespace, including the global scope. */
|
||||
sk_template_parms, /* A scope for template parameters. */
|
||||
sk_template_spec, /* Like sk_template_parms, but for an explicit
|
||||
specialization. Since, by definition, an
|
||||
explicit specialization is introduced by
|
||||
"template <>", this scope is always empty. */
|
||||
sk_omp /* An OpenMP structured block. */
|
||||
} scope_kind;
|
||||
|
||||
/* The scope where the class/struct/union/enum tag applies. */
|
||||
typedef enum tag_scope {
|
||||
ts_current = 0, /* Current scope only. This is for the
|
||||
class-key identifier;
|
||||
case mentioned in [basic.lookup.elab]/2,
|
||||
or the class/enum definition
|
||||
class-key identifier { ... }; */
|
||||
ts_global = 1, /* All scopes. This is the 3.4.1
|
||||
[basic.lookup.unqual] lookup mentioned
|
||||
in [basic.lookup.elab]/2. */
|
||||
ts_within_enclosing_non_class = 2, /* Search within enclosing non-class
|
||||
only, for friend class lookup
|
||||
according to [namespace.memdef]/3
|
||||
and [class.friend]/9. */
|
||||
ts_lambda = 3 /* Declaring a lambda closure. */
|
||||
} tag_scope;
|
||||
|
||||
typedef struct GTY(()) cp_class_binding {
|
||||
cxx_binding *base;
|
||||
/* The bound name. */
|
||||
tree identifier;
|
||||
} cp_class_binding;
|
||||
|
||||
|
||||
typedef struct GTY(()) cp_label_binding {
|
||||
/* The bound LABEL_DECL. */
|
||||
tree label;
|
||||
/* The previous IDENTIFIER_LABEL_VALUE. */
|
||||
tree prev_value;
|
||||
} cp_label_binding;
|
||||
|
||||
|
||||
/* For each binding contour we allocate a binding_level structure
|
||||
which records the names defined in that contour.
|
||||
Contours include:
|
||||
0) the global one
|
||||
1) one for each function definition,
|
||||
where internal declarations of the parameters appear.
|
||||
2) one for each compound statement,
|
||||
to record its declarations.
|
||||
|
||||
The current meaning of a name can be found by searching the levels
|
||||
from the current one out to the global one.
|
||||
|
||||
Off to the side, may be the class_binding_level. This exists only
|
||||
to catch class-local declarations. It is otherwise nonexistent.
|
||||
|
||||
Also there may be binding levels that catch cleanups that must be
|
||||
run when exceptions occur. Thus, to see whether a name is bound in
|
||||
the current scope, it is not enough to look in the
|
||||
CURRENT_BINDING_LEVEL. You should use lookup_name_current_level
|
||||
instead. */
|
||||
|
||||
/* Note that the information in the `names' component of the global contour
|
||||
is duplicated in the IDENTIFIER_GLOBAL_VALUEs of all identifiers. */
|
||||
|
||||
struct GTY(()) cp_binding_level {
|
||||
/* A chain of _DECL nodes for all variables, constants, functions,
|
||||
and typedef types. These are in the reverse of the order
|
||||
supplied. There may be OVERLOADs on this list, too, but they
|
||||
are wrapped in TREE_LISTs; the TREE_VALUE is the OVERLOAD. */
|
||||
tree names;
|
||||
|
||||
/* A chain of NAMESPACE_DECL nodes. */
|
||||
tree namespaces;
|
||||
|
||||
/* An array of static functions and variables (for namespaces only) */
|
||||
vec<tree, va_gc> *static_decls;
|
||||
|
||||
/* A list of USING_DECL nodes. */
|
||||
tree usings;
|
||||
|
||||
/* A list of used namespaces. PURPOSE is the namespace,
|
||||
VALUE the common ancestor with this binding_level's namespace. */
|
||||
tree using_directives;
|
||||
|
||||
/* For the binding level corresponding to a class, the entities
|
||||
declared in the class or its base classes. */
|
||||
vec<cp_class_binding, va_gc> *class_shadowed;
|
||||
|
||||
/* Similar to class_shadowed, but for IDENTIFIER_TYPE_VALUE, and
|
||||
is used for all binding levels. The TREE_PURPOSE is the name of
|
||||
the entity, the TREE_TYPE is the associated type. In addition
|
||||
the TREE_VALUE is the IDENTIFIER_TYPE_VALUE before we entered
|
||||
the class. */
|
||||
tree type_shadowed;
|
||||
|
||||
/* Similar to class_shadowed, but for IDENTIFIER_LABEL_VALUE, and
|
||||
used for all binding levels. */
|
||||
vec<cp_label_binding, va_gc> *shadowed_labels;
|
||||
|
||||
/* For each level (except not the global one),
|
||||
a chain of BLOCK nodes for all the levels
|
||||
that were entered and exited one level down. */
|
||||
tree blocks;
|
||||
|
||||
/* The entity (namespace, class, function) the scope of which this
|
||||
binding contour corresponds to. Otherwise NULL. */
|
||||
tree this_entity;
|
||||
|
||||
/* The binding level which this one is contained in (inherits from). */
|
||||
cp_binding_level *level_chain;
|
||||
|
||||
/* List of VAR_DECLS saved from a previous for statement.
|
||||
These would be dead in ISO-conforming code, but might
|
||||
be referenced in ARM-era code. */
|
||||
vec<tree, va_gc> *dead_vars_from_for;
|
||||
|
||||
/* STATEMENT_LIST for statements in this binding contour.
|
||||
Only used at present for SK_CLEANUP temporary bindings. */
|
||||
tree statement_list;
|
||||
|
||||
/* Binding depth at which this level began. */
|
||||
int binding_depth;
|
||||
|
||||
/* The kind of scope that this object represents. However, a
|
||||
SK_TEMPLATE_SPEC scope is represented with KIND set to
|
||||
SK_TEMPLATE_PARMS and EXPLICIT_SPEC_P set to true. */
|
||||
ENUM_BITFIELD (scope_kind) kind : 4;
|
||||
|
||||
/* True if this scope is an SK_TEMPLATE_SPEC scope. This field is
|
||||
only valid if KIND == SK_TEMPLATE_PARMS. */
|
||||
BOOL_BITFIELD explicit_spec_p : 1;
|
||||
|
||||
/* true means make a BLOCK for this level regardless of all else. */
|
||||
unsigned keep : 1;
|
||||
|
||||
/* Nonzero if this level can safely have additional
|
||||
cleanup-needing variables added to it. */
|
||||
unsigned more_cleanups_ok : 1;
|
||||
unsigned have_cleanups : 1;
|
||||
|
||||
/* 24 bits left to fill a 32-bit word. */
|
||||
};
|
||||
|
||||
/* The binding level currently in effect. */
|
||||
|
||||
#define current_binding_level \
|
||||
(*(cfun && cp_function_chain && cp_function_chain->bindings \
|
||||
? &cp_function_chain->bindings \
|
||||
: &scope_chain->bindings))
|
||||
|
||||
/* The binding level of the current class, if any. */
|
||||
|
||||
#define class_binding_level scope_chain->class_bindings
|
||||
|
||||
/* The tree node representing the global scope. */
|
||||
extern GTY(()) tree global_namespace;
|
||||
extern GTY(()) tree global_scope_name;
|
||||
|
||||
/* Indicates that there is a type value in some namespace, although
|
||||
that is not necessarily in scope at the moment. */
|
||||
|
||||
extern GTY(()) tree global_type_node;
|
||||
|
||||
/* True if SCOPE designates the global scope binding contour. */
|
||||
#define global_scope_p(SCOPE) \
|
||||
((SCOPE) == NAMESPACE_LEVEL (global_namespace))
|
||||
|
||||
extern cp_binding_level *leave_scope (void);
|
||||
extern bool kept_level_p (void);
|
||||
extern bool global_bindings_p (void);
|
||||
extern bool toplevel_bindings_p (void);
|
||||
extern bool namespace_bindings_p (void);
|
||||
extern bool local_bindings_p (void);
|
||||
extern bool template_parm_scope_p (void);
|
||||
extern scope_kind innermost_scope_kind (void);
|
||||
extern cp_binding_level *begin_scope (scope_kind, tree);
|
||||
extern void print_binding_stack (void);
|
||||
extern void push_to_top_level (void);
|
||||
extern void pop_from_top_level (void);
|
||||
extern void pop_everything (void);
|
||||
extern void keep_next_level (bool);
|
||||
extern bool is_ancestor (tree, tree);
|
||||
extern tree push_scope (tree);
|
||||
extern void pop_scope (tree);
|
||||
extern tree push_inner_scope (tree);
|
||||
extern void pop_inner_scope (tree, tree);
|
||||
extern void push_binding_level (cp_binding_level *);
|
||||
|
||||
extern void push_namespace (tree);
|
||||
extern void pop_namespace (void);
|
||||
extern void push_nested_namespace (tree);
|
||||
extern void pop_nested_namespace (tree);
|
||||
extern bool handle_namespace_attrs (tree, tree);
|
||||
extern void pushlevel_class (void);
|
||||
extern void poplevel_class (void);
|
||||
extern tree pushdecl_with_scope (tree, cp_binding_level *, bool);
|
||||
extern tree lookup_name_prefer_type (tree, int);
|
||||
extern tree lookup_name_real (tree, int, int, bool, int, int);
|
||||
extern tree lookup_type_scope (tree, tag_scope);
|
||||
extern tree namespace_binding (tree, tree);
|
||||
extern void set_namespace_binding (tree, tree, tree);
|
||||
extern bool hidden_name_p (tree);
|
||||
extern tree remove_hidden_names (tree);
|
||||
extern tree lookup_qualified_name (tree, tree, bool, bool);
|
||||
extern tree lookup_name_nonclass (tree);
|
||||
extern tree lookup_name_innermost_nonclass_level (tree);
|
||||
extern bool is_local_extern (tree);
|
||||
extern tree lookup_function_nonclass (tree, vec<tree, va_gc> *, bool);
|
||||
extern void push_local_binding (tree, tree, int);
|
||||
extern bool pushdecl_class_level (tree);
|
||||
extern tree pushdecl_namespace_level (tree, bool);
|
||||
extern bool push_class_level_binding (tree, tree);
|
||||
extern tree getdecls (void);
|
||||
extern int function_parm_depth (void);
|
||||
extern tree cp_namespace_decls (tree);
|
||||
extern void set_decl_namespace (tree, tree, bool);
|
||||
extern void push_decl_namespace (tree);
|
||||
extern void pop_decl_namespace (void);
|
||||
extern void do_namespace_alias (tree, tree);
|
||||
extern void do_toplevel_using_decl (tree, tree, tree);
|
||||
extern void do_local_using_decl (tree, tree, tree);
|
||||
extern tree do_class_using_decl (tree, tree);
|
||||
extern void do_using_directive (tree);
|
||||
extern tree lookup_arg_dependent (tree, tree, vec<tree, va_gc> *, bool);
|
||||
extern bool is_associated_namespace (tree, tree);
|
||||
extern void parse_using_directive (tree, tree);
|
||||
extern tree innermost_non_namespace_value (tree);
|
||||
extern cxx_binding *outer_binding (tree, cxx_binding *, bool);
|
||||
extern void cp_emit_debug_info_for_using (tree, tree);
|
||||
|
||||
/* Set *DECL to the (non-hidden) declaration for ID at global scope,
|
||||
if present and return true; otherwise return false. */
|
||||
|
||||
static inline bool
|
||||
get_global_value_if_present (tree id, tree *decl)
|
||||
{
|
||||
tree global_value = namespace_binding (id, global_namespace);
|
||||
if (global_value)
|
||||
*decl = global_value;
|
||||
return global_value != NULL;
|
||||
}
|
||||
|
||||
/* True is the binding of IDENTIFIER at global scope names a type. */
|
||||
|
||||
static inline bool
|
||||
is_typename_at_global_scope (tree id)
|
||||
{
|
||||
tree global_value = namespace_binding (id, global_namespace);
|
||||
|
||||
return global_value && TREE_CODE (global_value) == TYPE_DECL;
|
||||
}
|
||||
|
||||
#endif /* GCC_CP_NAME_LOOKUP_H */
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
/* CPP Library.
|
||||
Copyright (C) 1986-2013 Free Software Foundation, Inc.
|
||||
Contributed by Per Bothner, 1994-95.
|
||||
Based on CCCP program by Paul Rubin, June 1986
|
||||
Adapted to ANSI C, Richard Stallman, Jan 1987
|
||||
|
||||
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 3, 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; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_CPPDEFAULT_H
|
||||
#define GCC_CPPDEFAULT_H
|
||||
|
||||
/* This is the default list of directories to search for include files.
|
||||
It may be overridden by the various -I and -ixxx options.
|
||||
|
||||
#include "file" looks in the same directory as the current file,
|
||||
then this list.
|
||||
#include <file> just looks in this list.
|
||||
|
||||
All these directories are treated as `system' include directories
|
||||
(they are not subject to pedantic warnings in some cases). */
|
||||
|
||||
struct default_include
|
||||
{
|
||||
const char *const fname; /* The name of the directory. */
|
||||
const char *const component; /* The component containing the directory
|
||||
(see update_path in prefix.c) */
|
||||
const char cplusplus; /* Only look here if we're compiling C++. */
|
||||
const char cxx_aware; /* Includes in this directory don't need to
|
||||
be wrapped in extern "C" when compiling
|
||||
C++. */
|
||||
const char add_sysroot; /* FNAME should be prefixed by
|
||||
cpp_SYSROOT. */
|
||||
const char multilib; /* FNAME should have appended
|
||||
- the multilib path specified with -imultilib
|
||||
when set to 1,
|
||||
- the multiarch path specified with
|
||||
-imultiarch, when set to 2. */
|
||||
};
|
||||
|
||||
extern const struct default_include cpp_include_defaults[];
|
||||
extern const char cpp_GCC_INCLUDE_DIR[];
|
||||
extern const size_t cpp_GCC_INCLUDE_DIR_len;
|
||||
|
||||
/* The configure-time prefix, i.e., the value supplied as the argument
|
||||
to --prefix=. */
|
||||
extern const char cpp_PREFIX[];
|
||||
/* The length of the configure-time prefix. */
|
||||
extern const size_t cpp_PREFIX_len;
|
||||
/* The configure-time execution prefix. This is typically the lib/gcc
|
||||
subdirectory of cpp_PREFIX. */
|
||||
extern const char cpp_EXEC_PREFIX[];
|
||||
/* The run-time execution prefix. This is typically the lib/gcc
|
||||
subdirectory of the actual installation. */
|
||||
extern const char *gcc_exec_prefix;
|
||||
|
||||
/* Return true if the toolchain is relocated. */
|
||||
bool cpp_relocated (void);
|
||||
|
||||
#endif /* ! GCC_CPPDEFAULT_H */
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,195 @@
|
|||
/* Debug hooks for GCC.
|
||||
Copyright (C) 2001-2013 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 3, 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; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_DEBUG_H
|
||||
#define GCC_DEBUG_H
|
||||
|
||||
/* This structure contains hooks for the debug information output
|
||||
functions, accessed through the global instance debug_hooks set in
|
||||
toplev.c according to command line options. */
|
||||
struct gcc_debug_hooks
|
||||
{
|
||||
/* Initialize debug output. MAIN_FILENAME is the name of the main
|
||||
input file. */
|
||||
void (* init) (const char *main_filename);
|
||||
|
||||
/* Output debug symbols. */
|
||||
void (* finish) (const char *main_filename);
|
||||
|
||||
/* Called from cgraph_optimize before starting to assemble
|
||||
functions/variables/toplevel asms. */
|
||||
void (* assembly_start) (void);
|
||||
|
||||
/* Macro defined on line LINE with name and expansion TEXT. */
|
||||
void (* define) (unsigned int line, const char *text);
|
||||
|
||||
/* MACRO undefined on line LINE. */
|
||||
void (* undef) (unsigned int line, const char *macro);
|
||||
|
||||
/* Record the beginning of a new source file FILE from LINE number
|
||||
in the previous one. */
|
||||
void (* start_source_file) (unsigned int line, const char *file);
|
||||
|
||||
/* Record the resumption of a source file. LINE is the line number
|
||||
in the source file we are returning to. */
|
||||
void (* end_source_file) (unsigned int line);
|
||||
|
||||
/* Record the beginning of block N, counting from 1 and not
|
||||
including the function-scope block, at LINE. */
|
||||
void (* begin_block) (unsigned int line, unsigned int n);
|
||||
|
||||
/* Record the end of a block. Arguments as for begin_block. */
|
||||
void (* end_block) (unsigned int line, unsigned int n);
|
||||
|
||||
/* Returns nonzero if it is appropriate not to emit any debugging
|
||||
information for BLOCK, because it doesn't contain any
|
||||
instructions. This may not be the case for blocks containing
|
||||
nested functions, since we may actually call such a function even
|
||||
though the BLOCK information is messed up. Defaults to true. */
|
||||
bool (* ignore_block) (const_tree);
|
||||
|
||||
/* Record a source file location at (FILE, LINE, DISCRIMINATOR). */
|
||||
void (* source_line) (unsigned int line, const char *file,
|
||||
int discriminator, bool is_stmt);
|
||||
|
||||
/* Called at start of prologue code. LINE is the first line in the
|
||||
function. */
|
||||
void (* begin_prologue) (unsigned int line, const char *file);
|
||||
|
||||
/* Called at end of prologue code. LINE is the first line in the
|
||||
function. */
|
||||
void (* end_prologue) (unsigned int line, const char *file);
|
||||
|
||||
/* Called at beginning of epilogue code. */
|
||||
void (* begin_epilogue) (unsigned int line, const char *file);
|
||||
|
||||
/* Record end of epilogue code. */
|
||||
void (* end_epilogue) (unsigned int line, const char *file);
|
||||
|
||||
/* Called at start of function DECL, before it is declared. */
|
||||
void (* begin_function) (tree decl);
|
||||
|
||||
/* Record end of function. LINE is highest line number in function. */
|
||||
void (* end_function) (unsigned int line);
|
||||
|
||||
/* Debug information for a function DECL. This might include the
|
||||
function name (a symbol), its parameters, and the block that
|
||||
makes up the function's body, and the local variables of the
|
||||
function. */
|
||||
void (* function_decl) (tree decl);
|
||||
|
||||
/* Debug information for a global DECL. Called from toplev.c after
|
||||
compilation proper has finished. */
|
||||
void (* global_decl) (tree decl);
|
||||
|
||||
/* Debug information for a type DECL. Called from toplev.c after
|
||||
compilation proper, also from various language front ends to
|
||||
record built-in types. The second argument is properly a
|
||||
boolean, which indicates whether or not the type is a "local"
|
||||
type as determined by the language. (It's not a boolean for
|
||||
legacy reasons.) */
|
||||
void (* type_decl) (tree decl, int local);
|
||||
|
||||
/* Debug information for imported modules and declarations. */
|
||||
void (* imported_module_or_decl) (tree decl, tree name,
|
||||
tree context, bool child);
|
||||
|
||||
/* DECL is an inline function, whose body is present, but which is
|
||||
not being output at this point. */
|
||||
void (* deferred_inline_function) (tree decl);
|
||||
|
||||
/* DECL is an inline function which is about to be emitted out of
|
||||
line. The hook is useful to, e.g., emit abstract debug info for
|
||||
the inline before it gets mangled by optimization. */
|
||||
void (* outlining_inline_function) (tree decl);
|
||||
|
||||
/* Called from final_scan_insn for any CODE_LABEL insn whose
|
||||
LABEL_NAME is non-null. */
|
||||
void (* label) (rtx);
|
||||
|
||||
/* Called after the start and before the end of writing a PCH file.
|
||||
The parameter is 0 if after the start, 1 if before the end. */
|
||||
void (* handle_pch) (unsigned int);
|
||||
|
||||
/* Called from final_scan_insn for any NOTE_INSN_VAR_LOCATION note. */
|
||||
void (* var_location) (rtx);
|
||||
|
||||
/* Called from final_scan_insn if there is a switch between hot and cold
|
||||
text sections. */
|
||||
void (* switch_text_section) (void);
|
||||
|
||||
/* Called from grokdeclarator. Replaces the anonymous name with the
|
||||
type name. */
|
||||
void (* set_name) (tree, tree);
|
||||
|
||||
/* This is 1 if the debug writer wants to see start and end commands for the
|
||||
main source files, and 0 otherwise. */
|
||||
int start_end_main_source_file;
|
||||
|
||||
/* The type of symtab field used by these debug hooks. This is one
|
||||
of the TYPE_SYMTAB_IS_xxx values defined in tree.h. */
|
||||
int tree_type_symtab_field;
|
||||
};
|
||||
|
||||
extern const struct gcc_debug_hooks *debug_hooks;
|
||||
|
||||
/* The do-nothing hooks. */
|
||||
extern void debug_nothing_void (void);
|
||||
extern void debug_nothing_charstar (const char *);
|
||||
extern void debug_nothing_int_charstar (unsigned int, const char *);
|
||||
extern void debug_nothing_int_charstar_int_bool (unsigned int, const char *,
|
||||
int, bool);
|
||||
extern void debug_nothing_int (unsigned int);
|
||||
extern void debug_nothing_int_int (unsigned int, unsigned int);
|
||||
extern void debug_nothing_tree (tree);
|
||||
extern void debug_nothing_tree_tree (tree, tree);
|
||||
extern void debug_nothing_tree_int (tree, int);
|
||||
extern void debug_nothing_tree_tree_tree_bool (tree, tree, tree, bool);
|
||||
extern bool debug_true_const_tree (const_tree);
|
||||
extern void debug_nothing_rtx (rtx);
|
||||
extern void debug_nothing_rtx_rtx (rtx, rtx);
|
||||
|
||||
/* Hooks for various debug formats. */
|
||||
extern const struct gcc_debug_hooks do_nothing_debug_hooks;
|
||||
extern const struct gcc_debug_hooks dbx_debug_hooks;
|
||||
extern const struct gcc_debug_hooks sdb_debug_hooks;
|
||||
extern const struct gcc_debug_hooks xcoff_debug_hooks;
|
||||
extern const struct gcc_debug_hooks dwarf2_debug_hooks;
|
||||
extern const struct gcc_debug_hooks vmsdbg_debug_hooks;
|
||||
|
||||
/* Dwarf2 frame information. */
|
||||
|
||||
extern void dwarf2out_begin_prologue (unsigned int, const char *);
|
||||
extern void dwarf2out_vms_end_prologue (unsigned int, const char *);
|
||||
extern void dwarf2out_vms_begin_epilogue (unsigned int, const char *);
|
||||
extern void dwarf2out_end_epilogue (unsigned int, const char *);
|
||||
extern void dwarf2out_frame_finish (void);
|
||||
/* Decide whether we want to emit frame unwind information for the current
|
||||
translation unit. */
|
||||
extern bool dwarf2out_do_frame (void);
|
||||
extern bool dwarf2out_do_cfi_asm (void);
|
||||
extern void dwarf2out_switch_text_section (void);
|
||||
|
||||
const char *remap_debug_filename (const char *);
|
||||
void add_debug_prefix_map (const char *);
|
||||
|
||||
/* For -fdump-go-spec. */
|
||||
|
||||
extern const struct gcc_debug_hooks *
|
||||
dump_go_spec_init (const char *, const struct gcc_debug_hooks *);
|
||||
|
||||
#endif /* !GCC_DEBUG_H */
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,89 @@
|
|||
/* Declarations of core diagnostic functionality for code that does
|
||||
not need to deal with diagnostic contexts or diagnostic info
|
||||
structures.
|
||||
Copyright (C) 1998-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_DIAGNOSTIC_CORE_H
|
||||
#define GCC_DIAGNOSTIC_CORE_H
|
||||
|
||||
#include "input.h"
|
||||
#include "bversion.h"
|
||||
|
||||
/* Constants used to discriminate diagnostics. */
|
||||
typedef enum
|
||||
{
|
||||
#define DEFINE_DIAGNOSTIC_KIND(K, msgid) K,
|
||||
#include "diagnostic.def"
|
||||
#undef DEFINE_DIAGNOSTIC_KIND
|
||||
DK_LAST_DIAGNOSTIC_KIND,
|
||||
/* This is used for tagging pragma pops in the diagnostic
|
||||
classification history chain. */
|
||||
DK_POP
|
||||
} diagnostic_t;
|
||||
|
||||
extern const char *progname;
|
||||
|
||||
extern const char *trim_filename (const char *);
|
||||
|
||||
/* If we haven't already defined a front-end-specific diagnostics
|
||||
style, use the generic one. */
|
||||
#ifndef GCC_DIAG_STYLE
|
||||
#define GCC_DIAG_STYLE __gcc_tdiag__
|
||||
#endif
|
||||
/* None of these functions are suitable for ATTRIBUTE_PRINTF, because
|
||||
each language front end can extend them with its own set of format
|
||||
specifiers. We must use custom format checks. */
|
||||
#if (ENABLE_CHECKING && GCC_VERSION >= 4001) || GCC_VERSION == BUILDING_GCC_VERSION
|
||||
#define ATTRIBUTE_GCC_DIAG(m, n) __attribute__ ((__format__ (GCC_DIAG_STYLE, m, n))) ATTRIBUTE_NONNULL(m)
|
||||
#else
|
||||
#define ATTRIBUTE_GCC_DIAG(m, n) ATTRIBUTE_NONNULL(m)
|
||||
#endif
|
||||
extern void internal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
|
||||
ATTRIBUTE_NORETURN;
|
||||
/* Pass one of the OPT_W* from options.h as the first parameter. */
|
||||
extern bool warning (int, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
|
||||
extern bool warning_at (location_t, int, const char *, ...)
|
||||
ATTRIBUTE_GCC_DIAG(3,4);
|
||||
extern void error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
|
||||
extern void error_n (location_t, int, const char *, const char *, ...)
|
||||
ATTRIBUTE_GCC_DIAG(3,5) ATTRIBUTE_GCC_DIAG(4,5);
|
||||
extern void error_at (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
|
||||
extern void fatal_error (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2)
|
||||
ATTRIBUTE_NORETURN;
|
||||
/* Pass one of the OPT_W* from options.h as the second parameter. */
|
||||
extern bool pedwarn (location_t, int, const char *, ...)
|
||||
ATTRIBUTE_GCC_DIAG(3,4);
|
||||
extern bool permerror (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
|
||||
extern void sorry (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
|
||||
extern void inform (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
|
||||
extern void inform_n (location_t, int, const char *, const char *, ...)
|
||||
ATTRIBUTE_GCC_DIAG(3,5) ATTRIBUTE_GCC_DIAG(4,5);
|
||||
extern void verbatim (const char *, ...) ATTRIBUTE_GCC_DIAG(1,2);
|
||||
extern bool emit_diagnostic (diagnostic_t, location_t, int,
|
||||
const char *, ...) ATTRIBUTE_GCC_DIAG(4,5);
|
||||
extern bool seen_error (void);
|
||||
|
||||
#ifdef BUFSIZ
|
||||
/* N.B. Unlike all the others, fnotice is just gettext+fprintf, and
|
||||
therefore it can have ATTRIBUTE_PRINTF. */
|
||||
extern void fnotice (FILE *, const char *, ...)
|
||||
ATTRIBUTE_PRINTF_2;
|
||||
#endif
|
||||
|
||||
#endif /* ! GCC_DIAGNOSTIC_CORE_H */
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
/* Copyright (C) 2001-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* DK_UNSPECIFIED must be first so it has a value of zero. We never
|
||||
assign this kind to an actual diagnostic, we only use this in
|
||||
variables that can hold a kind, to mean they have yet to have a
|
||||
kind specified. I.e. they're uninitialized. Within the diagnostic
|
||||
machinery, this kind also means "don't change the existing kind",
|
||||
meaning "no change is specified". */
|
||||
DEFINE_DIAGNOSTIC_KIND (DK_UNSPECIFIED, "")
|
||||
|
||||
/* If a diagnostic is set to DK_IGNORED, it won't get reported at all.
|
||||
This is used by the diagnostic machinery when it wants to disable a
|
||||
diagnostic without disabling the option which causes it. */
|
||||
DEFINE_DIAGNOSTIC_KIND (DK_IGNORED, "")
|
||||
|
||||
/* The remainder are real diagnostic types. */
|
||||
DEFINE_DIAGNOSTIC_KIND (DK_FATAL, "fatal error: ")
|
||||
DEFINE_DIAGNOSTIC_KIND (DK_ICE, "internal compiler error: ")
|
||||
DEFINE_DIAGNOSTIC_KIND (DK_ERROR, "error: ")
|
||||
DEFINE_DIAGNOSTIC_KIND (DK_SORRY, "sorry, unimplemented: ")
|
||||
DEFINE_DIAGNOSTIC_KIND (DK_WARNING, "warning: ")
|
||||
DEFINE_DIAGNOSTIC_KIND (DK_ANACHRONISM, "anachronism: ")
|
||||
DEFINE_DIAGNOSTIC_KIND (DK_NOTE, "note: ")
|
||||
DEFINE_DIAGNOSTIC_KIND (DK_DEBUG, "debug: ")
|
||||
/* These two would be re-classified as DK_WARNING or DK_ERROR, so the
|
||||
prefix does not matter. */
|
||||
DEFINE_DIAGNOSTIC_KIND (DK_PEDWARN, "pedwarn: ")
|
||||
DEFINE_DIAGNOSTIC_KIND (DK_PERMERROR, "permerror: ")
|
||||
|
||||
|
|
@ -0,0 +1,296 @@
|
|||
/* Various declarations for language-independent diagnostics subroutines.
|
||||
Copyright (C) 2000-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_DIAGNOSTIC_H
|
||||
#define GCC_DIAGNOSTIC_H
|
||||
|
||||
#include "pretty-print.h"
|
||||
#include "diagnostic-core.h"
|
||||
|
||||
/* A diagnostic is described by the MESSAGE to send, the FILE and LINE of
|
||||
its context and its KIND (ice, error, warning, note, ...) See complete
|
||||
list in diagnostic.def. */
|
||||
typedef struct diagnostic_info
|
||||
{
|
||||
text_info message;
|
||||
location_t location;
|
||||
unsigned int override_column;
|
||||
/* Auxiliary data for client. */
|
||||
void *x_data;
|
||||
/* The kind of diagnostic it is about. */
|
||||
diagnostic_t kind;
|
||||
/* Which OPT_* directly controls this diagnostic. */
|
||||
int option_index;
|
||||
} diagnostic_info;
|
||||
|
||||
/* Each time a diagnostic's classification is changed with a pragma,
|
||||
we record the change and the location of the change in an array of
|
||||
these structs. */
|
||||
typedef struct diagnostic_classification_change_t
|
||||
{
|
||||
location_t location;
|
||||
int option;
|
||||
diagnostic_t kind;
|
||||
} diagnostic_classification_change_t;
|
||||
|
||||
/* Forward declarations. */
|
||||
typedef void (*diagnostic_starter_fn) (diagnostic_context *,
|
||||
diagnostic_info *);
|
||||
typedef diagnostic_starter_fn diagnostic_finalizer_fn;
|
||||
|
||||
/* This data structure bundles altogether any information relevant to
|
||||
the context of a diagnostic message. */
|
||||
struct diagnostic_context
|
||||
{
|
||||
/* Where most of the diagnostic formatting work is done. */
|
||||
pretty_printer *printer;
|
||||
|
||||
/* The number of times we have issued diagnostics. */
|
||||
int diagnostic_count[DK_LAST_DIAGNOSTIC_KIND];
|
||||
|
||||
/* True if we should display the "warnings are being tread as error"
|
||||
message, usually displayed once per compiler run. */
|
||||
bool some_warnings_are_errors;
|
||||
|
||||
/* True if it has been requested that warnings be treated as errors. */
|
||||
bool warning_as_error_requested;
|
||||
|
||||
/* The number of option indexes that can be passed to warning() et
|
||||
al. */
|
||||
int n_opts;
|
||||
|
||||
/* For each option index that can be passed to warning() et al
|
||||
(OPT_* from options.h when using this code with the core GCC
|
||||
options), this array may contain a new kind that the diagnostic
|
||||
should be changed to before reporting, or DK_UNSPECIFIED to leave
|
||||
it as the reported kind, or DK_IGNORED to not report it at
|
||||
all. */
|
||||
diagnostic_t *classify_diagnostic;
|
||||
|
||||
/* History of all changes to the classifications above. This list
|
||||
is stored in location-order, so we can search it, either
|
||||
binary-wise or end-to-front, to find the most recent
|
||||
classification for a given diagnostic, given the location of the
|
||||
diagnostic. */
|
||||
diagnostic_classification_change_t *classification_history;
|
||||
|
||||
/* The size of the above array. */
|
||||
int n_classification_history;
|
||||
|
||||
/* For pragma push/pop. */
|
||||
int *push_list;
|
||||
int n_push;
|
||||
|
||||
/* True if we should print the source line with a caret indicating
|
||||
the location. */
|
||||
bool show_caret;
|
||||
|
||||
/* Maximum width of the source line printed. */
|
||||
int caret_max_width;
|
||||
|
||||
/* True if we should print the command line option which controls
|
||||
each diagnostic, if known. */
|
||||
bool show_option_requested;
|
||||
|
||||
/* True if we should raise a SIGABRT on errors. */
|
||||
bool abort_on_error;
|
||||
|
||||
/* True if we should show the column number on diagnostics. */
|
||||
bool show_column;
|
||||
|
||||
/* True if pedwarns are errors. */
|
||||
bool pedantic_errors;
|
||||
|
||||
/* True if permerrors are warnings. */
|
||||
bool permissive;
|
||||
|
||||
/* The index of the option to associate with turning permerrors into
|
||||
warnings. */
|
||||
int opt_permissive;
|
||||
|
||||
/* True if errors are fatal. */
|
||||
bool fatal_errors;
|
||||
|
||||
/* True if all warnings should be disabled. */
|
||||
bool dc_inhibit_warnings;
|
||||
|
||||
/* True if warnings should be given in system headers. */
|
||||
bool dc_warn_system_headers;
|
||||
|
||||
/* Maximum number of errors to report. */
|
||||
unsigned int max_errors;
|
||||
|
||||
/* This function is called before any message is printed out. It is
|
||||
responsible for preparing message prefix and such. For example, it
|
||||
might say:
|
||||
In file included from "/usr/local/include/curses.h:5:
|
||||
from "/home/gdr/src/nifty_printer.h:56:
|
||||
...
|
||||
*/
|
||||
diagnostic_starter_fn begin_diagnostic;
|
||||
|
||||
/* This function is called after the diagnostic message is printed. */
|
||||
diagnostic_finalizer_fn end_diagnostic;
|
||||
|
||||
/* Client hook to report an internal error. */
|
||||
void (*internal_error) (diagnostic_context *, const char *, va_list *);
|
||||
|
||||
/* Client hook to say whether the option controlling a diagnostic is
|
||||
enabled. Returns nonzero if enabled, zero if disabled. */
|
||||
int (*option_enabled) (int, void *);
|
||||
|
||||
/* Client information to pass as second argument to
|
||||
option_enabled. */
|
||||
void *option_state;
|
||||
|
||||
/* Client hook to return the name of an option that controls a
|
||||
diagnostic. Returns malloced memory. The first diagnostic_t
|
||||
argument is the kind of diagnostic before any reclassification
|
||||
(of warnings as errors, etc.); the second is the kind after any
|
||||
reclassification. May return NULL if no name is to be printed.
|
||||
May be passed 0 as well as the index of a particular option. */
|
||||
char *(*option_name) (diagnostic_context *, int, diagnostic_t, diagnostic_t);
|
||||
|
||||
/* Auxiliary data for client. */
|
||||
void *x_data;
|
||||
|
||||
/* Used to detect that the last caret was printed at the same location. */
|
||||
location_t last_location;
|
||||
|
||||
/* Used to detect when the input file stack has changed since last
|
||||
described. */
|
||||
const struct line_map *last_module;
|
||||
|
||||
int lock;
|
||||
|
||||
bool inhibit_notes_p;
|
||||
};
|
||||
|
||||
static inline void
|
||||
diagnostic_inhibit_notes (diagnostic_context * context)
|
||||
{
|
||||
context->inhibit_notes_p = true;
|
||||
}
|
||||
|
||||
|
||||
/* Client supplied function to announce a diagnostic. */
|
||||
#define diagnostic_starter(DC) (DC)->begin_diagnostic
|
||||
|
||||
/* Client supplied function called after a diagnostic message is
|
||||
displayed. */
|
||||
#define diagnostic_finalizer(DC) (DC)->end_diagnostic
|
||||
|
||||
/* Extension hooks for client. */
|
||||
#define diagnostic_context_auxiliary_data(DC) (DC)->x_data
|
||||
#define diagnostic_info_auxiliary_data(DI) (DI)->x_data
|
||||
|
||||
/* Same as pp_format_decoder. Works on 'diagnostic_context *'. */
|
||||
#define diagnostic_format_decoder(DC) ((DC)->printer->format_decoder)
|
||||
|
||||
/* Same as output_prefixing_rule. Works on 'diagnostic_context *'. */
|
||||
#define diagnostic_prefixing_rule(DC) ((DC)->printer->wrapping.rule)
|
||||
|
||||
/* Maximum characters per line in automatic line wrapping mode.
|
||||
Zero means don't wrap lines. */
|
||||
#define diagnostic_line_cutoff(DC) ((DC)->printer->wrapping.line_cutoff)
|
||||
|
||||
#define diagnostic_flush_buffer(DC) pp_base_flush ((DC)->printer)
|
||||
|
||||
/* True if the last module or file in which a diagnostic was reported is
|
||||
different from the current one. */
|
||||
#define diagnostic_last_module_changed(DC, MAP) \
|
||||
((DC)->last_module != MAP)
|
||||
|
||||
/* Remember the current module or file as being the last one in which we
|
||||
report a diagnostic. */
|
||||
#define diagnostic_set_last_module(DC, MAP) \
|
||||
(DC)->last_module = MAP
|
||||
|
||||
/* Raise SIGABRT on any diagnostic of severity DK_ERROR or higher. */
|
||||
#define diagnostic_abort_on_error(DC) \
|
||||
(DC)->abort_on_error = true
|
||||
|
||||
/* This diagnostic_context is used by front-ends that directly output
|
||||
diagnostic messages without going through `error', `warning',
|
||||
and similar functions. */
|
||||
extern diagnostic_context *global_dc;
|
||||
|
||||
/* The total count of a KIND of diagnostics emitted so far. */
|
||||
#define diagnostic_kind_count(DC, DK) (DC)->diagnostic_count[(int) (DK)]
|
||||
|
||||
/* The number of errors that have been issued so far. Ideally, these
|
||||
would take a diagnostic_context as an argument. */
|
||||
#define errorcount diagnostic_kind_count (global_dc, DK_ERROR)
|
||||
/* Similarly, but for warnings. */
|
||||
#define warningcount diagnostic_kind_count (global_dc, DK_WARNING)
|
||||
/* Similarly, but for sorrys. */
|
||||
#define sorrycount diagnostic_kind_count (global_dc, DK_SORRY)
|
||||
|
||||
/* Returns nonzero if warnings should be emitted. */
|
||||
#define diagnostic_report_warnings_p(DC, LOC) \
|
||||
(!(DC)->dc_inhibit_warnings \
|
||||
&& !(in_system_header_at (LOC) && !(DC)->dc_warn_system_headers))
|
||||
|
||||
#define report_diagnostic(D) diagnostic_report_diagnostic (global_dc, D)
|
||||
|
||||
/* Override the column number to be used for reporting a
|
||||
diagnostic. */
|
||||
#define diagnostic_override_column(DI, COL) (DI)->override_column = (COL)
|
||||
|
||||
/* Override the option index to be used for reporting a
|
||||
diagnostic. */
|
||||
#define diagnostic_override_option_index(DI, OPTIDX) \
|
||||
((DI)->option_index = (OPTIDX))
|
||||
|
||||
/* Diagnostic related functions. */
|
||||
extern void diagnostic_initialize (diagnostic_context *, int);
|
||||
extern void diagnostic_finish (diagnostic_context *);
|
||||
extern void diagnostic_report_current_module (diagnostic_context *, location_t);
|
||||
extern void diagnostic_show_locus (diagnostic_context *, const diagnostic_info *);
|
||||
|
||||
/* Force diagnostics controlled by OPTIDX to be kind KIND. */
|
||||
extern diagnostic_t diagnostic_classify_diagnostic (diagnostic_context *,
|
||||
int /* optidx */,
|
||||
diagnostic_t /* kind */,
|
||||
location_t);
|
||||
extern void diagnostic_push_diagnostics (diagnostic_context *, location_t);
|
||||
extern void diagnostic_pop_diagnostics (diagnostic_context *, location_t);
|
||||
extern bool diagnostic_report_diagnostic (diagnostic_context *,
|
||||
diagnostic_info *);
|
||||
#ifdef ATTRIBUTE_GCC_DIAG
|
||||
extern void diagnostic_set_info (diagnostic_info *, const char *, va_list *,
|
||||
location_t, diagnostic_t) ATTRIBUTE_GCC_DIAG(2,0);
|
||||
extern void diagnostic_set_info_translated (diagnostic_info *, const char *,
|
||||
va_list *, location_t,
|
||||
diagnostic_t)
|
||||
ATTRIBUTE_GCC_DIAG(2,0);
|
||||
extern void diagnostic_append_note (diagnostic_context *, location_t,
|
||||
const char *, ...) ATTRIBUTE_GCC_DIAG(3,4);
|
||||
#endif
|
||||
extern char *diagnostic_build_prefix (diagnostic_context *, const diagnostic_info *);
|
||||
void default_diagnostic_starter (diagnostic_context *, diagnostic_info *);
|
||||
void default_diagnostic_finalizer (diagnostic_context *, diagnostic_info *);
|
||||
void diagnostic_set_caret_max_width (diagnostic_context *context, int value);
|
||||
|
||||
|
||||
/* Pure text formatting support functions. */
|
||||
extern char *file_name_as_prefix (const char *);
|
||||
|
||||
#endif /* ! GCC_DIAGNOSTIC_H */
|
||||
|
|
@ -0,0 +1,457 @@
|
|||
/* Operations with long integers.
|
||||
Copyright (C) 2006-2013 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 3, or (at your option) any
|
||||
later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef DOUBLE_INT_H
|
||||
#define DOUBLE_INT_H
|
||||
|
||||
/* A large integer is currently represented as a pair of HOST_WIDE_INTs.
|
||||
It therefore represents a number with precision of
|
||||
2 * HOST_BITS_PER_WIDE_INT bits (it is however possible that the
|
||||
internal representation will change, if numbers with greater precision
|
||||
are needed, so the users should not rely on it). The representation does
|
||||
not contain any information about signedness of the represented value, so
|
||||
it can be used to represent both signed and unsigned numbers. For
|
||||
operations where the results depend on signedness (division, comparisons),
|
||||
it must be specified separately. For each such operation, there are three
|
||||
versions of the function -- double_int_op, that takes an extra UNS argument
|
||||
giving the signedness of the values, and double_int_sop and double_int_uop
|
||||
that stand for its specializations for signed and unsigned values.
|
||||
|
||||
You may also represent with numbers in smaller precision using double_int.
|
||||
You however need to use double_int_ext (that fills in the bits of the
|
||||
number over the prescribed precision with zeros or with the sign bit) before
|
||||
operations that do not perform arithmetics modulo 2^precision (comparisons,
|
||||
division), and possibly before storing the results, if you want to keep
|
||||
them in some canonical form). In general, the signedness of double_int_ext
|
||||
should match the signedness of the operation.
|
||||
|
||||
??? The components of double_int differ in signedness mostly for
|
||||
historical reasons (they replace an older structure used to represent
|
||||
numbers with precision higher than HOST_WIDE_INT). It might be less
|
||||
confusing to have them both signed or both unsigned. */
|
||||
|
||||
struct double_int
|
||||
{
|
||||
/* Normally, we would define constructors to create instances.
|
||||
Two things prevent us from doing so.
|
||||
First, defining a constructor makes the class non-POD in C++03,
|
||||
and we certainly want double_int to be a POD.
|
||||
Second, the GCC conding conventions prefer explicit conversion,
|
||||
and explicit conversion operators are not available until C++11. */
|
||||
|
||||
static double_int from_uhwi (unsigned HOST_WIDE_INT cst);
|
||||
static double_int from_shwi (HOST_WIDE_INT cst);
|
||||
static double_int from_pair (HOST_WIDE_INT high, unsigned HOST_WIDE_INT low);
|
||||
|
||||
/* Construct from a fuffer of length LEN. BUFFER will be read according
|
||||
to byte endianess and word endianess. */
|
||||
static double_int from_buffer (const unsigned char *buffer, int len);
|
||||
|
||||
/* No copy assignment operator or destructor to keep the type a POD. */
|
||||
|
||||
/* There are some special value-creation static member functions. */
|
||||
|
||||
static double_int mask (unsigned prec);
|
||||
static double_int max_value (unsigned int prec, bool uns);
|
||||
static double_int min_value (unsigned int prec, bool uns);
|
||||
|
||||
/* The following functions are mutating operations. */
|
||||
|
||||
double_int &operator ++ (); // prefix
|
||||
double_int &operator -- (); // prefix
|
||||
double_int &operator *= (double_int);
|
||||
double_int &operator += (double_int);
|
||||
double_int &operator -= (double_int);
|
||||
double_int &operator &= (double_int);
|
||||
double_int &operator ^= (double_int);
|
||||
double_int &operator |= (double_int);
|
||||
|
||||
/* The following functions are non-mutating operations. */
|
||||
|
||||
/* Conversion functions. */
|
||||
|
||||
HOST_WIDE_INT to_shwi () const;
|
||||
unsigned HOST_WIDE_INT to_uhwi () const;
|
||||
|
||||
/* Conversion query functions. */
|
||||
|
||||
bool fits_uhwi () const;
|
||||
bool fits_shwi () const;
|
||||
bool fits_hwi (bool uns) const;
|
||||
|
||||
/* Attribute query functions. */
|
||||
|
||||
int trailing_zeros () const;
|
||||
int popcount () const;
|
||||
|
||||
/* Arithmetic query operations. */
|
||||
|
||||
bool multiple_of (double_int, bool, double_int *) const;
|
||||
|
||||
/* Arithmetic operation functions. */
|
||||
|
||||
/* The following operations perform arithmetics modulo 2^precision, so you
|
||||
do not need to call .ext between them, even if you are representing
|
||||
numbers with precision less than HOST_BITS_PER_DOUBLE_INT bits. */
|
||||
|
||||
double_int set_bit (unsigned) const;
|
||||
double_int mul_with_sign (double_int, bool unsigned_p, bool *overflow) const;
|
||||
double_int wide_mul_with_sign (double_int, bool unsigned_p,
|
||||
double_int *higher, bool *overflow) const;
|
||||
double_int add_with_sign (double_int, bool unsigned_p, bool *overflow) const;
|
||||
double_int sub_with_overflow (double_int, bool *overflow) const;
|
||||
double_int neg_with_overflow (bool *overflow) const;
|
||||
|
||||
double_int operator * (double_int) const;
|
||||
double_int operator + (double_int) const;
|
||||
double_int operator - (double_int) const;
|
||||
double_int operator - () const;
|
||||
double_int operator ~ () const;
|
||||
double_int operator & (double_int) const;
|
||||
double_int operator | (double_int) const;
|
||||
double_int operator ^ (double_int) const;
|
||||
double_int and_not (double_int) const;
|
||||
|
||||
double_int lshift (HOST_WIDE_INT count, unsigned int prec, bool arith) const;
|
||||
double_int rshift (HOST_WIDE_INT count, unsigned int prec, bool arith) const;
|
||||
double_int alshift (HOST_WIDE_INT count, unsigned int prec) const;
|
||||
double_int arshift (HOST_WIDE_INT count, unsigned int prec) const;
|
||||
double_int llshift (HOST_WIDE_INT count, unsigned int prec) const;
|
||||
double_int lrshift (HOST_WIDE_INT count, unsigned int prec) const;
|
||||
double_int lrotate (HOST_WIDE_INT count, unsigned int prec) const;
|
||||
double_int rrotate (HOST_WIDE_INT count, unsigned int prec) const;
|
||||
|
||||
/* You must ensure that double_int::ext is called on the operands
|
||||
of the following operations, if the precision of the numbers
|
||||
is less than HOST_BITS_PER_DOUBLE_INT bits. */
|
||||
|
||||
double_int div (double_int, bool, unsigned) const;
|
||||
double_int sdiv (double_int, unsigned) const;
|
||||
double_int udiv (double_int, unsigned) const;
|
||||
double_int mod (double_int, bool, unsigned) const;
|
||||
double_int smod (double_int, unsigned) const;
|
||||
double_int umod (double_int, unsigned) const;
|
||||
double_int divmod_with_overflow (double_int, bool, unsigned,
|
||||
double_int *, bool *) const;
|
||||
double_int divmod (double_int, bool, unsigned, double_int *) const;
|
||||
double_int sdivmod (double_int, unsigned, double_int *) const;
|
||||
double_int udivmod (double_int, unsigned, double_int *) const;
|
||||
|
||||
/* Precision control functions. */
|
||||
|
||||
double_int ext (unsigned prec, bool uns) const;
|
||||
double_int zext (unsigned prec) const;
|
||||
double_int sext (unsigned prec) const;
|
||||
|
||||
/* Comparative functions. */
|
||||
|
||||
bool is_zero () const;
|
||||
bool is_one () const;
|
||||
bool is_minus_one () const;
|
||||
bool is_negative () const;
|
||||
|
||||
int cmp (double_int b, bool uns) const;
|
||||
int ucmp (double_int b) const;
|
||||
int scmp (double_int b) const;
|
||||
|
||||
bool ult (double_int b) const;
|
||||
bool ule (double_int b) const;
|
||||
bool ugt (double_int b) const;
|
||||
bool slt (double_int b) const;
|
||||
bool sle (double_int b) const;
|
||||
bool sgt (double_int b) const;
|
||||
|
||||
double_int max (double_int b, bool uns);
|
||||
double_int smax (double_int b);
|
||||
double_int umax (double_int b);
|
||||
|
||||
double_int min (double_int b, bool uns);
|
||||
double_int smin (double_int b);
|
||||
double_int umin (double_int b);
|
||||
|
||||
bool operator == (double_int cst2) const;
|
||||
bool operator != (double_int cst2) const;
|
||||
|
||||
/* Please migrate away from using these member variables publically. */
|
||||
|
||||
unsigned HOST_WIDE_INT low;
|
||||
HOST_WIDE_INT high;
|
||||
|
||||
};
|
||||
|
||||
#define HOST_BITS_PER_DOUBLE_INT (2 * HOST_BITS_PER_WIDE_INT)
|
||||
|
||||
/* Constructors and conversions. */
|
||||
|
||||
/* Constructs double_int from integer CST. The bits over the precision of
|
||||
HOST_WIDE_INT are filled with the sign bit. */
|
||||
|
||||
inline double_int
|
||||
double_int::from_shwi (HOST_WIDE_INT cst)
|
||||
{
|
||||
double_int r;
|
||||
r.low = (unsigned HOST_WIDE_INT) cst;
|
||||
r.high = cst < 0 ? -1 : 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
/* Some useful constants. */
|
||||
/* FIXME(crowl): Maybe remove after converting callers?
|
||||
The problem is that a named constant would not be as optimizable,
|
||||
while the functional syntax is more verbose. */
|
||||
|
||||
#define double_int_minus_one (double_int::from_shwi (-1))
|
||||
#define double_int_zero (double_int::from_shwi (0))
|
||||
#define double_int_one (double_int::from_shwi (1))
|
||||
#define double_int_two (double_int::from_shwi (2))
|
||||
#define double_int_ten (double_int::from_shwi (10))
|
||||
|
||||
/* Constructs double_int from unsigned integer CST. The bits over the
|
||||
precision of HOST_WIDE_INT are filled with zeros. */
|
||||
|
||||
inline double_int
|
||||
double_int::from_uhwi (unsigned HOST_WIDE_INT cst)
|
||||
{
|
||||
double_int r;
|
||||
r.low = cst;
|
||||
r.high = 0;
|
||||
return r;
|
||||
}
|
||||
|
||||
inline double_int
|
||||
double_int::from_pair (HOST_WIDE_INT high, unsigned HOST_WIDE_INT low)
|
||||
{
|
||||
double_int r;
|
||||
r.low = low;
|
||||
r.high = high;
|
||||
return r;
|
||||
}
|
||||
|
||||
inline double_int &
|
||||
double_int::operator ++ ()
|
||||
{
|
||||
*this += double_int_one;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline double_int &
|
||||
double_int::operator -- ()
|
||||
{
|
||||
*this -= double_int_one;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline double_int &
|
||||
double_int::operator *= (double_int b)
|
||||
{
|
||||
*this = *this * b;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline double_int &
|
||||
double_int::operator += (double_int b)
|
||||
{
|
||||
*this = *this + b;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline double_int &
|
||||
double_int::operator -= (double_int b)
|
||||
{
|
||||
*this = *this - b;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline double_int &
|
||||
double_int::operator &= (double_int b)
|
||||
{
|
||||
*this = *this & b;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline double_int &
|
||||
double_int::operator ^= (double_int b)
|
||||
{
|
||||
*this = *this ^ b;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline double_int &
|
||||
double_int::operator |= (double_int b)
|
||||
{
|
||||
*this = *this | b;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* Returns value of CST as a signed number. CST must satisfy
|
||||
double_int::fits_signed. */
|
||||
|
||||
inline HOST_WIDE_INT
|
||||
double_int::to_shwi () const
|
||||
{
|
||||
return (HOST_WIDE_INT) low;
|
||||
}
|
||||
|
||||
/* Returns value of CST as an unsigned number. CST must satisfy
|
||||
double_int::fits_unsigned. */
|
||||
|
||||
inline unsigned HOST_WIDE_INT
|
||||
double_int::to_uhwi () const
|
||||
{
|
||||
return low;
|
||||
}
|
||||
|
||||
/* Returns true if CST fits in unsigned HOST_WIDE_INT. */
|
||||
|
||||
inline bool
|
||||
double_int::fits_uhwi () const
|
||||
{
|
||||
return high == 0;
|
||||
}
|
||||
|
||||
/* Logical operations. */
|
||||
|
||||
/* Returns ~A. */
|
||||
|
||||
inline double_int
|
||||
double_int::operator ~ () const
|
||||
{
|
||||
double_int result;
|
||||
result.low = ~low;
|
||||
result.high = ~high;
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Returns A | B. */
|
||||
|
||||
inline double_int
|
||||
double_int::operator | (double_int b) const
|
||||
{
|
||||
double_int result;
|
||||
result.low = low | b.low;
|
||||
result.high = high | b.high;
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Returns A & B. */
|
||||
|
||||
inline double_int
|
||||
double_int::operator & (double_int b) const
|
||||
{
|
||||
double_int result;
|
||||
result.low = low & b.low;
|
||||
result.high = high & b.high;
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Returns A & ~B. */
|
||||
|
||||
inline double_int
|
||||
double_int::and_not (double_int b) const
|
||||
{
|
||||
double_int result;
|
||||
result.low = low & ~b.low;
|
||||
result.high = high & ~b.high;
|
||||
return result;
|
||||
}
|
||||
|
||||
/* Returns A ^ B. */
|
||||
|
||||
inline double_int
|
||||
double_int::operator ^ (double_int b) const
|
||||
{
|
||||
double_int result;
|
||||
result.low = low ^ b.low;
|
||||
result.high = high ^ b.high;
|
||||
return result;
|
||||
}
|
||||
|
||||
void dump_double_int (FILE *, double_int, bool);
|
||||
|
||||
#define ALL_ONES (~((unsigned HOST_WIDE_INT) 0))
|
||||
|
||||
/* The operands of the following comparison functions must be processed
|
||||
with double_int_ext, if their precision is less than
|
||||
HOST_BITS_PER_DOUBLE_INT bits. */
|
||||
|
||||
/* Returns true if CST is zero. */
|
||||
|
||||
inline bool
|
||||
double_int::is_zero () const
|
||||
{
|
||||
return low == 0 && high == 0;
|
||||
}
|
||||
|
||||
/* Returns true if CST is one. */
|
||||
|
||||
inline bool
|
||||
double_int::is_one () const
|
||||
{
|
||||
return low == 1 && high == 0;
|
||||
}
|
||||
|
||||
/* Returns true if CST is minus one. */
|
||||
|
||||
inline bool
|
||||
double_int::is_minus_one () const
|
||||
{
|
||||
return low == ALL_ONES && high == -1;
|
||||
}
|
||||
|
||||
/* Returns true if CST is negative. */
|
||||
|
||||
inline bool
|
||||
double_int::is_negative () const
|
||||
{
|
||||
return high < 0;
|
||||
}
|
||||
|
||||
/* Returns true if CST1 == CST2. */
|
||||
|
||||
inline bool
|
||||
double_int::operator == (double_int cst2) const
|
||||
{
|
||||
return low == cst2.low && high == cst2.high;
|
||||
}
|
||||
|
||||
/* Returns true if CST1 != CST2. */
|
||||
|
||||
inline bool
|
||||
double_int::operator != (double_int cst2) const
|
||||
{
|
||||
return low != cst2.low || high != cst2.high;
|
||||
}
|
||||
|
||||
/* Return number of set bits of CST. */
|
||||
|
||||
inline int
|
||||
double_int::popcount () const
|
||||
{
|
||||
return popcount_hwi (high) + popcount_hwi (low);
|
||||
}
|
||||
|
||||
|
||||
#ifndef GENERATOR_FILE
|
||||
/* Conversion to and from GMP integer representations. */
|
||||
|
||||
void mpz_set_double_int (mpz_t, double_int, bool);
|
||||
double_int mpz_get_double_int (const_tree, mpz_t, bool);
|
||||
#endif
|
||||
|
||||
#endif /* DOUBLE_INT_H */
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
/* Definitions for the shared dumpfile.
|
||||
Copyright (C) 2004-2013 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
|
||||
#ifndef GCC_DUMPFILE_H
|
||||
#define GCC_DUMPFILE_H 1
|
||||
|
||||
#include "line-map.h"
|
||||
|
||||
/* Different tree dump places. When you add new tree dump places,
|
||||
extend the DUMP_FILES array in dumpfile.c. */
|
||||
enum tree_dump_index
|
||||
{
|
||||
TDI_none, /* No dump */
|
||||
TDI_cgraph, /* dump function call graph. */
|
||||
TDI_tu, /* dump the whole translation unit. */
|
||||
TDI_class, /* dump class hierarchy. */
|
||||
TDI_original, /* dump each function before optimizing it */
|
||||
TDI_generic, /* dump each function after genericizing it */
|
||||
TDI_nested, /* dump each function after unnesting it */
|
||||
TDI_tree_all, /* enable all the GENERIC/GIMPLE dumps. */
|
||||
TDI_rtl_all, /* enable all the RTL dumps. */
|
||||
TDI_ipa_all, /* enable all the IPA dumps. */
|
||||
|
||||
TDI_end
|
||||
};
|
||||
|
||||
/* Bit masks to control dumping. Not all values are applicable to all
|
||||
dumps. Add new ones at the end. When you define new values, extend
|
||||
the DUMP_OPTIONS array in dumpfile.c. The TDF_* flags coexist with
|
||||
MSG_* flags (for -fopt-info) and the bit values must be chosen to
|
||||
allow that. */
|
||||
#define TDF_ADDRESS (1 << 0) /* dump node addresses */
|
||||
#define TDF_SLIM (1 << 1) /* don't go wild following links */
|
||||
#define TDF_RAW (1 << 2) /* don't unparse the function */
|
||||
#define TDF_DETAILS (1 << 3) /* show more detailed info about
|
||||
each pass */
|
||||
#define TDF_STATS (1 << 4) /* dump various statistics about
|
||||
each pass */
|
||||
#define TDF_BLOCKS (1 << 5) /* display basic block boundaries */
|
||||
#define TDF_VOPS (1 << 6) /* display virtual operands */
|
||||
#define TDF_LINENO (1 << 7) /* display statement line numbers */
|
||||
#define TDF_UID (1 << 8) /* display decl UIDs */
|
||||
|
||||
#define TDF_TREE (1 << 9) /* is a tree dump */
|
||||
#define TDF_RTL (1 << 10) /* is a RTL dump */
|
||||
#define TDF_IPA (1 << 11) /* is an IPA dump */
|
||||
#define TDF_STMTADDR (1 << 12) /* Address of stmt. */
|
||||
|
||||
#define TDF_GRAPH (1 << 13) /* a graph dump is being emitted */
|
||||
#define TDF_MEMSYMS (1 << 14) /* display memory symbols in expr.
|
||||
Implies TDF_VOPS. */
|
||||
|
||||
#define TDF_DIAGNOSTIC (1 << 15) /* A dump to be put in a diagnostic
|
||||
message. */
|
||||
#define TDF_VERBOSE (1 << 16) /* A dump that uses the full tree
|
||||
dumper to print stmts. */
|
||||
#define TDF_RHS_ONLY (1 << 17) /* a flag to only print the RHS of
|
||||
a gimple stmt. */
|
||||
#define TDF_ASMNAME (1 << 18) /* display asm names of decls */
|
||||
#define TDF_EH (1 << 19) /* display EH region number
|
||||
holding this gimple statement. */
|
||||
#define TDF_NOUID (1 << 20) /* omit UIDs from dumps. */
|
||||
#define TDF_ALIAS (1 << 21) /* display alias information */
|
||||
#define TDF_ENUMERATE_LOCALS (1 << 22) /* Enumerate locals by uid. */
|
||||
#define TDF_CSELIB (1 << 23) /* Dump cselib details. */
|
||||
#define TDF_SCEV (1 << 24) /* Dump SCEV details. */
|
||||
#define TDF_COMMENT (1 << 25) /* Dump lines with prefix ";;" */
|
||||
#define MSG_OPTIMIZED_LOCATIONS (1 << 26) /* -fopt-info optimized sources */
|
||||
#define MSG_MISSED_OPTIMIZATION (1 << 27) /* missed opportunities */
|
||||
#define MSG_NOTE (1 << 28) /* general optimization info */
|
||||
#define MSG_ALL (MSG_OPTIMIZED_LOCATIONS | MSG_MISSED_OPTIMIZATION \
|
||||
| MSG_NOTE)
|
||||
|
||||
|
||||
/* Flags to control high-level -fopt-info dumps. Usually these flags
|
||||
define a group of passes. An optimization pass can be part of
|
||||
multiple groups. */
|
||||
#define OPTGROUP_NONE (0)
|
||||
#define OPTGROUP_IPA (1 << 1) /* IPA optimization passes */
|
||||
#define OPTGROUP_LOOP (1 << 2) /* Loop optimization passes */
|
||||
#define OPTGROUP_INLINE (1 << 3) /* Inlining passes */
|
||||
#define OPTGROUP_VEC (1 << 4) /* Vectorization passes */
|
||||
#define OPTGROUP_ALL (OPTGROUP_IPA | OPTGROUP_LOOP | OPTGROUP_INLINE \
|
||||
| OPTGROUP_VEC)
|
||||
|
||||
/* Define a tree dump switch. */
|
||||
struct dump_file_info
|
||||
{
|
||||
const char *suffix; /* suffix to give output file. */
|
||||
const char *swtch; /* command line dump switch */
|
||||
const char *glob; /* command line glob */
|
||||
const char *pfilename; /* filename for the pass-specific stream */
|
||||
const char *alt_filename; /* filename for the -fopt-info stream */
|
||||
FILE *pstream; /* pass-specific dump stream */
|
||||
FILE *alt_stream; /* -fopt-info stream */
|
||||
int pflags; /* dump flags */
|
||||
int optgroup_flags; /* optgroup flags for -fopt-info */
|
||||
int alt_flags; /* flags for opt-info */
|
||||
int pstate; /* state of pass-specific stream */
|
||||
int alt_state; /* state of the -fopt-info stream */
|
||||
int num; /* dump file number */
|
||||
};
|
||||
|
||||
/* In dumpfile.c */
|
||||
extern char *get_dump_file_name (int);
|
||||
extern int dump_initialized_p (int);
|
||||
extern FILE *dump_begin (int, int *);
|
||||
extern void dump_end (int, FILE *);
|
||||
extern int dump_start (int, int *);
|
||||
extern void dump_finish (int);
|
||||
extern void dump_node (const_tree, int, FILE *);
|
||||
extern int dump_switch_p (const char *);
|
||||
extern int opt_info_switch_p (const char *);
|
||||
extern const char *dump_flag_name (int);
|
||||
extern void dump_printf (int, const char *, ...) ATTRIBUTE_PRINTF_2;
|
||||
extern void dump_printf_loc (int, source_location,
|
||||
const char *, ...) ATTRIBUTE_PRINTF_3;
|
||||
extern void dump_basic_block (int, basic_block, int);
|
||||
extern void dump_generic_expr_loc (int, source_location, int, tree);
|
||||
extern void dump_generic_expr (int, int, tree);
|
||||
extern void dump_gimple_stmt_loc (int, source_location, int, gimple, int);
|
||||
extern void dump_gimple_stmt (int, int, gimple, int);
|
||||
extern void print_combine_total_stats (void);
|
||||
extern unsigned int dump_register (const char *, const char *, const char *,
|
||||
int, int);
|
||||
extern bool enable_rtl_dump_file (void);
|
||||
|
||||
/* In combine.c */
|
||||
extern void dump_combine_total_stats (FILE *);
|
||||
/* In cfghooks.c */
|
||||
extern void dump_bb (FILE *, basic_block, int, int);
|
||||
|
||||
/* Global variables used to communicate with passes. */
|
||||
extern FILE *dump_file;
|
||||
extern FILE *alt_dump_file;
|
||||
extern int dump_flags;
|
||||
extern const char *dump_file_name;
|
||||
|
||||
/* Return the dump_file_info for the given phase. */
|
||||
extern struct dump_file_info *get_dump_file_info (int);
|
||||
|
||||
/* Return true if any of the dumps is enabled, false otherwise. */
|
||||
static inline bool
|
||||
dump_enabled_p (void)
|
||||
{
|
||||
return (dump_file || alt_dump_file);
|
||||
}
|
||||
|
||||
#endif /* GCC_DUMPFILE_H */
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
/* Exported functions from emit-rtl.c
|
||||
Copyright (C) 2004-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_EMIT_RTL_H
|
||||
#define GCC_EMIT_RTL_H
|
||||
|
||||
/* Set the alias set of MEM to SET. */
|
||||
extern void set_mem_alias_set (rtx, alias_set_type);
|
||||
|
||||
/* Set the alignment of MEM to ALIGN bits. */
|
||||
extern void set_mem_align (rtx, unsigned int);
|
||||
|
||||
/* Set the address space of MEM to ADDRSPACE. */
|
||||
extern void set_mem_addr_space (rtx, addr_space_t);
|
||||
|
||||
/* Set the expr for MEM to EXPR. */
|
||||
extern void set_mem_expr (rtx, tree);
|
||||
|
||||
/* Set the offset for MEM to OFFSET. */
|
||||
extern void set_mem_offset (rtx, HOST_WIDE_INT);
|
||||
|
||||
/* Clear the offset recorded for MEM. */
|
||||
extern void clear_mem_offset (rtx);
|
||||
|
||||
/* Set the size for MEM to SIZE. */
|
||||
extern void set_mem_size (rtx, HOST_WIDE_INT);
|
||||
|
||||
/* Clear the size recorded for MEM. */
|
||||
extern void clear_mem_size (rtx);
|
||||
|
||||
/* Set the attributes for MEM appropriate for a spill slot. */
|
||||
extern void set_mem_attrs_for_spill (rtx);
|
||||
extern tree get_spill_slot_decl (bool);
|
||||
|
||||
/* Return a memory reference like MEMREF, but with its address changed to
|
||||
ADDR. The caller is asserting that the actual piece of memory pointed
|
||||
to is the same, just the form of the address is being changed, such as
|
||||
by putting something into a register. */
|
||||
extern rtx replace_equiv_address (rtx, rtx);
|
||||
|
||||
/* Likewise, but the reference is not required to be valid. */
|
||||
extern rtx replace_equiv_address_nv (rtx, rtx);
|
||||
|
||||
extern rtx gen_blockage (void);
|
||||
extern rtvec gen_rtvec (int, ...);
|
||||
extern rtx copy_insn_1 (rtx);
|
||||
extern rtx copy_insn (rtx);
|
||||
extern rtx copy_delay_slot_insn (rtx);
|
||||
extern rtx gen_int_mode (HOST_WIDE_INT, enum machine_mode);
|
||||
extern rtx emit_copy_of_insn_after (rtx, rtx);
|
||||
extern void set_reg_attrs_from_value (rtx, rtx);
|
||||
extern void set_reg_attrs_for_parm (rtx, rtx);
|
||||
extern void set_reg_attrs_for_decl_rtl (tree t, rtx x);
|
||||
extern void adjust_reg_mode (rtx, enum machine_mode);
|
||||
extern int mem_expr_equal_p (const_tree, const_tree);
|
||||
|
||||
extern bool need_atomic_barrier_p (enum memmodel, bool);
|
||||
|
||||
/* Return the first insn of the current sequence or current function. */
|
||||
|
||||
static inline rtx
|
||||
get_insns (void)
|
||||
{
|
||||
return crtl->emit.x_first_insn;
|
||||
}
|
||||
|
||||
/* Specify a new insn as the first in the chain. */
|
||||
|
||||
static inline void
|
||||
set_first_insn (rtx insn)
|
||||
{
|
||||
gcc_checking_assert (!insn || !PREV_INSN (insn));
|
||||
crtl->emit.x_first_insn = insn;
|
||||
}
|
||||
|
||||
/* Return the last insn emitted in current sequence or current function. */
|
||||
|
||||
static inline rtx
|
||||
get_last_insn (void)
|
||||
{
|
||||
return crtl->emit.x_last_insn;
|
||||
}
|
||||
|
||||
/* Specify a new insn as the last in the chain. */
|
||||
|
||||
static inline void
|
||||
set_last_insn (rtx insn)
|
||||
{
|
||||
gcc_checking_assert (!insn || !NEXT_INSN (insn));
|
||||
crtl->emit.x_last_insn = insn;
|
||||
}
|
||||
|
||||
/* Return a number larger than any instruction's uid in this function. */
|
||||
|
||||
static inline int
|
||||
get_max_uid (void)
|
||||
{
|
||||
return crtl->emit.x_cur_insn_uid;
|
||||
}
|
||||
#endif /* GCC_EMIT_RTL_H */
|
||||
|
|
@ -0,0 +1,335 @@
|
|||
/* Exception Handling interface routines.
|
||||
Copyright (C) 1996-2013 Free Software Foundation, Inc.
|
||||
Contributed by Mike Stump <mrs@cygnus.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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
/* No include guards here, but define an include file marker anyway, so
|
||||
that the compiler can keep track of where this file is included. This
|
||||
is e.g. used to avoid including this file in front-end specific files. */
|
||||
#ifndef GCC_EXCEPT_H
|
||||
# define GCC_EXCEPT_H
|
||||
#endif
|
||||
|
||||
#include "hashtab.h"
|
||||
|
||||
struct function;
|
||||
struct eh_region_d;
|
||||
struct pointer_map_t;
|
||||
|
||||
/* The type of an exception region. */
|
||||
enum eh_region_type
|
||||
{
|
||||
/* CLEANUP regions implement e.g. destructors run when exiting a block.
|
||||
They can be generated from both GIMPLE_TRY_FINALLY and GIMPLE_TRY_CATCH
|
||||
nodes. It is expected by the runtime that cleanup regions will *not*
|
||||
resume normal program flow, but will continue propagation of the
|
||||
exception. */
|
||||
ERT_CLEANUP,
|
||||
|
||||
/* TRY regions implement catching an exception. The list of types associated
|
||||
with the attached catch handlers is examined in order by the runtime and
|
||||
control is transferred to the appropriate handler. Note that a NULL type
|
||||
list is a catch-all handler, and that it will catch *all* exceptions
|
||||
including those originating from a different language. */
|
||||
ERT_TRY,
|
||||
|
||||
/* ALLOWED_EXCEPTIONS regions implement exception filtering, e.g. the
|
||||
throw(type-list) specification that can be added to C++ functions.
|
||||
The runtime examines the thrown exception vs the type list, and if
|
||||
the exception does not match, transfers control to the handler. The
|
||||
normal handler for C++ calls __cxa_call_unexpected. */
|
||||
ERT_ALLOWED_EXCEPTIONS,
|
||||
|
||||
/* MUST_NOT_THROW regions prevent all exceptions from propagating. This
|
||||
region type is used in C++ to surround destructors being run inside a
|
||||
CLEANUP region. This differs from an ALLOWED_EXCEPTIONS region with
|
||||
an empty type list in that the runtime is prepared to terminate the
|
||||
program directly. We only generate code for MUST_NOT_THROW regions
|
||||
along control paths that are already handling an exception within the
|
||||
current function. */
|
||||
ERT_MUST_NOT_THROW
|
||||
};
|
||||
|
||||
|
||||
/* A landing pad for a given exception region. Any transfer of control
|
||||
from the EH runtime to the function happens at a landing pad. */
|
||||
|
||||
struct GTY(()) eh_landing_pad_d
|
||||
{
|
||||
/* The linked list of all landing pads associated with the region. */
|
||||
struct eh_landing_pad_d *next_lp;
|
||||
|
||||
/* The region with which this landing pad is associated. */
|
||||
struct eh_region_d *region;
|
||||
|
||||
/* At the gimple level, the location to which control will be transferred
|
||||
for this landing pad. There can be both EH and normal edges into the
|
||||
block containing the post-landing-pad label. */
|
||||
tree post_landing_pad;
|
||||
|
||||
/* At the rtl level, the location to which the runtime will transfer
|
||||
control. This differs from the post-landing-pad in that the target's
|
||||
EXCEPTION_RECEIVER pattern will be expanded here, as well as other
|
||||
bookkeeping specific to exceptions. There must not be normal edges
|
||||
into the block containing the landing-pad label. */
|
||||
rtx landing_pad;
|
||||
|
||||
/* The index of this landing pad within fun->eh->lp_array. */
|
||||
int index;
|
||||
};
|
||||
|
||||
/* A catch handler associated with an ERT_TRY region. */
|
||||
|
||||
struct GTY(()) eh_catch_d
|
||||
{
|
||||
/* The double-linked list of all catch handlers for the region. */
|
||||
struct eh_catch_d *next_catch;
|
||||
struct eh_catch_d *prev_catch;
|
||||
|
||||
/* A TREE_LIST of runtime type objects that this catch handler
|
||||
will catch, or NULL if all exceptions are caught. */
|
||||
tree type_list;
|
||||
|
||||
/* A TREE_LIST of INTEGER_CSTs that correspond to the type_list entries,
|
||||
having been mapped by assign_filter_values. These integers are to be
|
||||
compared against the __builtin_eh_filter value. */
|
||||
tree filter_list;
|
||||
|
||||
/* The code that should be executed if this catch handler matches the
|
||||
thrown exception. This label is only maintained until
|
||||
pass_lower_eh_dispatch, at which point it is cleared. */
|
||||
tree label;
|
||||
};
|
||||
|
||||
/* Describes one exception region. */
|
||||
|
||||
struct GTY(()) eh_region_d
|
||||
{
|
||||
/* The immediately surrounding region. */
|
||||
struct eh_region_d *outer;
|
||||
|
||||
/* The list of immediately contained regions. */
|
||||
struct eh_region_d *inner;
|
||||
struct eh_region_d *next_peer;
|
||||
|
||||
/* The index of this region within fun->eh->region_array. */
|
||||
int index;
|
||||
|
||||
/* Each region does exactly one thing. */
|
||||
enum eh_region_type type;
|
||||
|
||||
/* Holds the action to perform based on the preceding type. */
|
||||
union eh_region_u {
|
||||
struct eh_region_u_try {
|
||||
/* The double-linked list of all catch handlers for this region. */
|
||||
struct eh_catch_d *first_catch;
|
||||
struct eh_catch_d *last_catch;
|
||||
} GTY ((tag ("ERT_TRY"))) eh_try;
|
||||
|
||||
struct eh_region_u_allowed {
|
||||
/* A TREE_LIST of runtime type objects allowed to pass. */
|
||||
tree type_list;
|
||||
/* The code that should be executed if the thrown exception does
|
||||
not match the type list. This label is only maintained until
|
||||
pass_lower_eh_dispatch, at which point it is cleared. */
|
||||
tree label;
|
||||
/* The integer that will be passed by the runtime to signal that
|
||||
we should execute the code at LABEL. This integer is assigned
|
||||
by assign_filter_values and is to be compared against the
|
||||
__builtin_eh_filter value. */
|
||||
int filter;
|
||||
} GTY ((tag ("ERT_ALLOWED_EXCEPTIONS"))) allowed;
|
||||
|
||||
struct eh_region_u_must_not_throw {
|
||||
/* A function decl to be invoked if this region is actually reachable
|
||||
from within the function, rather than implementable from the runtime.
|
||||
The normal way for this to happen is for there to be a CLEANUP region
|
||||
contained within this MUST_NOT_THROW region. Note that if the
|
||||
runtime handles the MUST_NOT_THROW region, we have no control over
|
||||
what termination function is called; it will be decided by the
|
||||
personality function in effect for this CIE. */
|
||||
tree failure_decl;
|
||||
/* The location assigned to the call of FAILURE_DECL, if expanded. */
|
||||
location_t failure_loc;
|
||||
} GTY ((tag ("ERT_MUST_NOT_THROW"))) must_not_throw;
|
||||
} GTY ((desc ("%0.type"))) u;
|
||||
|
||||
/* The list of landing pads associated with this region. */
|
||||
struct eh_landing_pad_d *landing_pads;
|
||||
|
||||
/* EXC_PTR and FILTER values copied from the runtime for this region.
|
||||
Each region gets its own psuedos so that if there are nested exceptions
|
||||
we do not overwrite the values of the first exception. */
|
||||
rtx exc_ptr_reg, filter_reg;
|
||||
|
||||
/* True if this region should use __cxa_end_cleanup instead
|
||||
of _Unwind_Resume. */
|
||||
bool use_cxa_end_cleanup;
|
||||
};
|
||||
|
||||
typedef struct eh_landing_pad_d *eh_landing_pad;
|
||||
typedef struct eh_catch_d *eh_catch;
|
||||
typedef struct eh_region_d *eh_region;
|
||||
|
||||
|
||||
|
||||
|
||||
/* The exception status for each function. */
|
||||
|
||||
struct GTY(()) eh_status
|
||||
{
|
||||
/* The tree of all regions for this function. */
|
||||
eh_region region_tree;
|
||||
|
||||
/* The same information as an indexable array. */
|
||||
vec<eh_region, va_gc> *region_array;
|
||||
|
||||
/* The landing pads as an indexable array. */
|
||||
vec<eh_landing_pad, va_gc> *lp_array;
|
||||
|
||||
/* At the gimple level, a mapping from gimple statement to landing pad
|
||||
or must-not-throw region. See record_stmt_eh_region. */
|
||||
htab_t GTY((param_is (struct throw_stmt_node))) throw_stmt_table;
|
||||
|
||||
/* All of the runtime type data used by the function. These objects
|
||||
are emitted to the lang-specific-data-area for the function. */
|
||||
vec<tree, va_gc> *ttype_data;
|
||||
|
||||
/* The table of all action chains. These encode the eh_region tree in
|
||||
a compact form for use by the runtime, and is also emitted to the
|
||||
lang-specific-data-area. Note that the ARM EABI uses a different
|
||||
format for the encoding than all other ports. */
|
||||
union eh_status_u {
|
||||
vec<tree, va_gc> *GTY((tag ("1"))) arm_eabi;
|
||||
vec<uchar, va_gc> *GTY((tag ("0"))) other;
|
||||
} GTY ((desc ("targetm.arm_eabi_unwinder"))) ehspec_data;
|
||||
};
|
||||
|
||||
|
||||
/* Invokes CALLBACK for every exception handler label. Only used by old
|
||||
loop hackery; should not be used by new code. */
|
||||
extern void for_each_eh_label (void (*) (rtx));
|
||||
|
||||
extern void init_eh_for_function (void);
|
||||
|
||||
extern void remove_eh_landing_pad (eh_landing_pad);
|
||||
extern void remove_eh_handler (eh_region);
|
||||
extern void remove_unreachable_eh_regions (sbitmap);
|
||||
|
||||
extern bool current_function_has_exception_handlers (void);
|
||||
extern void output_function_exception_table (const char *);
|
||||
|
||||
extern rtx expand_builtin_eh_pointer (tree);
|
||||
extern rtx expand_builtin_eh_filter (tree);
|
||||
extern rtx expand_builtin_eh_copy_values (tree);
|
||||
extern void expand_builtin_unwind_init (void);
|
||||
extern rtx expand_builtin_eh_return_data_regno (tree);
|
||||
extern rtx expand_builtin_extract_return_addr (tree);
|
||||
extern void expand_builtin_init_dwarf_reg_sizes (tree);
|
||||
extern rtx expand_builtin_frob_return_addr (tree);
|
||||
extern rtx expand_builtin_dwarf_sp_column (void);
|
||||
extern void expand_builtin_eh_return (tree, tree);
|
||||
extern void expand_eh_return (void);
|
||||
extern rtx expand_builtin_extend_pointer (tree);
|
||||
extern void expand_dw2_landing_pad_for_region (eh_region);
|
||||
|
||||
typedef tree (*duplicate_eh_regions_map) (tree, void *);
|
||||
extern struct pointer_map_t *duplicate_eh_regions
|
||||
(struct function *, eh_region, int, duplicate_eh_regions_map, void *);
|
||||
|
||||
extern void sjlj_emit_function_exit_after (rtx);
|
||||
|
||||
extern eh_region gen_eh_region_cleanup (eh_region);
|
||||
extern eh_region gen_eh_region_try (eh_region);
|
||||
extern eh_region gen_eh_region_allowed (eh_region, tree);
|
||||
extern eh_region gen_eh_region_must_not_throw (eh_region);
|
||||
|
||||
extern eh_catch gen_eh_region_catch (eh_region, tree);
|
||||
extern eh_landing_pad gen_eh_landing_pad (eh_region);
|
||||
|
||||
extern eh_region get_eh_region_from_number_fn (struct function *, int);
|
||||
extern eh_region get_eh_region_from_number (int);
|
||||
extern eh_landing_pad get_eh_landing_pad_from_number_fn (struct function*,int);
|
||||
extern eh_landing_pad get_eh_landing_pad_from_number (int);
|
||||
extern eh_region get_eh_region_from_lp_number_fn (struct function *, int);
|
||||
extern eh_region get_eh_region_from_lp_number (int);
|
||||
|
||||
extern eh_region eh_region_outermost (struct function *, eh_region, eh_region);
|
||||
|
||||
extern void make_reg_eh_region_note (rtx insn, int ecf_flags, int lp_nr);
|
||||
extern void make_reg_eh_region_note_nothrow_nononlocal (rtx);
|
||||
|
||||
extern void verify_eh_tree (struct function *);
|
||||
extern void dump_eh_tree (FILE *, struct function *);
|
||||
void debug_eh_tree (struct function *);
|
||||
extern void add_type_for_runtime (tree);
|
||||
extern tree lookup_type_for_runtime (tree);
|
||||
extern void assign_filter_values (void);
|
||||
|
||||
extern eh_region get_eh_region_from_rtx (const_rtx);
|
||||
extern eh_landing_pad get_eh_landing_pad_from_rtx (const_rtx);
|
||||
|
||||
extern void finish_eh_generation (void);
|
||||
|
||||
struct GTY(()) throw_stmt_node {
|
||||
gimple stmt;
|
||||
int lp_nr;
|
||||
};
|
||||
|
||||
extern struct htab *get_eh_throw_stmt_table (struct function *);
|
||||
extern void set_eh_throw_stmt_table (struct function *, struct htab *);
|
||||
|
||||
enum eh_personality_kind {
|
||||
eh_personality_none,
|
||||
eh_personality_any,
|
||||
eh_personality_lang
|
||||
};
|
||||
|
||||
extern enum eh_personality_kind
|
||||
function_needs_eh_personality (struct function *);
|
||||
|
||||
/* Pre-order iteration within the eh_region tree. */
|
||||
|
||||
static inline eh_region
|
||||
ehr_next (eh_region r, eh_region start)
|
||||
{
|
||||
if (r->inner)
|
||||
r = r->inner;
|
||||
else if (r->next_peer && r != start)
|
||||
r = r->next_peer;
|
||||
else
|
||||
{
|
||||
do
|
||||
{
|
||||
r = r->outer;
|
||||
if (r == start)
|
||||
return NULL;
|
||||
}
|
||||
while (r->next_peer == NULL);
|
||||
r = r->next_peer;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
#define FOR_ALL_EH_REGION_AT(R, START) \
|
||||
for ((R) = (START); (R) != NULL; (R) = ehr_next (R, START))
|
||||
|
||||
#define FOR_ALL_EH_REGION_FN(R, FN) \
|
||||
for ((R) = (FN)->eh->region_tree; (R) != NULL; (R) = ehr_next (R, NULL))
|
||||
|
||||
#define FOR_ALL_EH_REGION(R) FOR_ALL_EH_REGION_FN (R, cfun)
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
/* Macros for taking apart, interpreting and processing file names.
|
||||
|
||||
These are here because some non-Posix (a.k.a. DOSish) systems have
|
||||
drive letter brain-damage at the beginning of an absolute file name,
|
||||
use forward- and back-slash in path names interchangeably, and
|
||||
some of them have case-insensitive file names.
|
||||
|
||||
Copyright 2000, 2001, 2007, 2010 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of BFD, the Binary File Descriptor library.
|
||||
|
||||
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. */
|
||||
|
||||
#ifndef FILENAMES_H
|
||||
#define FILENAMES_H
|
||||
|
||||
#include "hashtab.h" /* for hashval_t */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) || defined (__CYGWIN__)
|
||||
# ifndef HAVE_DOS_BASED_FILE_SYSTEM
|
||||
# define HAVE_DOS_BASED_FILE_SYSTEM 1
|
||||
# endif
|
||||
# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
|
||||
# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
|
||||
# endif
|
||||
# define HAS_DRIVE_SPEC(f) HAS_DOS_DRIVE_SPEC (f)
|
||||
# define IS_DIR_SEPARATOR(c) IS_DOS_DIR_SEPARATOR (c)
|
||||
# define IS_ABSOLUTE_PATH(f) IS_DOS_ABSOLUTE_PATH (f)
|
||||
#else /* not DOSish */
|
||||
# if defined(__APPLE__)
|
||||
# ifndef HAVE_CASE_INSENSITIVE_FILE_SYSTEM
|
||||
# define HAVE_CASE_INSENSITIVE_FILE_SYSTEM 1
|
||||
# endif
|
||||
# endif /* __APPLE__ */
|
||||
# define HAS_DRIVE_SPEC(f) (0)
|
||||
# define IS_DIR_SEPARATOR(c) IS_UNIX_DIR_SEPARATOR (c)
|
||||
# define IS_ABSOLUTE_PATH(f) IS_UNIX_ABSOLUTE_PATH (f)
|
||||
#endif
|
||||
|
||||
#define IS_DIR_SEPARATOR_1(dos_based, c) \
|
||||
(((c) == '/') \
|
||||
|| (((c) == '\\') && (dos_based)))
|
||||
|
||||
#define HAS_DRIVE_SPEC_1(dos_based, f) \
|
||||
((f)[0] && ((f)[1] == ':') && (dos_based))
|
||||
|
||||
/* Remove the drive spec from F, assuming HAS_DRIVE_SPEC (f).
|
||||
The result is a pointer to the remainder of F. */
|
||||
#define STRIP_DRIVE_SPEC(f) ((f) + 2)
|
||||
|
||||
#define IS_DOS_DIR_SEPARATOR(c) IS_DIR_SEPARATOR_1 (1, c)
|
||||
#define IS_DOS_ABSOLUTE_PATH(f) IS_ABSOLUTE_PATH_1 (1, f)
|
||||
#define HAS_DOS_DRIVE_SPEC(f) HAS_DRIVE_SPEC_1 (1, f)
|
||||
|
||||
#define IS_UNIX_DIR_SEPARATOR(c) IS_DIR_SEPARATOR_1 (0, c)
|
||||
#define IS_UNIX_ABSOLUTE_PATH(f) IS_ABSOLUTE_PATH_1 (0, f)
|
||||
|
||||
/* Note that when DOS_BASED is true, IS_ABSOLUTE_PATH accepts d:foo as
|
||||
well, although it is only semi-absolute. This is because the users
|
||||
of IS_ABSOLUTE_PATH want to know whether to prepend the current
|
||||
working directory to a file name, which should not be done with a
|
||||
name like d:foo. */
|
||||
#define IS_ABSOLUTE_PATH_1(dos_based, f) \
|
||||
(IS_DIR_SEPARATOR_1 (dos_based, (f)[0]) \
|
||||
|| HAS_DRIVE_SPEC_1 (dos_based, f))
|
||||
|
||||
extern int filename_cmp (const char *s1, const char *s2);
|
||||
#define FILENAME_CMP(s1, s2) filename_cmp(s1, s2)
|
||||
|
||||
extern int filename_ncmp (const char *s1, const char *s2,
|
||||
size_t n);
|
||||
|
||||
extern hashval_t filename_hash (const void *s);
|
||||
|
||||
extern int filename_eq (const void *s1, const void *s2);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* FILENAMES_H */
|
||||
|
|
@ -0,0 +1,116 @@
|
|||
/* Fixed-point arithmetic support.
|
||||
Copyright (C) 2006-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_FIXED_VALUE_H
|
||||
#define GCC_FIXED_VALUE_H
|
||||
|
||||
#include "machmode.h"
|
||||
#include "real.h"
|
||||
#include "double-int.h"
|
||||
|
||||
struct GTY(()) fixed_value
|
||||
{
|
||||
double_int data; /* Store data up to 2 wide integers. */
|
||||
enum machine_mode mode; /* Use machine mode to know IBIT and FBIT. */
|
||||
};
|
||||
|
||||
#define FIXED_VALUE_TYPE struct fixed_value
|
||||
|
||||
#define MAX_FCONST0 18 /* For storing 18 fixed-point zeros per
|
||||
fract, ufract, accum, and uaccum modes . */
|
||||
#define MAX_FCONST1 8 /* For storing 8 fixed-point ones per accum
|
||||
and uaccum modes. */
|
||||
/* Constant fixed-point values 0 and 1. */
|
||||
extern FIXED_VALUE_TYPE fconst0[MAX_FCONST0];
|
||||
extern FIXED_VALUE_TYPE fconst1[MAX_FCONST1];
|
||||
|
||||
/* Macros to access fconst0 and fconst1 via machine modes. */
|
||||
#define FCONST0(mode) fconst0[mode - QQmode]
|
||||
#define FCONST1(mode) fconst1[mode - HAmode]
|
||||
|
||||
/* Return a CONST_FIXED with value R and mode M. */
|
||||
#define CONST_FIXED_FROM_FIXED_VALUE(r, m) \
|
||||
const_fixed_from_fixed_value (r, m)
|
||||
extern rtx const_fixed_from_fixed_value (FIXED_VALUE_TYPE, enum machine_mode);
|
||||
|
||||
/* Construct a FIXED_VALUE from a bit payload and machine mode MODE.
|
||||
The bits in PAYLOAD are sign-extended/zero-extended according to MODE. */
|
||||
extern FIXED_VALUE_TYPE fixed_from_double_int (double_int,
|
||||
enum machine_mode);
|
||||
|
||||
/* Return a CONST_FIXED from a bit payload and machine mode MODE.
|
||||
The bits in PAYLOAD are sign-extended/zero-extended according to MODE. */
|
||||
static inline rtx
|
||||
const_fixed_from_double_int (double_int payload,
|
||||
enum machine_mode mode)
|
||||
{
|
||||
return
|
||||
const_fixed_from_fixed_value (fixed_from_double_int (payload, mode),
|
||||
mode);
|
||||
}
|
||||
|
||||
/* Initialize from a decimal or hexadecimal string. */
|
||||
extern void fixed_from_string (FIXED_VALUE_TYPE *, const char *,
|
||||
enum machine_mode);
|
||||
|
||||
/* In tree.c: wrap up a FIXED_VALUE_TYPE in a tree node. */
|
||||
extern tree build_fixed (tree, FIXED_VALUE_TYPE);
|
||||
|
||||
/* Extend or truncate to a new mode. */
|
||||
extern bool fixed_convert (FIXED_VALUE_TYPE *, enum machine_mode,
|
||||
const FIXED_VALUE_TYPE *, bool);
|
||||
|
||||
/* Convert to a fixed-point mode from an integer. */
|
||||
extern bool fixed_convert_from_int (FIXED_VALUE_TYPE *, enum machine_mode,
|
||||
double_int, bool, bool);
|
||||
|
||||
/* Convert to a fixed-point mode from a real. */
|
||||
extern bool fixed_convert_from_real (FIXED_VALUE_TYPE *, enum machine_mode,
|
||||
const REAL_VALUE_TYPE *, bool);
|
||||
|
||||
/* Convert to a real mode from a fixed-point. */
|
||||
extern void real_convert_from_fixed (REAL_VALUE_TYPE *, enum machine_mode,
|
||||
const FIXED_VALUE_TYPE *);
|
||||
|
||||
/* Compare two fixed-point objects for bitwise identity. */
|
||||
extern bool fixed_identical (const FIXED_VALUE_TYPE *, const FIXED_VALUE_TYPE *);
|
||||
|
||||
/* Calculate a hash value. */
|
||||
extern unsigned int fixed_hash (const FIXED_VALUE_TYPE *);
|
||||
|
||||
#define FIXED_VALUES_IDENTICAL(x, y) fixed_identical (&(x), &(y))
|
||||
|
||||
/* Determine whether a fixed-point value X is negative. */
|
||||
#define FIXED_VALUE_NEGATIVE(x) fixed_isneg (&(x))
|
||||
|
||||
/* Render F as a decimal floating point constant. */
|
||||
extern void fixed_to_decimal (char *str, const FIXED_VALUE_TYPE *, size_t);
|
||||
|
||||
/* Binary or unary arithmetic on tree_code. */
|
||||
extern bool fixed_arithmetic (FIXED_VALUE_TYPE *, int, const FIXED_VALUE_TYPE *,
|
||||
const FIXED_VALUE_TYPE *, bool);
|
||||
|
||||
/* Compare fixed-point values by tree_code. */
|
||||
extern bool fixed_compare (int, const FIXED_VALUE_TYPE *,
|
||||
const FIXED_VALUE_TYPE *);
|
||||
|
||||
/* Determine whether a fixed-point value X is negative. */
|
||||
extern bool fixed_isneg (const FIXED_VALUE_TYPE *);
|
||||
|
||||
#endif /* GCC_FIXED_VALUE_H */
|
||||
|
|
@ -0,0 +1,194 @@
|
|||
/* Compilation switch flag type definitions for GCC.
|
||||
Copyright (C) 1987-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_FLAG_TYPES_H
|
||||
#define GCC_FLAG_TYPES_H
|
||||
|
||||
enum debug_info_type
|
||||
{
|
||||
NO_DEBUG, /* Write no debug info. */
|
||||
DBX_DEBUG, /* Write BSD .stabs for DBX (using dbxout.c). */
|
||||
SDB_DEBUG, /* Write COFF for (old) SDB (using sdbout.c). */
|
||||
DWARF2_DEBUG, /* Write Dwarf v2 debug info (using dwarf2out.c). */
|
||||
XCOFF_DEBUG, /* Write IBM/Xcoff debug info (using dbxout.c). */
|
||||
VMS_DEBUG, /* Write VMS debug info (using vmsdbgout.c). */
|
||||
VMS_AND_DWARF2_DEBUG /* Write VMS debug info (using vmsdbgout.c).
|
||||
and DWARF v2 debug info (using dwarf2out.c). */
|
||||
};
|
||||
|
||||
enum debug_info_levels
|
||||
{
|
||||
DINFO_LEVEL_NONE, /* Write no debugging info. */
|
||||
DINFO_LEVEL_TERSE, /* Write minimal info to support tracebacks only. */
|
||||
DINFO_LEVEL_NORMAL, /* Write info for all declarations (and line table). */
|
||||
DINFO_LEVEL_VERBOSE /* Write normal info plus #define/#undef info. */
|
||||
};
|
||||
|
||||
/* A major contribution to object and executable size is debug
|
||||
information size. A major contribution to debug information
|
||||
size is struct descriptions replicated in several object files.
|
||||
The following function determines whether or not debug information
|
||||
should be generated for a given struct. The indirect parameter
|
||||
indicates that the struct is being handled indirectly, via
|
||||
a pointer. See opts.c for the implementation. */
|
||||
|
||||
enum debug_info_usage
|
||||
{
|
||||
DINFO_USAGE_DFN, /* A struct definition. */
|
||||
DINFO_USAGE_DIR_USE, /* A direct use, such as the type of a variable. */
|
||||
DINFO_USAGE_IND_USE, /* An indirect use, such as through a pointer. */
|
||||
DINFO_USAGE_NUM_ENUMS /* The number of enumerators. */
|
||||
};
|
||||
|
||||
/* A major contribution to object and executable size is debug
|
||||
information size. A major contribution to debug information size
|
||||
is struct descriptions replicated in several object files. The
|
||||
following flags attempt to reduce this information. The basic
|
||||
idea is to not emit struct debugging information in the current
|
||||
compilation unit when that information will be generated by
|
||||
another compilation unit.
|
||||
|
||||
Debug information for a struct defined in the current source
|
||||
file should be generated in the object file. Likewise the
|
||||
debug information for a struct defined in a header should be
|
||||
generated in the object file of the corresponding source file.
|
||||
Both of these case are handled when the base name of the file of
|
||||
the struct definition matches the base name of the source file
|
||||
of the current compilation unit. This matching emits minimal
|
||||
struct debugging information.
|
||||
|
||||
The base file name matching rule above will fail to emit debug
|
||||
information for structs defined in system headers. So a second
|
||||
category of files includes system headers in addition to files
|
||||
with matching bases.
|
||||
|
||||
The remaining types of files are library headers and application
|
||||
headers. We cannot currently distinguish these two types. */
|
||||
|
||||
enum debug_struct_file
|
||||
{
|
||||
DINFO_STRUCT_FILE_NONE, /* Debug no structs. */
|
||||
DINFO_STRUCT_FILE_BASE, /* Debug structs defined in files with the
|
||||
same base name as the compilation unit. */
|
||||
DINFO_STRUCT_FILE_SYS, /* Also debug structs defined in system
|
||||
header files. */
|
||||
DINFO_STRUCT_FILE_ANY /* Debug structs defined in all files. */
|
||||
};
|
||||
|
||||
/* Enumerate visibility settings. This is deliberately ordered from most
|
||||
to least visibility. */
|
||||
#ifndef SYMBOL_VISIBILITY_DEFINED
|
||||
#define SYMBOL_VISIBILITY_DEFINED
|
||||
enum symbol_visibility
|
||||
{
|
||||
VISIBILITY_DEFAULT,
|
||||
VISIBILITY_PROTECTED,
|
||||
VISIBILITY_HIDDEN,
|
||||
VISIBILITY_INTERNAL
|
||||
};
|
||||
#endif
|
||||
|
||||
/* The stack reuse level. */
|
||||
enum stack_reuse_level
|
||||
{
|
||||
SR_NONE,
|
||||
SR_NAMED_VARS,
|
||||
SR_ALL
|
||||
};
|
||||
|
||||
/* The algorithm used for the integrated register allocator (IRA). */
|
||||
enum ira_algorithm
|
||||
{
|
||||
IRA_ALGORITHM_CB,
|
||||
IRA_ALGORITHM_PRIORITY
|
||||
};
|
||||
|
||||
/* The regions used for the integrated register allocator (IRA). */
|
||||
enum ira_region
|
||||
{
|
||||
IRA_REGION_ONE,
|
||||
IRA_REGION_ALL,
|
||||
IRA_REGION_MIXED,
|
||||
/* This value means that there were no options -fira-region on the
|
||||
command line and that we should choose a value depending on the
|
||||
used -O option. */
|
||||
IRA_REGION_AUTODETECT
|
||||
};
|
||||
|
||||
/* The options for excess precision. */
|
||||
enum excess_precision
|
||||
{
|
||||
EXCESS_PRECISION_DEFAULT,
|
||||
EXCESS_PRECISION_FAST,
|
||||
EXCESS_PRECISION_STANDARD
|
||||
};
|
||||
|
||||
/* Type of stack check. */
|
||||
enum stack_check_type
|
||||
{
|
||||
/* Do not check the stack. */
|
||||
NO_STACK_CHECK = 0,
|
||||
|
||||
/* Check the stack generically, i.e. assume no specific support
|
||||
from the target configuration files. */
|
||||
GENERIC_STACK_CHECK,
|
||||
|
||||
/* Check the stack and rely on the target configuration files to
|
||||
check the static frame of functions, i.e. use the generic
|
||||
mechanism only for dynamic stack allocations. */
|
||||
STATIC_BUILTIN_STACK_CHECK,
|
||||
|
||||
/* Check the stack and entirely rely on the target configuration
|
||||
files, i.e. do not use the generic mechanism at all. */
|
||||
FULL_BUILTIN_STACK_CHECK
|
||||
};
|
||||
|
||||
/* Names for the different levels of -Wstrict-overflow=N. The numeric
|
||||
values here correspond to N. */
|
||||
|
||||
enum warn_strict_overflow_code
|
||||
{
|
||||
/* Overflow warning that should be issued with -Wall: a questionable
|
||||
construct that is easy to avoid even when using macros. Example:
|
||||
folding (x + CONSTANT > x) to 1. */
|
||||
WARN_STRICT_OVERFLOW_ALL = 1,
|
||||
/* Overflow warning about folding a comparison to a constant because
|
||||
of undefined signed overflow, other than cases covered by
|
||||
WARN_STRICT_OVERFLOW_ALL. Example: folding (abs (x) >= 0) to 1
|
||||
(this is false when x == INT_MIN). */
|
||||
WARN_STRICT_OVERFLOW_CONDITIONAL = 2,
|
||||
/* Overflow warning about changes to comparisons other than folding
|
||||
them to a constant. Example: folding (x + 1 > 1) to (x > 0). */
|
||||
WARN_STRICT_OVERFLOW_COMPARISON = 3,
|
||||
/* Overflow warnings not covered by the above cases. Example:
|
||||
folding ((x * 10) / 5) to (x * 2). */
|
||||
WARN_STRICT_OVERFLOW_MISC = 4,
|
||||
/* Overflow warnings about reducing magnitude of constants in
|
||||
comparison. Example: folding (x + 2 > y) to (x + 1 >= y). */
|
||||
WARN_STRICT_OVERFLOW_MAGNITUDE = 5
|
||||
};
|
||||
|
||||
/* Floating-point contraction mode. */
|
||||
enum fp_contract_mode {
|
||||
FP_CONTRACT_OFF = 0,
|
||||
FP_CONTRACT_ON = 1,
|
||||
FP_CONTRACT_FAST = 2
|
||||
};
|
||||
|
||||
#endif /* ! GCC_FLAG_TYPES_H */
|
||||
|
|
@ -0,0 +1,101 @@
|
|||
/* Compilation switch flag definitions for GCC.
|
||||
Copyright (C) 1987-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_FLAGS_H
|
||||
#define GCC_FLAGS_H
|
||||
|
||||
#include "flag-types.h"
|
||||
#include "options.h"
|
||||
|
||||
#if !defined(IN_LIBGCC2) && !defined(IN_TARGET_LIBS) && !defined(IN_RTS)
|
||||
|
||||
/* Names of debug_info_type, for error messages. */
|
||||
extern const char *const debug_type_names[];
|
||||
|
||||
extern void strip_off_ending (char *, int);
|
||||
extern int base_of_path (const char *path, const char **base_out);
|
||||
|
||||
/* Return true iff flags are set as if -ffast-math. */
|
||||
extern bool fast_math_flags_set_p (const struct gcc_options *);
|
||||
extern bool fast_math_flags_struct_set_p (struct cl_optimization *);
|
||||
|
||||
|
||||
/* Now the symbols that are set with `-f' switches. */
|
||||
|
||||
/* True if printing into -fdump-final-insns= dump. */
|
||||
|
||||
extern bool final_insns_dump_p;
|
||||
|
||||
|
||||
/* Other basic status info about current function. */
|
||||
|
||||
/* Target-dependent global state. */
|
||||
struct target_flag_state {
|
||||
/* Values of the -falign-* flags: how much to align labels in code.
|
||||
0 means `use default', 1 means `don't align'.
|
||||
For each variable, there is an _log variant which is the power
|
||||
of two not less than the variable, for .align output. */
|
||||
int x_align_loops_log;
|
||||
int x_align_loops_max_skip;
|
||||
int x_align_jumps_log;
|
||||
int x_align_jumps_max_skip;
|
||||
int x_align_labels_log;
|
||||
int x_align_labels_max_skip;
|
||||
int x_align_functions_log;
|
||||
|
||||
/* The excess precision currently in effect. */
|
||||
enum excess_precision x_flag_excess_precision;
|
||||
};
|
||||
|
||||
extern struct target_flag_state default_target_flag_state;
|
||||
#if SWITCHABLE_TARGET
|
||||
extern struct target_flag_state *this_target_flag_state;
|
||||
#else
|
||||
#define this_target_flag_state (&default_target_flag_state)
|
||||
#endif
|
||||
|
||||
#define align_loops_log \
|
||||
(this_target_flag_state->x_align_loops_log)
|
||||
#define align_loops_max_skip \
|
||||
(this_target_flag_state->x_align_loops_max_skip)
|
||||
#define align_jumps_log \
|
||||
(this_target_flag_state->x_align_jumps_log)
|
||||
#define align_jumps_max_skip \
|
||||
(this_target_flag_state->x_align_jumps_max_skip)
|
||||
#define align_labels_log \
|
||||
(this_target_flag_state->x_align_labels_log)
|
||||
#define align_labels_max_skip \
|
||||
(this_target_flag_state->x_align_labels_max_skip)
|
||||
#define align_functions_log \
|
||||
(this_target_flag_state->x_align_functions_log)
|
||||
#define flag_excess_precision \
|
||||
(this_target_flag_state->x_flag_excess_precision)
|
||||
|
||||
/* Returns TRUE if generated code should match ABI version N or
|
||||
greater is in use. */
|
||||
|
||||
#define abi_version_at_least(N) \
|
||||
(flag_abi_version == 0 || flag_abi_version >= (N))
|
||||
|
||||
/* Whether to emit an overflow warning whose code is C. */
|
||||
#define issue_strict_overflow_warning(c) (warn_strict_overflow >= (int) (c))
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* ! GCC_FLAGS_H */
|
||||
|
|
@ -0,0 +1,782 @@
|
|||
/* Structure for saving state for a nested function.
|
||||
Copyright (C) 1989-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_FUNCTION_H
|
||||
#define GCC_FUNCTION_H
|
||||
|
||||
#include "hashtab.h"
|
||||
#include "vec.h"
|
||||
#include "machmode.h"
|
||||
#include "tm.h" /* For CUMULATIVE_ARGS. */
|
||||
#include "hard-reg-set.h" /* For HARD_REG_SET in struct rtl_data. */
|
||||
#include "input.h" /* For location_t. */
|
||||
|
||||
/* Stack of pending (incomplete) sequences saved by `start_sequence'.
|
||||
Each element describes one pending sequence.
|
||||
The main insn-chain is saved in the last element of the chain,
|
||||
unless the chain is empty. */
|
||||
|
||||
struct GTY(()) sequence_stack {
|
||||
/* First and last insns in the chain of the saved sequence. */
|
||||
rtx first;
|
||||
rtx last;
|
||||
struct sequence_stack *next;
|
||||
};
|
||||
|
||||
struct GTY(()) emit_status {
|
||||
/* This is reset to LAST_VIRTUAL_REGISTER + 1 at the start of each function.
|
||||
After rtl generation, it is 1 plus the largest register number used. */
|
||||
int x_reg_rtx_no;
|
||||
|
||||
/* Lowest label number in current function. */
|
||||
int x_first_label_num;
|
||||
|
||||
/* The ends of the doubly-linked chain of rtl for the current function.
|
||||
Both are reset to null at the start of rtl generation for the function.
|
||||
|
||||
start_sequence saves both of these on `sequence_stack' and then starts
|
||||
a new, nested sequence of insns. */
|
||||
rtx x_first_insn;
|
||||
rtx x_last_insn;
|
||||
|
||||
/* Stack of pending (incomplete) sequences saved by `start_sequence'.
|
||||
Each element describes one pending sequence.
|
||||
The main insn-chain is saved in the last element of the chain,
|
||||
unless the chain is empty. */
|
||||
struct sequence_stack *sequence_stack;
|
||||
|
||||
/* INSN_UID for next insn emitted.
|
||||
Reset to 1 for each function compiled. */
|
||||
int x_cur_insn_uid;
|
||||
|
||||
/* INSN_UID for next debug insn emitted. Only used if
|
||||
--param min-nondebug-insn-uid=<value> is given with nonzero value. */
|
||||
int x_cur_debug_insn_uid;
|
||||
|
||||
/* The length of the regno_pointer_align, regno_decl, and x_regno_reg_rtx
|
||||
vectors. Since these vectors are needed during the expansion phase when
|
||||
the total number of registers in the function is not yet known, the
|
||||
vectors are copied and made bigger when necessary. */
|
||||
int regno_pointer_align_length;
|
||||
|
||||
/* Indexed by pseudo register number, if nonzero gives the known alignment
|
||||
for that pseudo (if REG_POINTER is set in x_regno_reg_rtx).
|
||||
Allocated in parallel with x_regno_reg_rtx. */
|
||||
unsigned char * GTY((skip)) regno_pointer_align;
|
||||
};
|
||||
|
||||
|
||||
/* Indexed by register number, gives an rtx for that register (and only
|
||||
that register). For pseudo registers, it is the unique rtx for
|
||||
that pseudo. For hard registers, it is an rtx of the mode specified
|
||||
by reg_raw_mode.
|
||||
|
||||
FIXME: We could put it into emit_status struct, but gengtype is not
|
||||
able to deal with length attribute nested in top level structures. */
|
||||
|
||||
extern GTY ((length ("crtl->emit.x_reg_rtx_no"))) rtx * regno_reg_rtx;
|
||||
|
||||
/* For backward compatibility... eventually these should all go away. */
|
||||
#define reg_rtx_no (crtl->emit.x_reg_rtx_no)
|
||||
#define seq_stack (crtl->emit.sequence_stack)
|
||||
|
||||
#define REGNO_POINTER_ALIGN(REGNO) (crtl->emit.regno_pointer_align[REGNO])
|
||||
|
||||
struct GTY(()) expr_status {
|
||||
/* Number of units that we should eventually pop off the stack.
|
||||
These are the arguments to function calls that have already returned. */
|
||||
int x_pending_stack_adjust;
|
||||
|
||||
/* Under some ABIs, it is the caller's responsibility to pop arguments
|
||||
pushed for function calls. A naive implementation would simply pop
|
||||
the arguments immediately after each call. However, if several
|
||||
function calls are made in a row, it is typically cheaper to pop
|
||||
all the arguments after all of the calls are complete since a
|
||||
single pop instruction can be used. Therefore, GCC attempts to
|
||||
defer popping the arguments until absolutely necessary. (For
|
||||
example, at the end of a conditional, the arguments must be popped,
|
||||
since code outside the conditional won't know whether or not the
|
||||
arguments need to be popped.)
|
||||
|
||||
When INHIBIT_DEFER_POP is nonzero, however, the compiler does not
|
||||
attempt to defer pops. Instead, the stack is popped immediately
|
||||
after each call. Rather then setting this variable directly, use
|
||||
NO_DEFER_POP and OK_DEFER_POP. */
|
||||
int x_inhibit_defer_pop;
|
||||
|
||||
/* If PREFERRED_STACK_BOUNDARY and PUSH_ROUNDING are defined, the stack
|
||||
boundary can be momentarily unaligned while pushing the arguments.
|
||||
Record the delta since last aligned boundary here in order to get
|
||||
stack alignment in the nested function calls working right. */
|
||||
int x_stack_pointer_delta;
|
||||
|
||||
/* Nonzero means __builtin_saveregs has already been done in this function.
|
||||
The value is the pseudoreg containing the value __builtin_saveregs
|
||||
returned. */
|
||||
rtx x_saveregs_value;
|
||||
|
||||
/* Similarly for __builtin_apply_args. */
|
||||
rtx x_apply_args_value;
|
||||
|
||||
/* List of labels that must never be deleted. */
|
||||
rtx x_forced_labels;
|
||||
};
|
||||
|
||||
typedef struct call_site_record_d *call_site_record;
|
||||
|
||||
/* RTL representation of exception handling. */
|
||||
struct GTY(()) rtl_eh {
|
||||
rtx ehr_stackadj;
|
||||
rtx ehr_handler;
|
||||
rtx ehr_label;
|
||||
|
||||
rtx sjlj_fc;
|
||||
rtx sjlj_exit_after;
|
||||
|
||||
vec<uchar, va_gc> *action_record_data;
|
||||
|
||||
vec<call_site_record, va_gc> *call_site_record_v[2];
|
||||
};
|
||||
|
||||
#define pending_stack_adjust (crtl->expr.x_pending_stack_adjust)
|
||||
#define inhibit_defer_pop (crtl->expr.x_inhibit_defer_pop)
|
||||
#define saveregs_value (crtl->expr.x_saveregs_value)
|
||||
#define apply_args_value (crtl->expr.x_apply_args_value)
|
||||
#define forced_labels (crtl->expr.x_forced_labels)
|
||||
#define stack_pointer_delta (crtl->expr.x_stack_pointer_delta)
|
||||
|
||||
struct gimple_df;
|
||||
struct temp_slot;
|
||||
typedef struct temp_slot *temp_slot_p;
|
||||
struct call_site_record_d;
|
||||
struct dw_fde_struct;
|
||||
|
||||
struct ipa_opt_pass_d;
|
||||
typedef struct ipa_opt_pass_d *ipa_opt_pass;
|
||||
|
||||
|
||||
struct GTY(()) varasm_status {
|
||||
/* If we're using a per-function constant pool, this is it. */
|
||||
struct rtx_constant_pool *pool;
|
||||
|
||||
/* Number of tree-constants deferred during the expansion of this
|
||||
function. */
|
||||
unsigned int deferred_constants;
|
||||
};
|
||||
|
||||
/* Information mainlined about RTL representation of incoming arguments. */
|
||||
struct GTY(()) incoming_args {
|
||||
/* Number of bytes of args popped by function being compiled on its return.
|
||||
Zero if no bytes are to be popped.
|
||||
May affect compilation of return insn or of function epilogue. */
|
||||
int pops_args;
|
||||
|
||||
/* If function's args have a fixed size, this is that size, in bytes.
|
||||
Otherwise, it is -1.
|
||||
May affect compilation of return insn or of function epilogue. */
|
||||
int size;
|
||||
|
||||
/* # bytes the prologue should push and pretend that the caller pushed them.
|
||||
The prologue must do this, but only if parms can be passed in
|
||||
registers. */
|
||||
int pretend_args_size;
|
||||
|
||||
/* This is the offset from the arg pointer to the place where the first
|
||||
anonymous arg can be found, if there is one. */
|
||||
rtx arg_offset_rtx;
|
||||
|
||||
/* Quantities of various kinds of registers
|
||||
used for the current function's args. */
|
||||
CUMULATIVE_ARGS info;
|
||||
|
||||
/* The arg pointer hard register, or the pseudo into which it was copied. */
|
||||
rtx internal_arg_pointer;
|
||||
};
|
||||
|
||||
/* Data for function partitioning. */
|
||||
struct GTY(()) function_subsections {
|
||||
/* Assembly labels for the hot and cold text sections, to
|
||||
be used by debugger functions for determining the size of text
|
||||
sections. */
|
||||
|
||||
const char *hot_section_label;
|
||||
const char *cold_section_label;
|
||||
const char *hot_section_end_label;
|
||||
const char *cold_section_end_label;
|
||||
};
|
||||
|
||||
/* Describe an empty area of space in the stack frame. These can be chained
|
||||
into a list; this is used to keep track of space wasted for alignment
|
||||
reasons. */
|
||||
struct GTY(()) frame_space
|
||||
{
|
||||
struct frame_space *next;
|
||||
|
||||
HOST_WIDE_INT start;
|
||||
HOST_WIDE_INT length;
|
||||
};
|
||||
|
||||
/* Datastructures maintained for currently processed function in RTL form. */
|
||||
struct GTY(()) rtl_data {
|
||||
struct expr_status expr;
|
||||
struct emit_status emit;
|
||||
struct varasm_status varasm;
|
||||
struct incoming_args args;
|
||||
struct function_subsections subsections;
|
||||
struct rtl_eh eh;
|
||||
|
||||
/* For function.c */
|
||||
|
||||
/* # of bytes of outgoing arguments. If ACCUMULATE_OUTGOING_ARGS is
|
||||
defined, the needed space is pushed by the prologue. */
|
||||
int outgoing_args_size;
|
||||
|
||||
/* If nonzero, an RTL expression for the location at which the current
|
||||
function returns its result. If the current function returns its
|
||||
result in a register, current_function_return_rtx will always be
|
||||
the hard register containing the result. */
|
||||
rtx return_rtx;
|
||||
|
||||
/* Vector of initial-value pairs. Each pair consists of a pseudo
|
||||
register of approprite mode that stores the initial value a hard
|
||||
register REGNO, and that hard register itself. */
|
||||
/* ??? This could be a VEC but there is currently no way to define an
|
||||
opaque VEC type. */
|
||||
struct initial_value_struct *hard_reg_initial_vals;
|
||||
|
||||
/* A variable living at the top of the frame that holds a known value.
|
||||
Used for detecting stack clobbers. */
|
||||
tree stack_protect_guard;
|
||||
|
||||
/* List (chain of EXPR_LIST) of labels heading the current handlers for
|
||||
nonlocal gotos. */
|
||||
rtx x_nonlocal_goto_handler_labels;
|
||||
|
||||
/* Label that will go on function epilogue.
|
||||
Jumping to this label serves as a "return" instruction
|
||||
on machines which require execution of the epilogue on all returns. */
|
||||
rtx x_return_label;
|
||||
|
||||
/* Label that will go on the end of function epilogue.
|
||||
Jumping to this label serves as a "naked return" instruction
|
||||
on machines which require execution of the epilogue on all returns. */
|
||||
rtx x_naked_return_label;
|
||||
|
||||
/* List (chain of EXPR_LISTs) of all stack slots in this function.
|
||||
Made for the sake of unshare_all_rtl. */
|
||||
rtx x_stack_slot_list;
|
||||
|
||||
/* List of empty areas in the stack frame. */
|
||||
struct frame_space *frame_space_list;
|
||||
|
||||
/* Place after which to insert the tail_recursion_label if we need one. */
|
||||
rtx x_stack_check_probe_note;
|
||||
|
||||
/* Location at which to save the argument pointer if it will need to be
|
||||
referenced. There are two cases where this is done: if nonlocal gotos
|
||||
exist, or if vars stored at an offset from the argument pointer will be
|
||||
needed by inner routines. */
|
||||
rtx x_arg_pointer_save_area;
|
||||
|
||||
/* Dynamic Realign Argument Pointer used for realigning stack. */
|
||||
rtx drap_reg;
|
||||
|
||||
/* Offset to end of allocated area of stack frame.
|
||||
If stack grows down, this is the address of the last stack slot allocated.
|
||||
If stack grows up, this is the address for the next slot. */
|
||||
HOST_WIDE_INT x_frame_offset;
|
||||
|
||||
/* Insn after which register parms and SAVE_EXPRs are born, if nonopt. */
|
||||
rtx x_parm_birth_insn;
|
||||
|
||||
/* List of all used temporaries allocated, by level. */
|
||||
vec<temp_slot_p, va_gc> *x_used_temp_slots;
|
||||
|
||||
/* List of available temp slots. */
|
||||
struct temp_slot *x_avail_temp_slots;
|
||||
|
||||
/* Current nesting level for temporaries. */
|
||||
int x_temp_slot_level;
|
||||
|
||||
/* The largest alignment needed on the stack, including requirement
|
||||
for outgoing stack alignment. */
|
||||
unsigned int stack_alignment_needed;
|
||||
|
||||
/* Preferred alignment of the end of stack frame, which is preferred
|
||||
to call other functions. */
|
||||
unsigned int preferred_stack_boundary;
|
||||
|
||||
/* The minimum alignment of parameter stack. */
|
||||
unsigned int parm_stack_boundary;
|
||||
|
||||
/* The largest alignment of slot allocated on the stack. */
|
||||
unsigned int max_used_stack_slot_alignment;
|
||||
|
||||
/* The stack alignment estimated before reload, with consideration of
|
||||
following factors:
|
||||
1. Alignment of local stack variables (max_used_stack_slot_alignment)
|
||||
2. Alignment requirement to call other functions
|
||||
(preferred_stack_boundary)
|
||||
3. Alignment of non-local stack variables but might be spilled in
|
||||
local stack. */
|
||||
unsigned int stack_alignment_estimated;
|
||||
|
||||
/* For reorg. */
|
||||
|
||||
/* Nonzero if function being compiled called builtin_return_addr or
|
||||
builtin_frame_address with nonzero count. */
|
||||
bool accesses_prior_frames;
|
||||
|
||||
/* Nonzero if the function calls __builtin_eh_return. */
|
||||
bool calls_eh_return;
|
||||
|
||||
/* Nonzero if function saves all registers, e.g. if it has a nonlocal
|
||||
label that can reach the exit block via non-exceptional paths. */
|
||||
bool saves_all_registers;
|
||||
|
||||
/* Nonzero if function being compiled has nonlocal gotos to parent
|
||||
function. */
|
||||
bool has_nonlocal_goto;
|
||||
|
||||
/* Nonzero if function being compiled has an asm statement. */
|
||||
bool has_asm_statement;
|
||||
|
||||
/* This bit is used by the exception handling logic. It is set if all
|
||||
calls (if any) are sibling calls. Such functions do not have to
|
||||
have EH tables generated, as they cannot throw. A call to such a
|
||||
function, however, should be treated as throwing if any of its callees
|
||||
can throw. */
|
||||
bool all_throwers_are_sibcalls;
|
||||
|
||||
/* Nonzero if stack limit checking should be enabled in the current
|
||||
function. */
|
||||
bool limit_stack;
|
||||
|
||||
/* Nonzero if profiling code should be generated. */
|
||||
bool profile;
|
||||
|
||||
/* Nonzero if the current function uses the constant pool. */
|
||||
bool uses_const_pool;
|
||||
|
||||
/* Nonzero if the current function uses pic_offset_table_rtx. */
|
||||
bool uses_pic_offset_table;
|
||||
|
||||
/* Nonzero if the current function needs an lsda for exception handling. */
|
||||
bool uses_eh_lsda;
|
||||
|
||||
/* Set when the tail call has been produced. */
|
||||
bool tail_call_emit;
|
||||
|
||||
/* Nonzero if code to initialize arg_pointer_save_area has been emitted. */
|
||||
bool arg_pointer_save_area_init;
|
||||
|
||||
/* Nonzero if current function must be given a frame pointer.
|
||||
Set in reload1.c or lra-eliminations.c if anything is allocated
|
||||
on the stack there. */
|
||||
bool frame_pointer_needed;
|
||||
|
||||
/* When set, expand should optimize for speed. */
|
||||
bool maybe_hot_insn_p;
|
||||
|
||||
/* Nonzero if function stack realignment is needed. This flag may be
|
||||
set twice: before and after reload. It is set before reload wrt
|
||||
stack alignment estimation before reload. It will be changed after
|
||||
reload if by then criteria of stack realignment is different.
|
||||
The value set after reload is the accurate one and is finalized. */
|
||||
bool stack_realign_needed;
|
||||
|
||||
/* Nonzero if function stack realignment is tried. This flag is set
|
||||
only once before reload. It affects register elimination. This
|
||||
is used to generate DWARF debug info for stack variables. */
|
||||
bool stack_realign_tried;
|
||||
|
||||
/* Nonzero if function being compiled needs dynamic realigned
|
||||
argument pointer (drap) if stack needs realigning. */
|
||||
bool need_drap;
|
||||
|
||||
/* Nonzero if function stack realignment estimation is done, namely
|
||||
stack_realign_needed flag has been set before reload wrt estimated
|
||||
stack alignment info. */
|
||||
bool stack_realign_processed;
|
||||
|
||||
/* Nonzero if function stack realignment has been finalized, namely
|
||||
stack_realign_needed flag has been set and finalized after reload. */
|
||||
bool stack_realign_finalized;
|
||||
|
||||
/* True if dbr_schedule has already been called for this function. */
|
||||
bool dbr_scheduled_p;
|
||||
|
||||
/* True if current function can not throw. Unlike
|
||||
TREE_NOTHROW (current_function_decl) it is set even for overwritable
|
||||
function where currently compiled version of it is nothrow. */
|
||||
bool nothrow;
|
||||
|
||||
/* True if we performed shrink-wrapping for the current function. */
|
||||
bool shrink_wrapped;
|
||||
|
||||
/* Nonzero if function being compiled doesn't modify the stack pointer
|
||||
(ignoring the prologue and epilogue). This is only valid after
|
||||
pass_stack_ptr_mod has run. */
|
||||
bool sp_is_unchanging;
|
||||
|
||||
/* Nonzero if function being compiled doesn't contain any calls
|
||||
(ignoring the prologue and epilogue). This is set prior to
|
||||
local register allocation and is valid for the remaining
|
||||
compiler passes. */
|
||||
bool is_leaf;
|
||||
|
||||
/* Nonzero if the function being compiled is a leaf function which only
|
||||
uses leaf registers. This is valid after reload (specifically after
|
||||
sched2) and is useful only if the port defines LEAF_REGISTERS. */
|
||||
bool uses_only_leaf_regs;
|
||||
|
||||
/* Like regs_ever_live, but 1 if a reg is set or clobbered from an
|
||||
asm. Unlike regs_ever_live, elements of this array corresponding
|
||||
to eliminable regs (like the frame pointer) are set if an asm
|
||||
sets them. */
|
||||
HARD_REG_SET asm_clobbers;
|
||||
};
|
||||
|
||||
#define return_label (crtl->x_return_label)
|
||||
#define naked_return_label (crtl->x_naked_return_label)
|
||||
#define stack_slot_list (crtl->x_stack_slot_list)
|
||||
#define parm_birth_insn (crtl->x_parm_birth_insn)
|
||||
#define frame_offset (crtl->x_frame_offset)
|
||||
#define stack_check_probe_note (crtl->x_stack_check_probe_note)
|
||||
#define arg_pointer_save_area (crtl->x_arg_pointer_save_area)
|
||||
#define used_temp_slots (crtl->x_used_temp_slots)
|
||||
#define avail_temp_slots (crtl->x_avail_temp_slots)
|
||||
#define temp_slot_level (crtl->x_temp_slot_level)
|
||||
#define nonlocal_goto_handler_labels (crtl->x_nonlocal_goto_handler_labels)
|
||||
#define frame_pointer_needed (crtl->frame_pointer_needed)
|
||||
#define stack_realign_fp (crtl->stack_realign_needed && !crtl->need_drap)
|
||||
#define stack_realign_drap (crtl->stack_realign_needed && crtl->need_drap)
|
||||
|
||||
extern GTY(()) struct rtl_data x_rtl;
|
||||
|
||||
/* Accessor to RTL datastructures. We keep them statically allocated now since
|
||||
we never keep multiple functions. For threaded compiler we might however
|
||||
want to do differently. */
|
||||
#define crtl (&x_rtl)
|
||||
|
||||
struct GTY(()) stack_usage
|
||||
{
|
||||
/* # of bytes of static stack space allocated by the function. */
|
||||
HOST_WIDE_INT static_stack_size;
|
||||
|
||||
/* # of bytes of dynamic stack space allocated by the function. This is
|
||||
meaningful only if has_unbounded_dynamic_stack_size is zero. */
|
||||
HOST_WIDE_INT dynamic_stack_size;
|
||||
|
||||
/* # of bytes of space pushed onto the stack after the prologue. If
|
||||
!ACCUMULATE_OUTGOING_ARGS, it contains the outgoing arguments. */
|
||||
int pushed_stack_size;
|
||||
|
||||
/* Nonzero if the amount of stack space allocated dynamically cannot
|
||||
be bounded at compile-time. */
|
||||
unsigned int has_unbounded_dynamic_stack_size : 1;
|
||||
};
|
||||
|
||||
#define current_function_static_stack_size (cfun->su->static_stack_size)
|
||||
#define current_function_dynamic_stack_size (cfun->su->dynamic_stack_size)
|
||||
#define current_function_pushed_stack_size (cfun->su->pushed_stack_size)
|
||||
#define current_function_has_unbounded_dynamic_stack_size \
|
||||
(cfun->su->has_unbounded_dynamic_stack_size)
|
||||
#define current_function_allocates_dynamic_stack_space \
|
||||
(current_function_dynamic_stack_size != 0 \
|
||||
|| current_function_has_unbounded_dynamic_stack_size)
|
||||
|
||||
/* This structure can save all the important global and static variables
|
||||
describing the status of the current function. */
|
||||
|
||||
struct GTY(()) function {
|
||||
struct eh_status *eh;
|
||||
|
||||
/* The control flow graph for this function. */
|
||||
struct control_flow_graph *cfg;
|
||||
|
||||
/* GIMPLE body for this function. */
|
||||
gimple_seq gimple_body;
|
||||
|
||||
/* SSA and dataflow information. */
|
||||
struct gimple_df *gimple_df;
|
||||
|
||||
/* The loops in this function. */
|
||||
struct loops *x_current_loops;
|
||||
|
||||
/* The stack usage of this function. */
|
||||
struct stack_usage *su;
|
||||
|
||||
/* Value histograms attached to particular statements. */
|
||||
htab_t GTY((skip)) value_histograms;
|
||||
|
||||
/* For function.c. */
|
||||
|
||||
/* Points to the FUNCTION_DECL of this function. */
|
||||
tree decl;
|
||||
|
||||
/* A PARM_DECL that should contain the static chain for this function.
|
||||
It will be initialized at the beginning of the function. */
|
||||
tree static_chain_decl;
|
||||
|
||||
/* An expression that contains the non-local goto save area. The first
|
||||
word is the saved frame pointer and the second is the saved stack
|
||||
pointer. */
|
||||
tree nonlocal_goto_save_area;
|
||||
|
||||
/* Vector of function local variables, functions, types and constants. */
|
||||
vec<tree, va_gc> *local_decls;
|
||||
|
||||
/* For md files. */
|
||||
|
||||
/* tm.h can use this to store whatever it likes. */
|
||||
struct machine_function * GTY ((maybe_undef)) machine;
|
||||
|
||||
/* Language-specific code can use this to store whatever it likes. */
|
||||
struct language_function * language;
|
||||
|
||||
/* Used types hash table. */
|
||||
htab_t GTY ((param_is (union tree_node))) used_types_hash;
|
||||
|
||||
/* Dwarf2 Frame Description Entry, containing the Call Frame Instructions
|
||||
used for unwinding. Only set when either dwarf2 unwinding or dwarf2
|
||||
debugging is enabled. */
|
||||
struct dw_fde_struct *fde;
|
||||
|
||||
/* Last statement uid. */
|
||||
int last_stmt_uid;
|
||||
|
||||
/* Function sequence number for profiling, debugging, etc. */
|
||||
int funcdef_no;
|
||||
|
||||
/* Line number of the start of the function for debugging purposes. */
|
||||
location_t function_start_locus;
|
||||
|
||||
/* Line number of the end of the function. */
|
||||
location_t function_end_locus;
|
||||
|
||||
/* Properties used by the pass manager. */
|
||||
unsigned int curr_properties;
|
||||
unsigned int last_verified;
|
||||
|
||||
/* Non-null if the function does something that would prevent it from
|
||||
being copied; this applies to both versioning and inlining. Set to
|
||||
a string describing the reason for failure. */
|
||||
const char * GTY((skip)) cannot_be_copied_reason;
|
||||
|
||||
/* Collected bit flags. */
|
||||
|
||||
/* Number of units of general registers that need saving in stdarg
|
||||
function. What unit is depends on the backend, either it is number
|
||||
of bytes, or it can be number of registers. */
|
||||
unsigned int va_list_gpr_size : 8;
|
||||
|
||||
/* Number of units of floating point registers that need saving in stdarg
|
||||
function. */
|
||||
unsigned int va_list_fpr_size : 8;
|
||||
|
||||
/* Nonzero if function being compiled can call setjmp. */
|
||||
unsigned int calls_setjmp : 1;
|
||||
|
||||
/* Nonzero if function being compiled can call alloca,
|
||||
either as a subroutine or builtin. */
|
||||
unsigned int calls_alloca : 1;
|
||||
|
||||
/* Nonzero if function being compiled receives nonlocal gotos
|
||||
from nested functions. */
|
||||
unsigned int has_nonlocal_label : 1;
|
||||
|
||||
/* Nonzero if we've set cannot_be_copied_reason. I.e. if
|
||||
(cannot_be_copied_set && !cannot_be_copied_reason), the function
|
||||
can in fact be copied. */
|
||||
unsigned int cannot_be_copied_set : 1;
|
||||
|
||||
/* Nonzero if current function uses stdarg.h or equivalent. */
|
||||
unsigned int stdarg : 1;
|
||||
|
||||
unsigned int after_inlining : 1;
|
||||
unsigned int always_inline_functions_inlined : 1;
|
||||
|
||||
/* Nonzero if function being compiled can throw synchronous non-call
|
||||
exceptions. */
|
||||
unsigned int can_throw_non_call_exceptions : 1;
|
||||
|
||||
/* Nonzero if instructions that may throw exceptions but don't otherwise
|
||||
contribute to the execution of the program can be deleted. */
|
||||
unsigned int can_delete_dead_exceptions : 1;
|
||||
|
||||
/* Fields below this point are not set for abstract functions; see
|
||||
allocate_struct_function. */
|
||||
|
||||
/* Nonzero if function being compiled needs to be given an address
|
||||
where the value should be stored. */
|
||||
unsigned int returns_struct : 1;
|
||||
|
||||
/* Nonzero if function being compiled needs to
|
||||
return the address of where it has put a structure value. */
|
||||
unsigned int returns_pcc_struct : 1;
|
||||
|
||||
/* Nonzero if this function has local DECL_HARD_REGISTER variables.
|
||||
In this case code motion has to be done more carefully. */
|
||||
unsigned int has_local_explicit_reg_vars : 1;
|
||||
|
||||
/* Nonzero if the current function is a thunk, i.e., a lightweight
|
||||
function implemented by the output_mi_thunk hook) that just
|
||||
adjusts one of its arguments and forwards to another
|
||||
function. */
|
||||
unsigned int is_thunk : 1;
|
||||
};
|
||||
|
||||
/* Add the decl D to the local_decls list of FUN. */
|
||||
|
||||
static inline void
|
||||
add_local_decl (struct function *fun, tree d)
|
||||
{
|
||||
vec_safe_push (fun->local_decls, d);
|
||||
}
|
||||
|
||||
#define FOR_EACH_LOCAL_DECL(FUN, I, D) \
|
||||
FOR_EACH_VEC_SAFE_ELT_REVERSE ((FUN)->local_decls, I, D)
|
||||
|
||||
/* If va_list_[gf]pr_size is set to this, it means we don't know how
|
||||
many units need to be saved. */
|
||||
#define VA_LIST_MAX_GPR_SIZE 255
|
||||
#define VA_LIST_MAX_FPR_SIZE 255
|
||||
|
||||
/* The function currently being compiled. */
|
||||
extern GTY(()) struct function *cfun;
|
||||
|
||||
/* In order to ensure that cfun is not set directly, we redefine it so
|
||||
that it is not an lvalue. Rather than assign to cfun, use
|
||||
push_cfun or set_cfun. */
|
||||
#define cfun (cfun + 0)
|
||||
|
||||
/* Nonzero if we've already converted virtual regs to hard regs. */
|
||||
extern int virtuals_instantiated;
|
||||
|
||||
/* Nonzero if at least one trampoline has been created. */
|
||||
extern int trampolines_created;
|
||||
|
||||
struct GTY(()) types_used_by_vars_entry {
|
||||
tree type;
|
||||
tree var_decl;
|
||||
};
|
||||
|
||||
/* Hash table making the relationship between a global variable
|
||||
and the types it references in its initializer. The key of the
|
||||
entry is a referenced type, and the value is the DECL of the global
|
||||
variable. types_use_by_vars_do_hash and types_used_by_vars_eq below are
|
||||
the hash and equality functions to use for this hash table. */
|
||||
extern GTY((param_is (struct types_used_by_vars_entry))) htab_t
|
||||
types_used_by_vars_hash;
|
||||
|
||||
hashval_t types_used_by_vars_do_hash (const void*);
|
||||
int types_used_by_vars_eq (const void *, const void *);
|
||||
void types_used_by_var_decl_insert (tree type, tree var_decl);
|
||||
|
||||
/* During parsing of a global variable, this vector contains the types
|
||||
referenced by the global variable. */
|
||||
extern GTY(()) vec<tree, va_gc> *types_used_by_cur_var_decl;
|
||||
|
||||
/* cfun shouldn't be set directly; use one of these functions instead. */
|
||||
extern void set_cfun (struct function *new_cfun);
|
||||
extern void push_cfun (struct function *new_cfun);
|
||||
extern void pop_cfun (void);
|
||||
extern void instantiate_decl_rtl (rtx x);
|
||||
|
||||
/* For backward compatibility... eventually these should all go away. */
|
||||
#define current_function_funcdef_no (cfun->funcdef_no)
|
||||
|
||||
#define current_loops (cfun->x_current_loops)
|
||||
#define dom_computed (cfun->cfg->x_dom_computed)
|
||||
#define n_bbs_in_dom_tree (cfun->cfg->x_n_bbs_in_dom_tree)
|
||||
#define VALUE_HISTOGRAMS(fun) (fun)->value_histograms
|
||||
|
||||
/* Identify BLOCKs referenced by more than one NOTE_INSN_BLOCK_{BEG,END},
|
||||
and create duplicate blocks. */
|
||||
extern void reorder_blocks (void);
|
||||
|
||||
/* Set BLOCK_NUMBER for all the blocks in FN. */
|
||||
extern void number_blocks (tree);
|
||||
|
||||
extern void clear_block_marks (tree);
|
||||
extern tree blocks_nreverse (tree);
|
||||
extern tree block_chainon (tree, tree);
|
||||
|
||||
/* Return size needed for stack frame based on slots so far allocated.
|
||||
This size counts from zero. It is not rounded to STACK_BOUNDARY;
|
||||
the caller may have to do that. */
|
||||
extern HOST_WIDE_INT get_frame_size (void);
|
||||
|
||||
/* Issue an error message and return TRUE if frame OFFSET overflows in
|
||||
the signed target pointer arithmetics for function FUNC. Otherwise
|
||||
return FALSE. */
|
||||
extern bool frame_offset_overflow (HOST_WIDE_INT, tree);
|
||||
|
||||
/* A pointer to a function to create target specific, per-function
|
||||
data structures. */
|
||||
extern struct machine_function * (*init_machine_status) (void);
|
||||
|
||||
/* Save and restore status information for a nested function. */
|
||||
extern void free_after_parsing (struct function *);
|
||||
extern void free_after_compilation (struct function *);
|
||||
|
||||
extern void init_varasm_status (void);
|
||||
|
||||
#ifdef RTX_CODE
|
||||
extern void diddle_return_value (void (*)(rtx, void*), void*);
|
||||
extern void clobber_return_register (void);
|
||||
#endif
|
||||
|
||||
extern rtx get_arg_pointer_save_area (void);
|
||||
|
||||
/* Returns the name of the current function. */
|
||||
extern const char *fndecl_name (tree);
|
||||
extern const char *function_name (struct function *);
|
||||
extern const char *current_function_name (void);
|
||||
|
||||
extern void do_warn_unused_parameter (tree);
|
||||
|
||||
extern bool pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
|
||||
tree, bool);
|
||||
extern bool reference_callee_copied (CUMULATIVE_ARGS *, enum machine_mode,
|
||||
tree, bool);
|
||||
|
||||
extern void used_types_insert (tree);
|
||||
|
||||
extern int get_next_funcdef_no (void);
|
||||
extern int get_last_funcdef_no (void);
|
||||
|
||||
#ifdef HAVE_simple_return
|
||||
extern bool requires_stack_frame_p (rtx, HARD_REG_SET, HARD_REG_SET);
|
||||
#endif
|
||||
|
||||
extern rtx get_hard_reg_initial_val (enum machine_mode, unsigned int);
|
||||
extern rtx has_hard_reg_initial_val (enum machine_mode, unsigned int);
|
||||
extern rtx get_hard_reg_initial_reg (rtx);
|
||||
extern bool initial_value_entry (int i, rtx *, rtx *);
|
||||
|
||||
/* Called from gimple_expand_cfg. */
|
||||
extern unsigned int emit_initial_value_sets (void);
|
||||
|
||||
/* In predict.c */
|
||||
extern bool optimize_function_for_size_p (struct function *);
|
||||
extern bool optimize_function_for_speed_p (struct function *);
|
||||
|
||||
#endif /* GCC_FUNCTION_H */
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
/* Public header file for plugins to include.
|
||||
Copyright (C) 2009-2013 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 3, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_PLUGIN_H
|
||||
#define GCC_PLUGIN_H
|
||||
|
||||
#ifndef IN_GCC
|
||||
#define IN_GCC
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "coretypes.h"
|
||||
#include "highlev-plugin-common.h"
|
||||
#include "hashtab.h"
|
||||
|
||||
/* Event names. */
|
||||
enum plugin_event
|
||||
{
|
||||
# define DEFEVENT(NAME) NAME,
|
||||
# include "plugin.def"
|
||||
# undef DEFEVENT
|
||||
PLUGIN_EVENT_FIRST_DYNAMIC
|
||||
};
|
||||
|
||||
/* All globals declared here have C linkage to reduce link compatibility
|
||||
issues with implementation language choice and mangling. */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern const char **plugin_event_name;
|
||||
|
||||
struct plugin_argument
|
||||
{
|
||||
char *key; /* key of the argument. */
|
||||
char *value; /* value is optional and can be NULL. */
|
||||
};
|
||||
|
||||
/* Additional information about the plugin. Used by --help and --version. */
|
||||
|
||||
struct plugin_info
|
||||
{
|
||||
const char *version;
|
||||
const char *help;
|
||||
};
|
||||
|
||||
/* Represents the gcc version. Used to avoid using an incompatible plugin. */
|
||||
|
||||
struct plugin_gcc_version
|
||||
{
|
||||
const char *basever;
|
||||
const char *datestamp;
|
||||
const char *devphase;
|
||||
const char *revision;
|
||||
const char *configuration_arguments;
|
||||
};
|
||||
|
||||
/* Object that keeps track of the plugin name and its arguments. */
|
||||
struct plugin_name_args
|
||||
{
|
||||
char *base_name; /* Short name of the plugin (filename without
|
||||
.so suffix). */
|
||||
const char *full_name; /* Path to the plugin as specified with
|
||||
-fplugin=. */
|
||||
int argc; /* Number of arguments specified with
|
||||
-fplugin-arg-... */
|
||||
struct plugin_argument *argv; /* Array of ARGC key-value pairs. */
|
||||
const char *version; /* Version string provided by plugin. */
|
||||
const char *help; /* Help string provided by plugin. */
|
||||
};
|
||||
|
||||
/* The default version check. Compares every field in VERSION. */
|
||||
|
||||
extern bool plugin_default_version_check (struct plugin_gcc_version *,
|
||||
struct plugin_gcc_version *);
|
||||
|
||||
/* Function type for the plugin initialization routine. Each plugin module
|
||||
should define this as an externally-visible function with name
|
||||
"plugin_init."
|
||||
|
||||
PLUGIN_INFO - plugin invocation information.
|
||||
VERSION - the plugin_gcc_version symbol of GCC.
|
||||
|
||||
Returns 0 if initialization finishes successfully. */
|
||||
|
||||
typedef int (*plugin_init_func) (struct plugin_name_args *plugin_info,
|
||||
struct plugin_gcc_version *version);
|
||||
|
||||
/* Declaration for "plugin_init" function so that it doesn't need to be
|
||||
duplicated in every plugin. */
|
||||
extern int plugin_init (struct plugin_name_args *plugin_info,
|
||||
struct plugin_gcc_version *version);
|
||||
|
||||
/* Function type for a plugin callback routine.
|
||||
|
||||
GCC_DATA - event-specific data provided by GCC
|
||||
USER_DATA - plugin-specific data provided by the plugin */
|
||||
|
||||
typedef void (*plugin_callback_func) (void *gcc_data, void *user_data);
|
||||
|
||||
/* Called from the plugin's initialization code. Register a single callback.
|
||||
This function can be called multiple times.
|
||||
|
||||
PLUGIN_NAME - display name for this plugin
|
||||
EVENT - which event the callback is for
|
||||
CALLBACK - the callback to be called at the event
|
||||
USER_DATA - plugin-provided data.
|
||||
*/
|
||||
|
||||
/* Number of event ids / names registered so far. */
|
||||
|
||||
extern int get_event_last (void);
|
||||
|
||||
int get_named_event_id (const char *name, enum insert_option insert);
|
||||
|
||||
/* This is also called without a callback routine for the
|
||||
PLUGIN_PASS_MANAGER_SETUP, PLUGIN_INFO, PLUGIN_REGISTER_GGC_ROOTS and
|
||||
PLUGIN_REGISTER_GGC_CACHES pseudo-events, with a specific user_data.
|
||||
*/
|
||||
|
||||
extern void register_callback (const char *plugin_name,
|
||||
int event,
|
||||
plugin_callback_func callback,
|
||||
void *user_data);
|
||||
|
||||
extern int unregister_callback (const char *plugin_name, int event);
|
||||
|
||||
|
||||
/* Retrieve the plugin directory name, as returned by the
|
||||
-fprint-file-name=plugin argument to the gcc program, which is the
|
||||
-iplugindir program argument to cc1. */
|
||||
extern const char* default_plugin_dir_name (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* In case the C++ compiler does name mangling for globals, declare
|
||||
plugin_is_GPL_compatible extern "C" so that a later definition
|
||||
in a plugin file will have this linkage. */
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
extern int plugin_is_GPL_compatible;
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GCC_PLUGIN_H */
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,279 @@
|
|||
/* Garbage collection for the GNU compiler.
|
||||
|
||||
Copyright (C) 1998-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_GGC_H
|
||||
#define GCC_GGC_H
|
||||
#include "statistics.h"
|
||||
|
||||
/* Symbols are marked with `ggc' for `gcc gc' so as not to interfere with
|
||||
an external gc library that might be linked in. */
|
||||
|
||||
/* Constants for general use. */
|
||||
extern const char empty_string[]; /* empty string */
|
||||
|
||||
/* Internal functions and data structures used by the GTY
|
||||
machinery, including the generated gt*.[hc] files. */
|
||||
|
||||
#include "gtype-desc.h"
|
||||
|
||||
/* One of these applies its third parameter (with cookie in the fourth
|
||||
parameter) to each pointer in the object pointed to by the first
|
||||
parameter, using the second parameter. */
|
||||
typedef void (*gt_note_pointers) (void *, void *, gt_pointer_operator,
|
||||
void *);
|
||||
|
||||
/* One of these is called before objects are re-ordered in memory.
|
||||
The first parameter is the original object, the second is the
|
||||
subobject that has had its pointers reordered, the third parameter
|
||||
can compute the new values of a pointer when given the cookie in
|
||||
the fourth parameter. */
|
||||
typedef void (*gt_handle_reorder) (void *, void *, gt_pointer_operator,
|
||||
void *);
|
||||
|
||||
/* Used by the gt_pch_n_* routines. Register an object in the hash table. */
|
||||
extern int gt_pch_note_object (void *, void *, gt_note_pointers);
|
||||
|
||||
/* Used by the gt_pch_n_* routines. Register that an object has a reorder
|
||||
function. */
|
||||
extern void gt_pch_note_reorder (void *, void *, gt_handle_reorder);
|
||||
|
||||
/* Mark the object in the first parameter and anything it points to. */
|
||||
typedef void (*gt_pointer_walker) (void *);
|
||||
|
||||
/* Structures for the easy way to mark roots.
|
||||
In an array, terminated by having base == NULL. */
|
||||
struct ggc_root_tab {
|
||||
void *base;
|
||||
size_t nelt;
|
||||
size_t stride;
|
||||
gt_pointer_walker cb;
|
||||
gt_pointer_walker pchw;
|
||||
};
|
||||
#define LAST_GGC_ROOT_TAB { NULL, 0, 0, NULL, NULL }
|
||||
/* Pointers to arrays of ggc_root_tab, terminated by NULL. */
|
||||
extern const struct ggc_root_tab * const gt_ggc_rtab[];
|
||||
extern const struct ggc_root_tab * const gt_ggc_deletable_rtab[];
|
||||
extern const struct ggc_root_tab * const gt_pch_cache_rtab[];
|
||||
extern const struct ggc_root_tab * const gt_pch_scalar_rtab[];
|
||||
|
||||
/* Structure for hash table cache marking. */
|
||||
struct htab;
|
||||
struct ggc_cache_tab {
|
||||
struct htab * *base;
|
||||
size_t nelt;
|
||||
size_t stride;
|
||||
gt_pointer_walker cb;
|
||||
gt_pointer_walker pchw;
|
||||
int (*marked_p) (const void *);
|
||||
};
|
||||
#define LAST_GGC_CACHE_TAB { NULL, 0, 0, NULL, NULL, NULL }
|
||||
/* Pointers to arrays of ggc_cache_tab, terminated by NULL. */
|
||||
extern const struct ggc_cache_tab * const gt_ggc_cache_rtab[];
|
||||
|
||||
/* If EXPR is not NULL and previously unmarked, mark it and evaluate
|
||||
to true. Otherwise evaluate to false. */
|
||||
#define ggc_test_and_set_mark(EXPR) \
|
||||
((EXPR) != NULL && ((void *) (EXPR)) != (void *) 1 && ! ggc_set_mark (EXPR))
|
||||
|
||||
#define ggc_mark(EXPR) \
|
||||
do { \
|
||||
const void *const a__ = (EXPR); \
|
||||
if (a__ != NULL && a__ != (void *) 1) \
|
||||
ggc_set_mark (a__); \
|
||||
} while (0)
|
||||
|
||||
/* Actually set the mark on a particular region of memory, but don't
|
||||
follow pointers. This function is called by ggc_mark_*. It
|
||||
returns zero if the object was not previously marked; nonzero if
|
||||
the object was already marked, or if, for any other reason,
|
||||
pointers in this data structure should not be traversed. */
|
||||
extern int ggc_set_mark (const void *);
|
||||
|
||||
/* Return 1 if P has been marked, zero otherwise.
|
||||
P must have been allocated by the GC allocator; it mustn't point to
|
||||
static objects, stack variables, or memory allocated with malloc. */
|
||||
extern int ggc_marked_p (const void *);
|
||||
|
||||
/* PCH and GGC handling for strings, mostly trivial. */
|
||||
extern void gt_pch_n_S (const void *);
|
||||
extern void gt_ggc_m_S (const void *);
|
||||
|
||||
/* End of GTY machinery API. */
|
||||
|
||||
/* Initialize the string pool. */
|
||||
extern void init_stringpool (void);
|
||||
|
||||
/* Initialize the garbage collector. */
|
||||
extern void init_ggc (void);
|
||||
|
||||
/* When true, identifier nodes are considered as GC roots. When
|
||||
false, identifier nodes are treated like any other GC-allocated
|
||||
object, and the identifier hash table is treated as a weak
|
||||
hash. */
|
||||
extern bool ggc_protect_identifiers;
|
||||
|
||||
/* Write out all GCed objects to F. */
|
||||
extern void gt_pch_save (FILE *f);
|
||||
|
||||
|
||||
/* Allocation. */
|
||||
|
||||
/* The internal primitive. */
|
||||
extern void *ggc_internal_alloc_stat (size_t MEM_STAT_DECL)
|
||||
ATTRIBUTE_MALLOC;
|
||||
|
||||
extern size_t ggc_round_alloc_size (size_t requested_size);
|
||||
|
||||
#define ggc_internal_alloc(s) ggc_internal_alloc_stat (s MEM_STAT_INFO)
|
||||
|
||||
/* Allocates cleared memory. */
|
||||
extern void *ggc_internal_cleared_alloc_stat (size_t MEM_STAT_DECL)
|
||||
ATTRIBUTE_MALLOC;
|
||||
|
||||
/* Resize a block. */
|
||||
extern void *ggc_realloc_stat (void *, size_t MEM_STAT_DECL);
|
||||
|
||||
/* Free a block. To be used when known for certain it's not reachable. */
|
||||
extern void ggc_free (void *);
|
||||
|
||||
extern void dump_ggc_loc_statistics (bool);
|
||||
|
||||
/* Reallocators. */
|
||||
#define GGC_RESIZEVEC(T, P, N) \
|
||||
((T *) ggc_realloc_stat ((P), (N) * sizeof (T) MEM_STAT_INFO))
|
||||
|
||||
#define GGC_RESIZEVAR(T, P, N) \
|
||||
((T *) ggc_realloc_stat ((P), (N) MEM_STAT_INFO))
|
||||
|
||||
static inline void *
|
||||
ggc_internal_vec_alloc_stat (size_t s, size_t c MEM_STAT_DECL)
|
||||
{
|
||||
return ggc_internal_alloc_stat (c * s PASS_MEM_STAT);
|
||||
}
|
||||
|
||||
static inline void *
|
||||
ggc_internal_cleared_vec_alloc_stat (size_t s, size_t c MEM_STAT_DECL)
|
||||
{
|
||||
return ggc_internal_cleared_alloc_stat (c * s PASS_MEM_STAT);
|
||||
}
|
||||
|
||||
#define ggc_internal_cleared_vec_alloc(s, c) \
|
||||
(ggc_internal_cleared_vec_alloc_stat ((s), (c) MEM_STAT_INFO))
|
||||
|
||||
static inline void *
|
||||
ggc_alloc_atomic_stat (size_t s MEM_STAT_DECL)
|
||||
{
|
||||
return ggc_internal_alloc_stat (s PASS_MEM_STAT);
|
||||
}
|
||||
|
||||
#define ggc_alloc_atomic(S) (ggc_alloc_atomic_stat ((S) MEM_STAT_INFO))
|
||||
|
||||
#define ggc_alloc_cleared_atomic(S) \
|
||||
(ggc_internal_cleared_alloc_stat ((S) MEM_STAT_INFO))
|
||||
|
||||
extern void *ggc_cleared_alloc_htab_ignore_args (size_t, size_t)
|
||||
ATTRIBUTE_MALLOC;
|
||||
|
||||
extern void *ggc_cleared_alloc_ptr_array_two_args (size_t, size_t)
|
||||
ATTRIBUTE_MALLOC;
|
||||
|
||||
#define htab_create_ggc(SIZE, HASH, EQ, DEL) \
|
||||
htab_create_typed_alloc (SIZE, HASH, EQ, DEL, \
|
||||
ggc_cleared_alloc_htab_ignore_args, \
|
||||
ggc_cleared_alloc_ptr_array_two_args, \
|
||||
ggc_free)
|
||||
|
||||
#define splay_tree_new_ggc(COMPARE, ALLOC_TREE, ALLOC_NODE) \
|
||||
splay_tree_new_typed_alloc (COMPARE, NULL, NULL, &ALLOC_TREE, &ALLOC_NODE, \
|
||||
&ggc_splay_dont_free, NULL)
|
||||
|
||||
extern void *ggc_splay_alloc (int, void *)
|
||||
ATTRIBUTE_MALLOC;
|
||||
|
||||
extern void ggc_splay_dont_free (void *, void *);
|
||||
|
||||
/* Allocate a gc-able string, and fill it with LENGTH bytes from CONTENTS.
|
||||
If LENGTH is -1, then CONTENTS is assumed to be a
|
||||
null-terminated string and the memory sized accordingly. */
|
||||
extern const char *ggc_alloc_string_stat (const char *contents, int length
|
||||
MEM_STAT_DECL);
|
||||
|
||||
#define ggc_alloc_string(c, l) ggc_alloc_string_stat (c, l MEM_STAT_INFO)
|
||||
|
||||
/* Make a copy of S, in GC-able memory. */
|
||||
#define ggc_strdup(S) ggc_alloc_string_stat ((S), -1 MEM_STAT_INFO)
|
||||
|
||||
/* Invoke the collector. Garbage collection occurs only when this
|
||||
function is called, not during allocations. */
|
||||
extern void ggc_collect (void);
|
||||
|
||||
/* Register an additional root table. This can be useful for some
|
||||
plugins. Does nothing if the passed pointer is NULL. */
|
||||
extern void ggc_register_root_tab (const struct ggc_root_tab *);
|
||||
|
||||
/* Register an additional cache table. This can be useful for some
|
||||
plugins. Does nothing if the passed pointer is NULL. */
|
||||
extern void ggc_register_cache_tab (const struct ggc_cache_tab *);
|
||||
|
||||
/* Read objects previously saved with gt_pch_save from F. */
|
||||
extern void gt_pch_restore (FILE *f);
|
||||
|
||||
/* Statistics. */
|
||||
|
||||
/* Print allocation statistics. */
|
||||
extern void ggc_print_statistics (void);
|
||||
|
||||
extern void stringpool_statistics (void);
|
||||
|
||||
/* Heuristics. */
|
||||
extern void init_ggc_heuristics (void);
|
||||
|
||||
#define ggc_alloc_rtvec_sized(NELT) \
|
||||
ggc_alloc_rtvec_def (sizeof (struct rtvec_def) \
|
||||
+ ((NELT) - 1) * sizeof (rtx)) \
|
||||
|
||||
/* Memory statistics passing versions of some allocators. Too few of them to
|
||||
make gengtype produce them, so just define the needed ones here. */
|
||||
static inline struct rtx_def *
|
||||
ggc_alloc_rtx_def_stat (size_t s MEM_STAT_DECL)
|
||||
{
|
||||
return (struct rtx_def *) ggc_internal_alloc_stat (s PASS_MEM_STAT);
|
||||
}
|
||||
|
||||
static inline union tree_node *
|
||||
ggc_alloc_tree_node_stat (size_t s MEM_STAT_DECL)
|
||||
{
|
||||
return (union tree_node *) ggc_internal_alloc_stat (s PASS_MEM_STAT);
|
||||
}
|
||||
|
||||
static inline union tree_node *
|
||||
ggc_alloc_cleared_tree_node_stat (size_t s MEM_STAT_DECL)
|
||||
{
|
||||
return (union tree_node *) ggc_internal_cleared_alloc_stat (s PASS_MEM_STAT);
|
||||
}
|
||||
|
||||
static inline union gimple_statement_d *
|
||||
ggc_alloc_cleared_gimple_statement_d_stat (size_t s MEM_STAT_DECL)
|
||||
{
|
||||
return (union gimple_statement_d *)
|
||||
ggc_internal_cleared_alloc_stat (s PASS_MEM_STAT);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
/* Various declarations for pretty formatting of GIMPLE statements and
|
||||
expressions.
|
||||
Copyright (C) 2000-2013 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 3, or (at your option) any later
|
||||
version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING3. If not see
|
||||
<http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef GCC_GIMPLE_PRETTY_PRINT_H
|
||||
#define GCC_GIMPLE_PRETTY_PRINT_H
|
||||
|
||||
#include "pretty-print.h"
|
||||
#include "tree-pretty-print.h"
|
||||
|
||||
/* In gimple-pretty-print.c */
|
||||
extern void debug_gimple_stmt (gimple);
|
||||
extern void debug_gimple_seq (gimple_seq);
|
||||
extern void print_gimple_seq (FILE *, gimple_seq, int, int);
|
||||
extern void print_gimple_stmt (FILE *, gimple, int, int);
|
||||
extern void print_gimple_expr (FILE *, gimple, int, int);
|
||||
extern void pp_gimple_stmt_1 (pretty_printer *, gimple, int, int);
|
||||
extern void gimple_dump_bb_for_graph (pretty_printer *, basic_block);
|
||||
|
||||
#endif /* ! GCC_GIMPLE_PRETTY_PRINT_H */
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue