Merge branch 'autopar_rebase2' into autopar_devel

Quickly commit changes in the rebase branch.
This commit is contained in:
Giuliano Belinassi 2020-08-22 17:43:43 -03:00
commit a926878ddb
7956 changed files with 456788 additions and 304914 deletions

1
.gitignore vendored
View File

@ -36,6 +36,7 @@ TAGS.sub
.lvimrc
.clang-format
.clang-tidy
.clangd
compile_commands.json

View File

@ -1,3 +1,46 @@
2020-08-16 Sergei Trofimovich <slyfox@gcc.gnu.org>
* MAINTAINERS (Write After Approval): Add myself.
2020-08-12 Senthil Kumar Selvaraj <saaadhu@gcc.gnu.org>
* MAINTAINERS: Update my email address.
2020-07-30 Joe Ramsay <joe.ramsay@arm.com>
* MAINTAINERS (Write After Approval): Add myself.
2020-07-22 Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
* MAINTAINERS (Write After Approval): Add myself.
2020-06-12 Martin Liska <mliska@suse.cz>
* .gitignore: Add .clang-tidy.
2020-06-08 Jason Merrill <jason@redhat.com>
* configure.ac: Check AX_CXX_COMPILE_STDCXX if not bootstrapping.
* configure: Regenerate.
2020-06-06 Max Filippov <jcmvbkbc@gmail.com>
* MAINTAINERS: Add myself as xtensa port maintainer.
2020-05-28 Nicolas Bértolo <nicolasbertolo@gmail.com>
* configure.ac: Don't require --enable-host-shared when building
for Mingw.
* configure: Regenerate.
2020-05-18 Jason Merrill <jason@redhat.com>
* configure.ac: Update bootstrap dialect to -std=c++11.
2020-05-18 Alex Coplan <alex.coplan@arm.com>
* MAINTAINERS (Write After Approval): Add myself.
2020-04-29 Thomas Schwinge <thomas@codesourcery.com>
PR target/92713

View File

@ -118,6 +118,7 @@ visium port Eric Botcazou <ebotcazou@libertysurf.fr>
x86-64 port Jan Hubicka <hubicka@ucw.cz>
xstormy16 port Nick Clifton <nickc@redhat.com>
xtensa port Sterling Augustine <augustine.sterling@gmail.com>
xtensa port Max Filippov <jcmvbkbc@gmail.com>
OS Port Maintainers (OS alphabetical order)
@ -353,6 +354,7 @@ William Cohen <wcohen@redhat.com>
Michael Collison <michael.collison@arm.com>
Josh Conner <joshconner@google.com>
R. Kelley Cook <kcook@gcc.gnu.org>
Alex Coplan <alex.coplan@arm.com>
Andrea Corallo <andrea.corallo@arm.com>
Christian Cornelssen <ccorn@cs.tu-berlin.de>
Ludovic Courtès <ludo@gnu.org>
@ -382,7 +384,6 @@ Chris Fairles <cfairles@gcc.gnu.org>
Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
Changpeng Fang <changpeng.fang@amd.com>
Li Feng <nemokingdom@gmail.com>
Max Filippov <jcmvbkbc@gmail.com>
Thomas Fitzsimmons <fitzsim@redhat.com>
Alexander Fomin <afomin.mailbox@gmail.com>
Brian Ford <ford@vss.fsi.com>
@ -562,6 +563,7 @@ Vladimir Prus <vladimir@codesourcery.com>
Yao Qi <yao@codesourcery.com>
Jerry Quinn <jlquinn@optonline.net>
Easwaran Raman <eraman@google.com>
Joe Ramsay <joe.ramsay@arm.com>
Rolf Rasmussen <rolfwr@gcc.gnu.org>
Fritz Reese <fritzoreese@gmail.com>
Volker Reichelt <v.reichelt@netcologne.de>
@ -586,7 +588,7 @@ Stefan Schulze Frielinghaus <stefansf@linux.ibm.com>
Tilo Schwarz <tilo@tilo-schwarz.de>
Martin Sebor <msebor@gcc.gnu.org>
Svein Seldal <svein@dev.seldal.com>
Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
Senthil Kumar Selvaraj <saaadhu@gcc.gnu.org>
Thiemo Seufer <ths@networkno.de>
Bill Seurer <seurer@linux.vnet.ibm.com>
Tim Shen <timshen@google.com>
@ -620,6 +622,7 @@ Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Daniel Towner <dant@picochip.com>
Konrad Trifunovic <konrad.trifunovic@inria.fr>
Markus Trippelsdorf <markus@trippelsdorf.de>
Sergei Trofimovich <slyfox@gcc.gnu.org>
Igor Tsimbalist <igor.v.tsimbalist@intel.com>
Martin Uecker <uecker@eecs.berkeley.edu>
David Ung <davidu@mips.com>
@ -644,6 +647,7 @@ Mark Wielaard <mark@gcc.gnu.org>
Edmar Wienskoski <edmar@freescale.com>
Ollie Wild <aaw@google.com>
Kevin Williams <kevin.williams@inria.fr>
Przemyslaw Wirkus <przemyslaw.wirkus@arm.com>
Carlo Wood <carlo@alinoe.com>
Jackson Woodruff <jackson.woodruff@arm.com>
Mingjie Xing <mingjie.xing@gmail.com>

View File

@ -1,3 +1,36 @@
2020-07-30 H.J. Lu <hjl.tools@gmail.com>
PR bootstrap/96202
* cet.m4 (GCC_CET_HOST_FLAGS): Don't enable CET without CET
support in stage1 nor for build support.
2020-05-29 H.J. Lu <hjl.tools@gmail.com>
PR bootstrap/95413
* cet.m4: Replace save_CFLAGS and save_LDFLAGS with
cet_save_CFLAGS and cet_save_LDFLAGS.
2020-05-18 Jason Merrill <jason@redhat.com>
* ax_cxx_compile_stdcxx.m4: Import from autoconf archive with
an adjustment to try the default mode.
2020-05-15 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/95147
* cet.m4 (GCC_CET_FLAGS): Also check if -fcf-protection works
when defaulting to auto.
2020-05-14 H.J. Lu <hongjiu.lu@intel.com>
* cet.m4 (GCC_CET_FLAGS): Change default to auto.
2020-05-12 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/94998
* cet.m4 (GCC_CET_HOST_FLAGS): Enable CET in cross compiler if
possible.
2020-04-28 H.J. Lu <hongjiu.lu@intel.com>
PR bootstrap/94739

View File

@ -0,0 +1,962 @@
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
#
# DESCRIPTION
#
# Check for baseline language coverage in the compiler for the specified
# version of the C++ standard. If necessary, add switches to CXX and
# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard)
# or '14' (for the C++14 standard).
#
# The second argument, if specified, indicates whether you insist on an
# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
# -std=c++11). If neither is specified, you get whatever works, with
# preference for no added switch, and then for an extended mode.
#
# The third argument, if specified 'mandatory' or if left unspecified,
# indicates that baseline support for the specified C++ standard is
# required and that the macro should error out if no mode with that
# support is found. If specified 'optional', then configuration proceeds
# regardless, after defining HAVE_CXX${VERSION} if and only if a
# supporting mode is found.
#
# LICENSE
#
# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com>
# Copyright (c) 2012 Zack Weinberg <zackw@panix.com>
# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu>
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com>
# Copyright (c) 2015 Paul Norman <penorman@mac.com>
# Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu>
# Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com>
# Copyright (c) 2019 Enji Cooper <yaneurabeya@gmail.com>
# Copyright (c) 2020 Jason Merrill <jason@redhat.com>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 12
dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
dnl (serial version number 13).
AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"],
[$1], [14], [ax_cxx_compile_alternatives="14 1y"],
[$1], [17], [ax_cxx_compile_alternatives="17 1z"],
[m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
m4_if([$2], [], [],
[$2], [ext], [],
[$2], [noext], [],
[m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
[$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
[$3], [optional], [ax_cxx_compile_cxx$1_required=false],
[m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
AC_LANG_PUSH([C++])dnl
ac_success=no
m4_if([$2], [], [dnl
AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
ax_cv_cxx_compile_cxx$1,
[AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[ax_cv_cxx_compile_cxx$1=yes],
[ax_cv_cxx_compile_cxx$1=no])])
if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
ac_success=yes
fi])
m4_if([$2], [noext], [], [dnl
if test x$ac_success = xno; then
for alternative in ${ax_cxx_compile_alternatives}; do
switch="-std=gnu++${alternative}"
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
$cachevar,
[ac_save_CXX="$CXX"
CXX="$CXX $switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[eval $cachevar=yes],
[eval $cachevar=no])
CXX="$ac_save_CXX"])
if eval test x\$$cachevar = xyes; then
CXX="$CXX $switch"
if test -n "$CXXCPP" ; then
CXXCPP="$CXXCPP $switch"
fi
ac_success=yes
break
fi
done
fi])
m4_if([$2], [ext], [], [dnl
if test x$ac_success = xno; then
dnl HP's aCC needs +std=c++11 according to:
dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf
dnl Cray's crayCC needs "-h std=c++11"
for alternative in ${ax_cxx_compile_alternatives}; do
for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do
cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
$cachevar,
[ac_save_CXX="$CXX"
CXX="$CXX $switch"
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
[eval $cachevar=yes],
[eval $cachevar=no])
CXX="$ac_save_CXX"])
if eval test x\$$cachevar = xyes; then
CXX="$CXX $switch"
if test -n "$CXXCPP" ; then
CXXCPP="$CXXCPP $switch"
fi
ac_success=yes
break
fi
done
if test x$ac_success = xyes; then
break
fi
done
fi])
AC_LANG_POP([C++])
if test x$ax_cxx_compile_cxx$1_required = xtrue; then
if test x$ac_success = xno; then
AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.])
fi
fi
if test x$ac_success = xno; then
HAVE_CXX$1=0
AC_MSG_NOTICE([No compiler with C++$1 support was found])
else
HAVE_CXX$1=1
AC_DEFINE(HAVE_CXX$1,1,
[define if the compiler supports basic C++$1 syntax])
fi
AC_SUBST(HAVE_CXX$1)
])
dnl Test body for checking C++11 support
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11],
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
)
dnl Test body for checking C++14 support
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14],
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14
)
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17],
_AX_CXX_COMPILE_STDCXX_testbody_new_in_11
_AX_CXX_COMPILE_STDCXX_testbody_new_in_14
_AX_CXX_COMPILE_STDCXX_testbody_new_in_17
)
dnl Tests for new features in C++11
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[
// If the compiler admits that it is not ready for C++11, why torture it?
// Hopefully, this will speed up the test.
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201103L
#error "This is not a C++11 compiler"
#else
namespace cxx11
{
namespace test_static_assert
{
template <typename T>
struct check
{
static_assert(sizeof(int) <= sizeof(T), "not big enough");
};
}
namespace test_final_override
{
struct Base
{
virtual ~Base() {}
virtual void f() {}
};
struct Derived : public Base
{
virtual ~Derived() override {}
virtual void f() override {}
};
}
namespace test_double_right_angle_brackets
{
template < typename T >
struct check {};
typedef check<void> single_type;
typedef check<check<void>> double_type;
typedef check<check<check<void>>> triple_type;
typedef check<check<check<check<void>>>> quadruple_type;
}
namespace test_decltype
{
int
f()
{
int a = 1;
decltype(a) b = 2;
return a + b;
}
}
namespace test_type_deduction
{
template < typename T1, typename T2 >
struct is_same
{
static const bool value = false;
};
template < typename T >
struct is_same<T, T>
{
static const bool value = true;
};
template < typename T1, typename T2 >
auto
add(T1 a1, T2 a2) -> decltype(a1 + a2)
{
return a1 + a2;
}
int
test(const int c, volatile int v)
{
static_assert(is_same<int, decltype(0)>::value == true, "");
static_assert(is_same<int, decltype(c)>::value == false, "");
static_assert(is_same<int, decltype(v)>::value == false, "");
auto ac = c;
auto av = v;
auto sumi = ac + av + 'x';
auto sumf = ac + av + 1.0;
static_assert(is_same<int, decltype(ac)>::value == true, "");
static_assert(is_same<int, decltype(av)>::value == true, "");
static_assert(is_same<int, decltype(sumi)>::value == true, "");
static_assert(is_same<int, decltype(sumf)>::value == false, "");
static_assert(is_same<int, decltype(add(c, v))>::value == true, "");
return (sumf > 0.0) ? sumi : add(c, v);
}
}
namespace test_noexcept
{
int f() { return 0; }
int g() noexcept { return 0; }
static_assert(noexcept(f()) == false, "");
static_assert(noexcept(g()) == true, "");
}
namespace test_constexpr
{
template < typename CharT >
unsigned long constexpr
strlen_c_r(const CharT *const s, const unsigned long acc) noexcept
{
return *s ? strlen_c_r(s + 1, acc + 1) : acc;
}
template < typename CharT >
unsigned long constexpr
strlen_c(const CharT *const s) noexcept
{
return strlen_c_r(s, 0UL);
}
static_assert(strlen_c("") == 0UL, "");
static_assert(strlen_c("1") == 1UL, "");
static_assert(strlen_c("example") == 7UL, "");
static_assert(strlen_c("another\0example") == 7UL, "");
}
namespace test_rvalue_references
{
template < int N >
struct answer
{
static constexpr int value = N;
};
answer<1> f(int&) { return answer<1>(); }
answer<2> f(const int&) { return answer<2>(); }
answer<3> f(int&&) { return answer<3>(); }
void
test()
{
int i = 0;
const int c = 0;
static_assert(decltype(f(i))::value == 1, "");
static_assert(decltype(f(c))::value == 2, "");
static_assert(decltype(f(0))::value == 3, "");
}
}
namespace test_uniform_initialization
{
struct test
{
static const int zero {};
static const int one {1};
};
static_assert(test::zero == 0, "");
static_assert(test::one == 1, "");
}
namespace test_lambdas
{
void
test1()
{
auto lambda1 = [](){};
auto lambda2 = lambda1;
lambda1();
lambda2();
}
int
test2()
{
auto a = [](int i, int j){ return i + j; }(1, 2);
auto b = []() -> int { return '0'; }();
auto c = [=](){ return a + b; }();
auto d = [&](){ return c; }();
auto e = [a, &b](int x) mutable {
const auto identity = [](int y){ return y; };
for (auto i = 0; i < a; ++i)
a += b--;
return x + identity(a + b);
}(0);
return a + b + c + d + e;
}
int
test3()
{
const auto nullary = [](){ return 0; };
const auto unary = [](int x){ return x; };
using nullary_t = decltype(nullary);
using unary_t = decltype(unary);
const auto higher1st = [](nullary_t f){ return f(); };
const auto higher2nd = [unary](nullary_t f1){
return [unary, f1](unary_t f2){ return f2(unary(f1())); };
};
return higher1st(nullary) + higher2nd(nullary)(unary);
}
}
namespace test_variadic_templates
{
template <int...>
struct sum;
template <int N0, int... N1toN>
struct sum<N0, N1toN...>
{
static constexpr auto value = N0 + sum<N1toN...>::value;
};
template <>
struct sum<>
{
static constexpr auto value = 0;
};
static_assert(sum<>::value == 0, "");
static_assert(sum<1>::value == 1, "");
static_assert(sum<23>::value == 23, "");
static_assert(sum<1, 2>::value == 3, "");
static_assert(sum<5, 5, 11>::value == 21, "");
static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, "");
}
// http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
// Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function
// because of this.
namespace test_template_alias_sfinae
{
struct foo {};
template<typename T>
using member = typename T::member_type;
template<typename T>
void func(...) {}
template<typename T>
void func(member<T>*) {}
void test();
void test() { func<foo>(0); }
}
} // namespace cxx11
#endif // __cplusplus >= 201103L
]])
dnl Tests for new features in C++14
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[
// If the compiler admits that it is not ready for C++14, why torture it?
// Hopefully, this will speed up the test.
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201402L
#error "This is not a C++14 compiler"
#else
namespace cxx14
{
namespace test_polymorphic_lambdas
{
int
test()
{
const auto lambda = [](auto&&... args){
const auto istiny = [](auto x){
return (sizeof(x) == 1UL) ? 1 : 0;
};
const int aretiny[] = { istiny(args)... };
return aretiny[0];
};
return lambda(1, 1L, 1.0f, '1');
}
}
namespace test_binary_literals
{
constexpr auto ivii = 0b0000000000101010;
static_assert(ivii == 42, "wrong value");
}
namespace test_generalized_constexpr
{
template < typename CharT >
constexpr unsigned long
strlen_c(const CharT *const s) noexcept
{
auto length = 0UL;
for (auto p = s; *p; ++p)
++length;
return length;
}
static_assert(strlen_c("") == 0UL, "");
static_assert(strlen_c("x") == 1UL, "");
static_assert(strlen_c("test") == 4UL, "");
static_assert(strlen_c("another\0test") == 7UL, "");
}
namespace test_lambda_init_capture
{
int
test()
{
auto x = 0;
const auto lambda1 = [a = x](int b){ return a + b; };
const auto lambda2 = [a = lambda1(x)](){ return a; };
return lambda2();
}
}
namespace test_digit_separators
{
constexpr auto ten_million = 100'000'000;
static_assert(ten_million == 100000000, "");
}
namespace test_return_type_deduction
{
auto f(int& x) { return x; }
decltype(auto) g(int& x) { return x; }
template < typename T1, typename T2 >
struct is_same
{
static constexpr auto value = false;
};
template < typename T >
struct is_same<T, T>
{
static constexpr auto value = true;
};
int
test()
{
auto x = 0;
static_assert(is_same<int, decltype(f(x))>::value, "");
static_assert(is_same<int&, decltype(g(x))>::value, "");
return x;
}
}
} // namespace cxx14
#endif // __cplusplus >= 201402L
]])
dnl Tests for new features in C++17
m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[
// If the compiler admits that it is not ready for C++17, why torture it?
// Hopefully, this will speed up the test.
#ifndef __cplusplus
#error "This is not a C++ compiler"
#elif __cplusplus < 201703L
#error "This is not a C++17 compiler"
#else
#include <initializer_list>
#include <utility>
#include <type_traits>
namespace cxx17
{
namespace test_constexpr_lambdas
{
constexpr int foo = [](){return 42;}();
}
namespace test::nested_namespace::definitions
{
}
namespace test_fold_expression
{
template<typename... Args>
int multiply(Args... args)
{
return (args * ... * 1);
}
template<typename... Args>
bool all(Args... args)
{
return (args && ...);
}
}
namespace test_extended_static_assert
{
static_assert (true);
}
namespace test_auto_brace_init_list
{
auto foo = {5};
auto bar {5};
static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value);
static_assert(std::is_same<int, decltype(bar)>::value);
}
namespace test_typename_in_template_template_parameter
{
template<template<typename> typename X> struct D;
}
namespace test_fallthrough_nodiscard_maybe_unused_attributes
{
int f1()
{
return 42;
}
[[nodiscard]] int f2()
{
[[maybe_unused]] auto unused = f1();
switch (f1())
{
case 17:
f1();
[[fallthrough]];
case 42:
f1();
}
return f1();
}
}
namespace test_extended_aggregate_initialization
{
struct base1
{
int b1, b2 = 42;
};
struct base2
{
base2() {
b3 = 42;
}
int b3;
};
struct derived : base1, base2
{
int d;
};
derived d1 {{1, 2}, {}, 4}; // full initialization
derived d2 {{}, {}, 4}; // value-initialized bases
}
namespace test_general_range_based_for_loop
{
struct iter
{
int i;
int& operator* ()
{
return i;
}
const int& operator* () const
{
return i;
}
iter& operator++()
{
++i;
return *this;
}
};
struct sentinel
{
int i;
};
bool operator== (const iter& i, const sentinel& s)
{
return i.i == s.i;
}
bool operator!= (const iter& i, const sentinel& s)
{
return !(i == s);
}
struct range
{
iter begin() const
{
return {0};
}
sentinel end() const
{
return {5};
}
};
void f()
{
range r {};
for (auto i : r)
{
[[maybe_unused]] auto v = i;
}
}
}
namespace test_lambda_capture_asterisk_this_by_value
{
struct t
{
int i;
int foo()
{
return [*this]()
{
return i;
}();
}
};
}
namespace test_enum_class_construction
{
enum class byte : unsigned char
{};
byte foo {42};
}
namespace test_constexpr_if
{
template <bool cond>
int f ()
{
if constexpr(cond)
{
return 13;
}
else
{
return 42;
}
}
}
namespace test_selection_statement_with_initializer
{
int f()
{
return 13;
}
int f2()
{
if (auto i = f(); i > 0)
{
return 3;
}
switch (auto i = f(); i + 4)
{
case 17:
return 2;
default:
return 1;
}
}
}
namespace test_template_argument_deduction_for_class_templates
{
template <typename T1, typename T2>
struct pair
{
pair (T1 p1, T2 p2)
: m1 {p1},
m2 {p2}
{}
T1 m1;
T2 m2;
};
void f()
{
[[maybe_unused]] auto p = pair{13, 42u};
}
}
namespace test_non_type_auto_template_parameters
{
template <auto n>
struct B
{};
B<5> b1;
B<'a'> b2;
}
namespace test_structured_bindings
{
int arr[2] = { 1, 2 };
std::pair<int, int> pr = { 1, 2 };
auto f1() -> int(&)[2]
{
return arr;
}
auto f2() -> std::pair<int, int>&
{
return pr;
}
struct S
{
int x1 : 2;
volatile double y1;
};
S f3()
{
return {};
}
auto [ x1, y1 ] = f1();
auto& [ xr1, yr1 ] = f1();
auto [ x2, y2 ] = f2();
auto& [ xr2, yr2 ] = f2();
const auto [ x3, y3 ] = f3();
}
namespace test_exception_spec_type_system
{
struct Good {};
struct Bad {};
void g1() noexcept;
void g2();
template<typename T>
Bad
f(T*, T*);
template<typename T1, typename T2>
Good
f(T1*, T2*);
static_assert (std::is_same_v<Good, decltype(f(g1, g2))>);
}
namespace test_inline_variables
{
template<class T> void f(T)
{}
template<class T> inline T g(T)
{
return T{};
}
template<> inline void f<>(int)
{}
template<> int g<>(int)
{
return 5;
}
}
} // namespace cxx17
#endif // __cplusplus < 201703L
]])

View File

@ -3,16 +3,19 @@ dnl GCC_CET_FLAGS
dnl (SHELL-CODE_HANDLER)
dnl
AC_DEFUN([GCC_CET_FLAGS],[dnl
GCC_ENABLE(cet, no, ,[enable Intel CET in target libraries],
GCC_ENABLE(cet, auto, ,[enable Intel CET in target libraries],
permit yes|no|auto)
AC_MSG_CHECKING([for CET support])
# NB: Avoid nested save_CFLAGS and save_LDFLAGS.
case "$host" in
i[[34567]]86-*-linux* | x86_64-*-linux*)
case "$enable_cet" in
auto)
# Check if target supports multi-byte NOPs
# and if assembler supports CET insn.
# and if compiler and assembler support CET insn.
cet_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fcf-protection"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[],
@ -25,6 +28,7 @@ asm ("setssbsy");
])],
[enable_cet=yes],
[enable_cet=no])
CFLAGS="$cet_save_CFLAGS"
;;
yes)
# Check if assembler supports CET.
@ -61,12 +65,12 @@ AC_MSG_CHECKING([for CET support])
case "$host" in
i[[34567]]86-*-linux* | x86_64-*-linux*)
may_have_cet=yes
save_CFLAGS="$CFLAGS"
cet_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fcf-protection"
case "$enable_cet" in
auto)
# Check if target supports multi-byte NOPs
# and if assembler supports CET insn.
# and if compiler and assembler support CET.
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[],
@ -81,16 +85,29 @@ asm ("setssbsy");
[enable_cet=no])
;;
yes)
# Check if assembler supports CET.
# Check if compiler and assembler support CET.
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[],
[asm ("setssbsy");])],
[],
[AC_MSG_ERROR([assembler with CET support is required for --enable-cet])])
[support_cet=yes],
[support_cet=no])
if test $support_cet = "no"; then
if test x$enable_bootstrap != xno \
&& test -z "${with_build_subdir}" \
&& (test ! -f ../stage_current \
|| test `cat ../stage_current` != "stage1"); then
# Require CET support only for the final GCC build.
AC_MSG_ERROR([compiler and assembler with CET support are required for --enable-cet])
else
# Don't enable CET without CET support for non-bootstrap
# build, in stage1 nor for build support.
enable_cet=no
fi
fi
;;
esac
CFLAGS="$save_CFLAGS"
CFLAGS="$cet_save_CFLAGS"
;;
*)
may_have_cet=no
@ -98,9 +115,9 @@ asm ("setssbsy");
;;
esac
save_CFLAGS="$CFLAGS"
cet_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fcf-protection=none"
save_LDFLAGS="$LDFLAGS"
cet_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,-z,ibt,-z,shstk"
if test x$may_have_cet = xyes; then
# Check whether -fcf-protection=none -Wl,-z,ibt,-z,shstk work.
@ -111,7 +128,8 @@ if test x$may_have_cet = xyes; then
fi
if test x$may_have_cet = xyes; then
AC_TRY_RUN([
if test x$cross_compiling = xno; then
AC_TRY_RUN([
static void
foo (void)
{
@ -137,12 +155,17 @@ main ()
bar ();
return 0;
}
],
[have_cet=no],
[have_cet=yes])
if test x$enable_cet = xno -a x$have_cet = xyes; then
AC_MSG_ERROR([Intel CET must be enabled on Intel CET enabled host])
],
[have_cet=no],
[have_cet=yes])
if test x$enable_cet = xno -a x$have_cet = xyes; then
AC_MSG_ERROR([Intel CET must be enabled on Intel CET enabled host])
fi
fi
else
# Enable CET in cross compiler if possible so that it will run on both
# CET and non-CET hosts.
have_cet=yes
fi
if test x$enable_cet = xyes; then
$1="-fcf-protection"
@ -150,6 +173,6 @@ if test x$enable_cet = xyes; then
else
AC_MSG_RESULT([no])
fi
CFLAGS="$save_CFLAGS"
LDFLAGS="$save_LDFLAGS"
CFLAGS="$cet_save_CFLAGS"
LDFLAGS="$cet_save_LDFLAGS"
])

1033
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,7 @@ m4_include(config/acx.m4)
m4_include(config/override.m4)
m4_include(config/proginstall.m4)
m4_include(config/elf.m4)
m4_include(config/ax_cxx_compile_stdcxx.m4)
m4_include([libtool.m4])
m4_include([ltoptions.m4])
m4_include([ltsugar.m4])
@ -1462,10 +1463,13 @@ case "$have_compiler:$host:$target:$enable_bootstrap" in
;;
esac
# When bootstrapping with GCC, build stage 1 in C++98 mode to ensure that a
# C++98 compiler can still start the bootstrap.
# When bootstrapping with GCC, build stage 1 in C++11 mode to ensure that a
# C++11 compiler can still start the bootstrap. Otherwise, if building GCC,
# require C++11 (or higher).
if test "$enable_bootstrap:$GXX" = "yes:yes"; then
CXX="$CXX -std=gnu++98"
CXX="$CXX -std=c++11"
elif test "$have_compiler" = yes; then
AX_CXX_COMPILE_STDCXX(11)
fi
# Used for setting $lt_cv_objdir
@ -2079,9 +2083,14 @@ if test -d ${srcdir}/gcc; then
esac
# Disable jit if -enable-host-shared not specified
case ${add_this_lang}:${language}:${host_shared} in
yes:jit:no)
# PR jit/64780: explicitly specify --enable-host-shared
# but not if building for Mingw. All code in Windows
# is position independent code (PIC).
case $target in
*mingw*) ;;
*)
case ${add_this_lang}:${language}:${host_shared} in
yes:jit:no)
# PR jit/64780: explicitly specify --enable-host-shared
AC_MSG_ERROR([
Enabling language "jit" requires --enable-host-shared.
@ -2092,16 +2101,18 @@ If you want to build both the jit and the regular compiler, it is often
best to do this via two separate configure/builds, in separate
directories, to avoid imposing the performance cost of
--enable-host-shared on the regular compiler.])
;;
all:jit:no)
AC_MSG_WARN([--enable-host-shared required to build $language])
add_this_lang=unsupported
;;
*:jit:no)
# Silently disable.
add_this_lang=unsupported
;;
esac
;;
all:jit:no)
AC_MSG_WARN([--enable-host-shared required to build $language])
add_this_lang=unsupported
;;
*:jit:no)
# Silently disable.
add_this_lang=unsupported
;;
esac
;;
esac
# Disable a language that is unsupported by the target.
case "${add_this_lang}: $unsupported_languages " in

View File

@ -1,3 +1,423 @@
2020-07-29 Martin Liska <mliska@suse.cz>
* git-backport.py: fix how are ChangeLog paths combined.
2020-07-23 Patrick Palka <ppalka@redhat.com>
* vimrc (SetStyle): Also inspect &filetype to determine whether
a file is C-like.
2020-07-23 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: When reverting a backport,
we should print only Revert header.
2020-07-17 Jonathan Wakely <jwakely@redhat.com>
* gcc-changelog/git_update_version.py: Fix typo.
2020-07-10 Mike Nolta <mike@nolta.net>
* download_prerequisites: Don't pass wget options to curl.
2020-07-07 Alexandre Oliva <oliva@adacore.com>
Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Support CASE and COND.
* gcc-changelog/test_patches.txt: Add test.
* gcc-changelog/test_email.py: Add test.
2020-06-30 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_repository.py: Support older releases of
GitPython when renamed_file was named renamed.
2020-06-30 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_check_commit.py: Print revision
of original_info.
* gcc-changelog/git_commit.py: Support Revert commits.
2020-06-30 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_check_commit.py: Use GitInfo
* gcc-changelog/git_commit.py: Add GitInfo class.
* gcc-changelog/git_email.py: Use GitInfo class.
* gcc-changelog/git_repository.py: Likewise.
2020-06-24 Ilya Leoshkevich <iii@linux.ibm.com>
* download_prerequisites: Support AIX and OpenBSD unames.
Pipe `{gzip,bzip2} -d` to `tar -xf -`.
2020-06-18 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_update_version.py: First checkout and then
run git pull ---rebase.
2020-06-18 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_update_version.py: Support merge commits
and walk only on the branch that is being merged and generate
missing ChangeLog entries.
2020-06-18 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Fix Backported from timestamp when
use_commit_ts=True is used.
2020-06-17 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Print 'Backported from master'
heading to backported commits.
* gcc-changelog/test_email.py: Test it.
* gcc-changelog/test_patches.txt: Add new patch.
* gcc-changelog/git_repository.py: Add commit_to_date hook.
* gcc-changelog/git_email.py: Add fuzzy implementation
of commit_to_date_hook.
2020-06-11 Jonathan Wakely <jwakely@redhat.com>
* prepare-commit-msg: Use the gcc-config.mklog-hook-type Git
config key instead of the GCC_FORCE_MKLOG environment variable.
Optionally disable generating a new ChangeLog template for
amended commits when the existing log is still OK.
2020-06-11 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_update_version.py: Add --curent argument.
2020-06-11 Martin Liska <mliska@suse.cz>
* prepare-commit-msg: Replace ENV variable with a git config
value.
2020-06-11 Jonathan Wakely <jwakely@redhat.com>
* prepare-commit-msg: Use 'tee' to save the diff to a file
instead of running 'git diff' twice.
2020-06-10 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Fix renamed files in
parse_git_name_status.
* gcc-changelog/test_email.py: Add test for it.
2020-06-10 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Add more supported prefixes.
* gcc-changelog/test_email.py: Fix one flake8 error.
* gcc-changelog/test_patches.txt: Add tested for newly
supported prefixes.
2020-06-10 Jonathan Wakely <jwakely@redhat.com>
* gcc-changelog/git_commit.py (GitCommit.parse_changelog):
Improve error strings.
* gcc-changelog/test_email.py: Update expected errors.
2020-06-09 Jonathan Wakely <jwakely@redhat.com>
* gcc-changelog/git_email.py: Set exit status on error.
2020-06-09 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Fix ChangeLog regex in order to
match the top-level ChangeLog.
* gcc-changelog/test_email.py: Add test.
* gcc-changelog/test_patches.txt: Likewise.
2020-06-02 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Support foo/bar/*: patterns in
wildcard_prefixes locations.
* gcc-changelog/test_email.py: Test it.
* gcc-changelog/test_patches.txt: Add 3 new patches.
2020-06-02 Iain Buclaw <ibuclaw@gdcproject.org>
* gcc-changelog/git_commit.py (ignored_prefixes): Add
gcc/testsuite/gdc.test/.
2020-06-02 Jonathan Wakely <jwakely@redhat.com>
* gcc-changelog/test_email.py (TestGccChangelog.test_long_lines):
Update expected error message.
2020-06-02 Jonathan Wakely <jwakely@redhat.com>
* gcc-changelog/git_commit.py (GitCommit.parse_changelog): Fix
grammar.
2020-06-02 Jonathan Wakely <jwakely@redhat.com>
* prepare-commit-msg: Do nothing if the mklog.py script isn't
present.
2020-06-02 Jonathan Wakely <jwakely@redhat.com>
* gcc-changelog/git_commit.py (GitCommit.check_mentioned_files):
Improve error text.
2020-05-31 Iain Buclaw <ibuclaw@gdcproject.org>
* config-list.mk (LIST): Add v850e1-elf.
2020-05-31 Iain Buclaw <ibuclaw@gdcproject.org>
* config-list.mk (LIST): Add or1k-elf, or1k-linux-*, and or1k-rtems.
2020-05-31 Iain Buclaw <ibuclaw@gdcproject.org>
* config-list.mk (LIST): Remove arm-wrs-vxworks.
2020-05-31 Iain Buclaw <ibuclaw@gdcproject.org>
* config-list.mk (LIST): Remove cris-linux, crisv32-elf, and
crisv32-linux.
2020-05-31 Iain Buclaw <ibuclaw@gdcproject.org>
* config-list.mk (LIST): Add pru-elf.
2020-05-29 Iain Buclaw <ibuclaw@gdcproject.org>
* config-list.mk (LIST): Remove rs6000-ibm-aix5.3.0.
2020-05-29 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Find empty change descriptions.
* gcc-changelog/test_email.py: New test.
* gcc-changelog/test_patches.txt: New patch that tests that.
2020-05-29 Martin Liska <mliska@suse.cz>
* git-backport.py: The script did 'git co HEAD~' when
there was no modified ChangeLog file in a successful
git cherry pick.
Run cherry-pick --continue without editor.
2020-05-29 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Properly
handle duplicite authors.
* gcc-changelog/test_email.py: New test.
* gcc-changelog/test_patches.txt: New patch.
2020-05-28 Pierre-Marie de Rodat <derodat@adacore.com>
* gcc-changelog/git_email.py (GitEmail.__init__): Interpret file
renamings as a file deletion plus a file addition.
* gcc-changelog/git_repository.py (parse_git_revisions):
Likewise.
* gcc-changelog/test_email.py: New testcase.
* gcc-changelog/test_patches.txt: New testcase.
2020-05-28 Martin Liska <mliska@suse.cz>
* check-params-in-docs.py: Update to new format
of help. Apply flake8 corrections.
2020-05-28 Martin Liska <mliska@suse.cz>
* mklog.py: Support renaming of files.
One needs unidiff 0.6.0+.
* test_mklog.py: Test it.
2020-05-27 Martin Liska <mliska@suse.cz>
* gcc-git-customization.sh: Use git-backport.py to drop
all changes for ChangeLog files.
* git-backport.py: New file.
2020-05-27 Martin Liska <mliska@suse.cz>
* gcc-git-customization.sh: Rename
commit-mklog to gcc-commit-mklog.
2020-05-27 Martin Liska <mliska@suse.cz>
* prepare-commit-msg: Save diff to a file if
the GCC_GIT_DIFF_FILE variable is set.
2020-05-26 Pierre-Marie de Rodat <derodat@adacore.com>
* gcc-changelog/git_commit.py (ChangeLogEntry): Handle entries
with multi-line file lists.
* gcc-changelog/test_email.py: New testcase.
* gcc-changelog/test_patches.txt: Likewise.
2020-05-26 Pierre-Marie de Rodat <derodat@adacore.com>
* gcc-changelog/git_update_version.py: Close file objects after
use.
* gcc-changelog/git_email.py: Likewise.
* gcc-changelog/test_email.py: Likewise.
2020-05-26 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_update_version.py: Add 2 new options.
2020-05-26 Alexandre Oliva <oliva@gnu.org>
* gcc-changelog/git_commit.py (changelog_regex): Accept optional
'for' prefix.
2020-05-26 Alexandre Oliva <oliva@adacore.com>
* compare-debug: Adjust for .gkd files named as dump files,
with the source suffix rather than the object suffix.
2020-05-26 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Parse changelog entries for
ignored locations.
* gcc-changelog/test_email.py: Add new test for it.
* gcc-changelog/test_patches.txt: Likewise.
2020-05-26 Jason Merrill <jason@redhat.com>
* prepare-commit-msg: New file.
* gcc-git-customization.sh: Install it. Add commit-mklog alias.
* mklog.py: Add new option -c which appends
to a ChangeLog file.
2020-05-25 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Add trailing '/'
for libdruntime. Allow empty changelog for
only ignored files.
* gcc-changelog/test_email.py: New test for go
patch in ignored location.
* gcc-changelog/test_patches.txt: Add test.
2020-05-22 Jakub Jelinek <jakub@redhat.com>
* gcc-changelog/git_commit.py: Add trailing / to
gcc/testsuite/go.test/test and replace gcc/go/frontend/
with gcc/go/gofrontend/ in ignored locations.
2020-05-22 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Add gcc/testsuite/go.test/test
to ignored locations.
2020-05-21 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_update_version.py: Prepare the script, the
only missing piece is pushing of the updated branches.
2020-05-21 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Support DR entries/
* gcc-changelog/test_email.py: New test for it.
* gcc-changelog/test_patches.txt: New patch for it.
2020-05-21 Martin Liska <mliska@suse.cz>
* mklog.py: Support DR parsing.
* test_mklog.py: New test for DR parsing.
2020-05-20 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Add author_tuple
only if not present in author_lines.
* gcc-changelog/test_email.py: New test.
* gcc-changelog/test_patches.txt: Add new patch.
2020-05-20 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Refactor to make flake8 happy.
* gcc-changelog/test_email.py: Add new test.
* gcc-changelog/test_patches.txt: Add new patch.
2020-05-20 Frederik Harwath <frederik@codesourcery.com>
* gcc-changelog/git_commit.py: Skip over lines starting
with "Reviewed-by: ", "Reviewed-on: ", or "Signed-off-by: "
2020-05-20 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_check_commit.py: Change
--allow-non-strict-mode to --non-strict-mode.
2020-05-20 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Support cherry pick
prefix.
* gcc-changelog/test_email.py: Test it.
* gcc-changelog/test_patches.txt: Add new patch.
* gcc-git-customization.sh: Add gcc-backport.
2020-05-19 Martin Liska <mliska@suse.cz>
* mklog.py: Use REST API for bug title downloading.
2020-05-19 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Add param use_commit_ts
for to_changelog_entries.
* gcc-changelog/git_update_version.py: Se use_commit_ts to True.
2020-05-19 Martin Liska <mliska@suse.cz>
* mklog.py: Skip GTY for struct names. Make flake8 happy.
* test_mklog.py: Add test for GTY.
2020-05-19 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_update_version.py:
Fill up entries in reverse order.
2020-05-19 Martin Liska <mliska@suse.cz>
* gcc-git-customization.sh: Add
alias.gcc-mklog new hook.
* mklog.py: New file.
* test_mklog.py: New file.
2020-05-19 Martin Liska <mliska@suse.cz>
* legacy/mklog: Moved from mklog.
* legacy/mklog.pl: Moved from mklog.pl.
2020-05-19 Martin Liska <mliska@suse.cz>
* gcc-git-customization.sh: Add gcc-verify alias
that uses contrib/gcc-changelog/git_check_commit.py.
2020-05-15 Andrew Burgess <andrew.burgess@embecosm.com>
* dg-extract-results.py: Handle GDB specific test types.
* dg-extract-results.sh: Likewise.
2020-05-14 Martin Liska <mliska@suse.cz>
* gcc-changelog/test_email.py: New file.
* gcc-changelog/test_patches.txt: New file.
2020-05-13 Patrick Palka <ppalka@redhat.com>
* vimrc: Reduce textwidth to 72 for Git commit messages.
2020-05-13 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_check_commit.py: Add default argument HEAD
for revisions and improve error message output.
2020-05-13 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_commit.py: Restore print_output syntax
in git_commit.py.
2020-05-13 Martin Liska <mliska@suse.cz>
* gcc-changelog/git_check_commit.py: New file.
* gcc-changelog/git_commit.py: New file.
* gcc-changelog/git_email.py: New file.
* gcc-changelog/git_repository.py: New file.
* gcc-changelog/git_update_version.py: New file.
2020-04-17 Martin Liska <mliska@suse.cz>
* vimrc: We do not want to modify tab options

View File

@ -22,16 +22,19 @@
#
#
import sys
import json
import argparse
from itertools import dropwhile, takewhile
from itertools import *
def get_param_tuple(line):
line = line.strip()
line = line.strip().replace('--param=', '')
i = line.find(' ')
return (line[:i], line[i:].strip())
name = line[:i]
if '=' in name:
name = name[:name.find('=')]
description = line[i:].strip()
return (name, description)
parser = argparse.ArgumentParser()
parser.add_argument('texi_file')
@ -49,8 +52,8 @@ for line in open(args.params_output).readlines():
# Find section in .texi manual with parameters
texi = ([x.strip() for x in open(args.texi_file).readlines()])
texi = dropwhile(lambda x: not 'item --param' in x, texi)
texi = takewhile(lambda x: not '@node Instrumentation Options' in x, texi)
texi = dropwhile(lambda x: 'item --param' not in x, texi)
texi = takewhile(lambda x: '@node Instrumentation Options' not in x, texi)
texi = list(texi)[1:]
token = '@item '

View File

@ -2,7 +2,7 @@
# Compare stripped copies of two given object files.
# Copyright (C) 2007, 2008, 2009, 2010, 2012 Free Software Foundation
# Copyright (C) 2007, 2008, 2009, 2010, 2012, 2020 Free Software Foundation
# Originally by Alexandre Oliva <aoliva@redhat.com>
# This file is part of GCC.
@ -183,8 +183,28 @@ $rm "$1.$suf1" "$2.$suf2"
trap "exit $status; exit" 0 1 2 15
if test -f "$1".gkd || test -f "$2".gkd; then
if cmp "$1".gkd "$2".gkd; then
# Replace the suffix in $1 and $2 with .*.gkd, compare them if a
# single file is found by the globbing.
base1=`echo "$1" | sed '$s,\.[^.]*$,,'` gkd1=
for f in "$base1".*.gkd; do
if test "x$gkd1" != x; then
gkd1=
break
elif test -f "$f"; then
gkd1=$f
fi
done
base2=`echo "$2" | sed '$s,\.[^.]*$,,'` gkd2=
for f in "$base2".*.gkd; do
if test "x$gkd2" != x; then
gkd2=
break
elif test -f "$f"; then
gkd2=$f
fi
done
if test "x$gkd1" != x || test "x$gkd2" != x; then
if cmp "${gkd1-/dev/null}" "${gkd2-/dev/null}"; then
:
else
status=$?

View File

@ -29,19 +29,18 @@ GCC_SRC_DIR=../../gcc
# > make.out 2>&1 &
#
# v850e1-elf is rejected by config.sub
LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
alpha-linux-gnu alpha-netbsd alpha-openbsd \
alpha64-dec-vms alpha-dec-vms \
amdgcn-amdhsa \
arc-elf32OPT-with-cpu=arc600 arc-elf32OPT-with-cpu=arc700 \
arc-linux-uclibcOPT-with-cpu=arc700 arceb-linux-uclibcOPT-with-cpu=arc700 \
arm-wrs-vxworks arm-netbsdelf \
arm-netbsdelf \
arm-linux-androideabi arm-uclinux_eabi arm-eabi arm-rtems \
arm-symbianelf avr-elf \
bfin-elf bfin-uclinux bfin-linux-uclibc bfin-rtems bfin-openbsd \
bpf-unknown-none \
c6x-elf c6x-uclinux cr16-elf cris-elf cris-linux crisv32-elf crisv32-linux \
c6x-elf c6x-uclinux cr16-elf cris-elf \
csky-elf csky-linux-gnu \
epiphany-elf epiphany-elfOPT-with-stack-offset=16 fido-elf \
fr30-elf frv-elf frv-linux ft32-elf h8300-elf hppa-linux-gnu \
@ -72,6 +71,7 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
nds32le-elf nds32be-elf \
nios2-elf nios2-linux-gnu nios2-rtems \
nvptx-none \
or1k-elf or1k-linux-uclibc or1k-linux-musl or1k-rtems \
pdp11-aout \
powerpc-darwin8 \
powerpc-darwin7 powerpc64-darwin powerpc-freebsd6 powerpc-netbsd \
@ -82,8 +82,9 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
powerpc-wrs-vxworks powerpc-wrs-vxworksae powerpc-wrs-vxworksmils \
powerpc-lynxos powerpcle-elf \
powerpcle-eabisim powerpcle-eabi \
pru-elf \
riscv32-unknown-linux-gnu riscv64-unknown-linux-gnu \
rs6000-ibm-aix5.3.0 rs6000-ibm-aix6.1 rs6000-ibm-aix7.1 \
rs6000-ibm-aix6.1 rs6000-ibm-aix7.1 \
rl78-elf rx-elf s390-linux-gnu s390x-linux-gnu s390x-ibm-tpf sh-elf \
shle-linux sh-netbsdelf sh-superh-elf \
sh-rtems sh-wrs-vxworks sparc-elf \
@ -93,7 +94,7 @@ LIST = aarch64-elf aarch64-linux-gnu aarch64-rtems \
sparc-wrs-vxworks sparc64-elf sparc64-rtems sparc64-linux sparc64-freebsd6 \
sparc64-netbsd sparc64-openbsd \
tilegx-linux-gnu tilegxbe-linux-gnu tilepro-linux-gnu \
v850e-elf v850-elf v850-rtems vax-linux-gnu \
v850e1-elf v850e-elf v850-elf v850-rtems vax-linux-gnu \
vax-netbsdelf vax-openbsd visium-elf x86_64-apple-darwin \
x86_64-pc-linux-gnuOPT-with-fpmath=avx \
x86_64-elfOPT-with-fpmath=sse x86_64-freebsd6 x86_64-netbsd \

View File

@ -117,7 +117,7 @@ class Prog:
self.tool_re = re.compile (r'^\t\t=== (.*) tests ===$')
self.result_re = re.compile (r'^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED'
r'|WARNING|ERROR|UNSUPPORTED|UNTESTED'
r'|KFAIL|KPASS):\s*(.+)')
r'|KFAIL|KPASS|PATH|DUPLICATE):\s*(.+)')
self.completed_re = re.compile (r'.* completed at (.*)')
# Pieces of text to write at the head of the output.
# start_line is a pair in which the first element is a datetime
@ -143,7 +143,9 @@ class Prog:
'# of known failures\t\t',
'# of untested testcases\t\t',
'# of unresolved testcases\t',
'# of unsupported tests\t\t'
'# of unsupported tests\t\t',
'# of paths in test names\t',
'# of duplicate test names\t'
]
self.runs = dict()

View File

@ -326,7 +326,7 @@ BEGIN {
}
}
/^\t\t=== .* ===$/ { curvar = ""; next }
/^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED|WARNING|ERROR|UNSUPPORTED|UNTESTED|KFAIL|KPASS):/ {
/^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED|WARNING|ERROR|UNSUPPORTED|UNTESTED|KFAIL|KPASS|PATH|DUPLICATE):/ {
testname=\$2
# Ugly hack for gfortran.dg/dg.exp
if ("$TOOL" == "gfortran" && testname ~ /^gfortran.dg\/g77\//)
@ -400,6 +400,7 @@ BEGIN {
variant="$VAR"
tool="$TOOL"
passcnt=0; failcnt=0; untstcnt=0; xpasscnt=0; xfailcnt=0; kpasscnt=0; kfailcnt=0; unsupcnt=0; unrescnt=0; dgerrorcnt=0;
pathcnt=0; dupcnt=0
curvar=""; insummary=0
}
/^Running target / { curvar = \$3; next }
@ -414,6 +415,8 @@ BEGIN {
/^# of untested testcases/ { if (insummary == 1) untstcnt += \$5; next; }
/^# of unresolved testcases/ { if (insummary == 1) unrescnt += \$5; next; }
/^# of unsupported tests/ { if (insummary == 1) unsupcnt += \$5; next; }
/^# of paths in test names/ { if (insummary == 1) pathcnt += \$7; next; }
/^# of duplicate test names/ { if (insummary == 1) dupcnt += \$6; next; }
/^$/ { if (insummary == 1)
{ insummary = 0; curvar = "" }
next
@ -431,6 +434,8 @@ END {
if (untstcnt != 0) printf ("# of untested testcases\t\t%d\n", untstcnt)
if (unrescnt != 0) printf ("# of unresolved testcases\t%d\n", unrescnt)
if (unsupcnt != 0) printf ("# of unsupported tests\t\t%d\n", unsupcnt)
if (pathcnt != 0) printf ("# of paths in test names\t%d\n", pathcnt)
if (dupcnt != 0) printf ("# of duplicate test names\t%d\n", dupcnt)
}
EOF
@ -452,6 +457,7 @@ cat << EOF > $TOTAL_AWK
BEGIN {
tool="$TOOL"
passcnt=0; failcnt=0; untstcnt=0; xpasscnt=0; xfailcnt=0; kfailcnt=0; unsupcnt=0; unrescnt=0; dgerrorcnt=0
pathcnt=0; dupcnt=0
}
/^# of DejaGnu errors/ { dgerrorcnt += \$5 }
/^# of expected passes/ { passcnt += \$5 }
@ -463,6 +469,8 @@ BEGIN {
/^# of untested testcases/ { untstcnt += \$5 }
/^# of unresolved testcases/ { unrescnt += \$5 }
/^# of unsupported tests/ { unsupcnt += \$5 }
/^# of paths in test names/ { pathcnt += \$7 }
/^# of duplicate test names/ { dupcnt += \$6 }
END {
printf ("\n\t\t=== %s Summary ===\n\n", tool)
if (dgerrorcnt != 0) printf ("# of DejaGnu errors\t\t%d\n", dgerrorcnt)
@ -475,6 +483,8 @@ END {
if (untstcnt != 0) printf ("# of untested testcases\t\t%d\n", untstcnt)
if (unrescnt != 0) printf ("# of unresolved testcases\t%d\n", unrescnt)
if (unsupcnt != 0) printf ("# of unsupported tests\t\t%d\n", unsupcnt)
if (pathcnt != 0) printf ("# of paths in test names\t%d\n", pathcnt)
if (dupcnt != 0) printf ("# of duplicate test names\t%d\n", dupcnt)
}
EOF

View File

@ -47,9 +47,12 @@ force=0
OS=$(uname)
case $OS in
"Darwin"|"FreeBSD"|"DragonFly")
"Darwin"|"FreeBSD"|"DragonFly"|"AIX")
chksum='shasum -a 512 --check'
;;
"OpenBSD")
chksum='sha512 -c'
;;
*)
chksum='sha512sum -c'
;;
@ -219,7 +222,7 @@ for ar in $(echo_archives)
do
if [ ${force} -gt 0 ]; then rm -f "${directory}/${ar}"; fi
[ -e "${directory}/${ar}" ] \
|| ${fetch} --no-verbose -O "${directory}/${ar}" "${base_url}${ar}" \
|| ( cd "${directory}" && ${fetch} --no-verbose "${base_url}${ar}" ) \
|| die "Cannot download ${ar} from ${base_url}"
done
unset ar
@ -242,8 +245,19 @@ for ar in $(echo_archives)
do
package="${ar%.tar*}"
if [ ${force} -gt 0 ]; then rm -rf "${directory}/${package}"; fi
case $ar in
*.gz)
uncompress='gzip -d'
;;
*.bz2)
uncompress='bzip2 -d'
;;
*)
uncompress='cat'
;;
esac
[ -e "${directory}/${package}" ] \
|| ( cd "${directory}" && tar -xf "${ar}" ) \
|| ( cd "${directory}" && $uncompress <"${ar}" | tar -xf - ) \
|| die "Cannot extract package from ${ar}"
unset package
done

View File

@ -0,0 +1,49 @@
#!/usr/bin/env python3
#
# 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/>. */
import argparse
from git_repository import parse_git_revisions
parser = argparse.ArgumentParser(description='Check git ChangeLog format '
'of a commit')
parser.add_argument('revisions', default='HEAD', nargs='?',
help='Git revisions (e.g. hash~5..hash or just hash)')
parser.add_argument('-g', '--git-path', default='.',
help='Path to git repository')
parser.add_argument('-p', '--print-changelog', action='store_true',
help='Print final changelog entires')
parser.add_argument('-n', '--non-strict-mode', action='store_true',
help='Use non-strict mode (allow changes in ChangeLog and '
'other automatically updated files).')
args = parser.parse_args()
retval = 0
for git_commit in parse_git_revisions(args.git_path, args.revisions,
not args.non_strict_mode):
res = 'OK' if git_commit.success else 'FAILED'
print('Checking %s: %s' % (git_commit.original_info.hexsha, res))
if git_commit.success:
if args.print_changelog:
git_commit.print_output()
else:
for error in git_commit.errors:
print('ERR: %s' % error)
retval = 1
exit(retval)

View File

@ -0,0 +1,677 @@
#!/usr/bin/env python3
#
# 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/>. */
import os
import re
changelog_locations = set([
'config',
'contrib',
'contrib/header-tools',
'contrib/reghunt',
'contrib/regression',
'fixincludes',
'gcc/ada',
'gcc/analyzer',
'gcc/brig',
'gcc/c',
'gcc/c-family',
'gcc',
'gcc/cp',
'gcc/d',
'gcc/fortran',
'gcc/go',
'gcc/jit',
'gcc/lto',
'gcc/objc',
'gcc/objcp',
'gcc/po',
'gcc/testsuite',
'gnattools',
'gotools',
'include',
'intl',
'libada',
'libatomic',
'libbacktrace',
'libcc1',
'libcpp',
'libcpp/po',
'libdecnumber',
'libffi',
'libgcc',
'libgcc/config/avr/libf7',
'libgcc/config/libbid',
'libgfortran',
'libgomp',
'libhsail-rt',
'libiberty',
'libitm',
'libobjc',
'liboffloadmic',
'libphobos',
'libquadmath',
'libsanitizer',
'libssp',
'libstdc++-v3',
'libvtv',
'lto-plugin',
'maintainer-scripts',
'zlib'])
bug_components = set([
'ada',
'analyzer',
'boehm-gc',
'bootstrap',
'c',
'c++',
'd',
'debug',
'demangler',
'driver',
'fastjar',
'fortran',
'gcov-profile',
'go',
'hsa',
'inline-asm',
'ipa',
'java',
'jit',
'libbacktrace',
'libf2c',
'libffi',
'libfortran',
'libgcc',
'libgcj',
'libgomp',
'libitm',
'libobjc',
'libquadmath',
'libstdc++',
'lto',
'middle-end',
'modula2',
'objc',
'objc++',
'other',
'pch',
'pending',
'plugins',
'preprocessor',
'regression',
'rtl-optimization',
'sanitizer',
'spam',
'target',
'testsuite',
'translation',
'tree-optimization',
'web'])
ignored_prefixes = [
'gcc/d/dmd/',
'gcc/go/gofrontend/',
'gcc/testsuite/gdc.test/',
'gcc/testsuite/go.test/test/',
'libgo/',
'libphobos/libdruntime/',
'libphobos/src/',
'libsanitizer/',
]
wildcard_prefixes = [
'gcc/testsuite/',
'libstdc++-v3/doc/html/'
]
misc_files = [
'gcc/DATESTAMP',
'gcc/BASE-VER',
'gcc/DEV-PHASE'
]
author_line_regex = \
re.compile(r'^(?P<datetime>\d{4}-\d{2}-\d{2})\ {2}(?P<name>.* <.*>)')
additional_author_regex = re.compile(r'^\t(?P<spaces>\ *)?(?P<name>.* <.*>)')
changelog_regex = re.compile(r'^(?:[fF]or +)?([a-z0-9+-/]*)ChangeLog:?')
pr_regex = re.compile(r'\tPR (?P<component>[a-z+-]+\/)?([0-9]+)$')
dr_regex = re.compile(r'\tDR ([0-9]+)$')
star_prefix_regex = re.compile(r'\t\*(?P<spaces>\ *)(?P<content>.*)')
end_of_location_regex = re.compile(r'[\[<(:]')
LINE_LIMIT = 100
TAB_WIDTH = 8
CO_AUTHORED_BY_PREFIX = 'co-authored-by: '
CHERRY_PICK_PREFIX = '(cherry picked from commit '
REVERT_PREFIX = 'This reverts commit '
REVIEW_PREFIXES = ('reviewed-by: ', 'reviewed-on: ', 'signed-off-by: ',
'acked-by: ', 'tested-by: ', 'reported-by: ',
'suggested-by: ')
DATE_FORMAT = '%Y-%m-%d'
class Error:
def __init__(self, message, line=None):
self.message = message
self.line = line
def __repr__(self):
s = self.message
if self.line:
s += ':"%s"' % self.line
return s
class ChangeLogEntry:
def __init__(self, folder, authors, prs):
self.folder = folder
# The 'list.copy()' function is not available before Python 3.3
self.author_lines = list(authors)
self.initial_prs = list(prs)
self.prs = list(prs)
self.lines = []
self.files = []
self.file_patterns = []
def parse_file_names(self):
# Whether the content currently processed is between a star prefix the
# end of the file list: a colon or an open paren.
in_location = False
for line in self.lines:
# If this line matches the star prefix, start the location
# processing on the information that follows the star.
m = star_prefix_regex.match(line)
if m:
in_location = True
line = m.group('content')
if in_location:
# Strip everything that is not a filename in "line":
# entities "(NAME)", cases "<PATTERN>", conditions
# "[COND]", entry text (the colon, if present, and
# anything that follows it).
m = end_of_location_regex.search(line)
if m:
line = line[:m.start()]
in_location = False
# At this point, all that's left is a list of filenames
# separated by commas and whitespaces.
for file in line.split(','):
file = file.strip()
if file:
if file.endswith('*'):
self.file_patterns.append(file[:-1])
else:
self.files.append(file)
@property
def datetime(self):
for author in self.author_lines:
if author[1]:
return author[1]
return None
@property
def authors(self):
return [author_line[0] for author_line in self.author_lines]
@property
def is_empty(self):
return not self.lines and self.prs == self.initial_prs
def contains_author(self, author):
for author_lines in self.author_lines:
if author_lines[0] == author:
return True
return False
class GitInfo:
def __init__(self, hexsha, date, author, lines, modified_files):
self.hexsha = hexsha
self.date = date
self.author = author
self.lines = lines
self.modified_files = modified_files
class GitCommit:
def __init__(self, info, strict=True, commit_to_info_hook=None):
self.original_info = info
self.info = info
self.message = None
self.changes = None
self.changelog_entries = []
self.errors = []
self.top_level_authors = []
self.co_authors = []
self.top_level_prs = []
self.cherry_pick_commit = None
self.revert_commit = None
self.commit_to_info_hook = commit_to_info_hook
# Identify first if the commit is a Revert commit
for line in self.info.lines:
if line.startswith(REVERT_PREFIX):
self.revert_commit = line[len(REVERT_PREFIX):].rstrip('.')
break
if self.revert_commit:
self.info = self.commit_to_info_hook(self.revert_commit)
project_files = [f for f in self.info.modified_files
if self.is_changelog_filename(f[0])
or f[0] in misc_files]
ignored_files = [f for f in self.info.modified_files
if self.in_ignored_location(f[0])]
if len(project_files) == len(self.info.modified_files):
# All modified files are only MISC files
return
elif project_files and strict:
self.errors.append(Error('ChangeLog, DATESTAMP, BASE-VER and '
'DEV-PHASE updates should be done '
'separately from normal commits'))
return
all_are_ignored = (len(project_files) + len(ignored_files)
== len(self.info.modified_files))
self.parse_lines(all_are_ignored)
if self.changes:
self.parse_changelog()
self.parse_file_names()
self.check_for_empty_description()
self.deduce_changelog_locations()
self.check_file_patterns()
if not self.errors:
self.check_mentioned_files()
self.check_for_correct_changelog()
@property
def success(self):
return not self.errors
@property
def new_files(self):
return [x[0] for x in self.info.modified_files if x[1] == 'A']
@classmethod
def is_changelog_filename(cls, path):
return path.endswith('/ChangeLog') or path == 'ChangeLog'
@classmethod
def find_changelog_location(cls, name):
if name.startswith('\t'):
name = name[1:]
if name.endswith(':'):
name = name[:-1]
if name.endswith('/'):
name = name[:-1]
return name if name in changelog_locations else None
@classmethod
def format_git_author(cls, author):
assert '<' in author
return author.replace('<', ' <')
@classmethod
def parse_git_name_status(cls, string):
modified_files = []
for entry in string.split('\n'):
parts = entry.split('\t')
t = parts[0]
if t == 'A' or t == 'D' or t == 'M':
modified_files.append((parts[1], t))
elif t.startswith('R'):
modified_files.append((parts[1], 'D'))
modified_files.append((parts[2], 'A'))
return modified_files
def parse_lines(self, all_are_ignored):
body = self.info.lines
for i, b in enumerate(body):
if not b:
continue
if (changelog_regex.match(b) or self.find_changelog_location(b)
or star_prefix_regex.match(b) or pr_regex.match(b)
or dr_regex.match(b) or author_line_regex.match(b)):
self.changes = body[i:]
return
if not all_are_ignored:
self.errors.append(Error('cannot find a ChangeLog location in '
'message'))
def parse_changelog(self):
last_entry = None
will_deduce = False
for line in self.changes:
if not line:
if last_entry and will_deduce:
last_entry = None
continue
if line != line.rstrip():
self.errors.append(Error('trailing whitespace', line))
if len(line.replace('\t', ' ' * TAB_WIDTH)) > LINE_LIMIT:
self.errors.append(Error('line exceeds %d character limit'
% LINE_LIMIT, line))
m = changelog_regex.match(line)
if m:
last_entry = ChangeLogEntry(m.group(1).rstrip('/'),
self.top_level_authors,
self.top_level_prs)
self.changelog_entries.append(last_entry)
elif self.find_changelog_location(line):
last_entry = ChangeLogEntry(self.find_changelog_location(line),
self.top_level_authors,
self.top_level_prs)
self.changelog_entries.append(last_entry)
else:
author_tuple = None
pr_line = None
if author_line_regex.match(line):
m = author_line_regex.match(line)
author_tuple = (m.group('name'), m.group('datetime'))
elif additional_author_regex.match(line):
m = additional_author_regex.match(line)
if len(m.group('spaces')) != 4:
msg = 'additional author must be indented with '\
'one tab and four spaces'
self.errors.append(Error(msg, line))
else:
author_tuple = (m.group('name'), None)
elif pr_regex.match(line):
component = pr_regex.match(line).group('component')
if not component:
self.errors.append(Error('missing PR component', line))
continue
elif not component[:-1] in bug_components:
self.errors.append(Error('invalid PR component', line))
continue
else:
pr_line = line.lstrip()
elif dr_regex.match(line):
pr_line = line.lstrip()
lowered_line = line.lower()
if lowered_line.startswith(CO_AUTHORED_BY_PREFIX):
name = line[len(CO_AUTHORED_BY_PREFIX):]
author = self.format_git_author(name)
self.co_authors.append(author)
continue
elif lowered_line.startswith(REVIEW_PREFIXES):
continue
elif line.startswith(CHERRY_PICK_PREFIX):
commit = line[len(CHERRY_PICK_PREFIX):].rstrip(')')
self.cherry_pick_commit = commit
continue
# ChangeLog name will be deduced later
if not last_entry:
if author_tuple:
self.top_level_authors.append(author_tuple)
continue
elif pr_line:
# append to top_level_prs only when we haven't met
# a ChangeLog entry
if (pr_line not in self.top_level_prs
and not self.changelog_entries):
self.top_level_prs.append(pr_line)
continue
else:
last_entry = ChangeLogEntry(None,
self.top_level_authors,
self.top_level_prs)
self.changelog_entries.append(last_entry)
will_deduce = True
elif author_tuple:
if not last_entry.contains_author(author_tuple[0]):
last_entry.author_lines.append(author_tuple)
continue
if not line.startswith('\t'):
err = Error('line should start with a tab', line)
self.errors.append(err)
elif pr_line:
last_entry.prs.append(pr_line)
else:
m = star_prefix_regex.match(line)
if m:
if len(m.group('spaces')) != 1:
msg = 'one space should follow asterisk'
self.errors.append(Error(msg, line))
else:
last_entry.lines.append(line)
else:
if last_entry.is_empty:
msg = 'first line should start with a tab, ' \
'an asterisk and a space'
self.errors.append(Error(msg, line))
else:
last_entry.lines.append(line)
def parse_file_names(self):
for entry in self.changelog_entries:
entry.parse_file_names()
def check_file_patterns(self):
for entry in self.changelog_entries:
for pattern in entry.file_patterns:
name = os.path.join(entry.folder, pattern)
if name not in wildcard_prefixes:
msg = 'unsupported wildcard prefix'
self.errors.append(Error(msg, name))
def check_for_empty_description(self):
for entry in self.changelog_entries:
for i, line in enumerate(entry.lines):
if (star_prefix_regex.match(line) and line.endswith(':') and
(i == len(entry.lines) - 1
or star_prefix_regex.match(entry.lines[i + 1]))):
msg = 'missing description of a change'
self.errors.append(Error(msg, line))
def get_file_changelog_location(self, changelog_file):
for file in self.info.modified_files:
if file[0] == changelog_file:
# root ChangeLog file
return ''
index = file[0].find('/' + changelog_file)
if index != -1:
return file[0][:index]
return None
def deduce_changelog_locations(self):
for entry in self.changelog_entries:
if not entry.folder:
changelog = None
for file in entry.files:
location = self.get_file_changelog_location(file)
if (location == ''
or (location and location in changelog_locations)):
if changelog and changelog != location:
msg = 'could not deduce ChangeLog file, ' \
'not unique location'
self.errors.append(Error(msg))
return
changelog = location
if changelog is not None:
entry.folder = changelog
else:
msg = 'could not deduce ChangeLog file'
self.errors.append(Error(msg))
@classmethod
def in_ignored_location(cls, path):
for ignored in ignored_prefixes:
if path.startswith(ignored):
return True
return False
@classmethod
def get_changelog_by_path(cls, path):
components = path.split('/')
while components:
if '/'.join(components) in changelog_locations:
break
components = components[:-1]
return '/'.join(components)
def check_mentioned_files(self):
folder_count = len([x.folder for x in self.changelog_entries])
assert folder_count == len(self.changelog_entries)
mentioned_files = set()
mentioned_patterns = []
used_patterns = set()
for entry in self.changelog_entries:
if not entry.files:
msg = 'no files mentioned for ChangeLog in directory'
self.errors.append(Error(msg, entry.folder))
assert not entry.folder.endswith('/')
for file in entry.files:
if not self.is_changelog_filename(file):
mentioned_files.add(os.path.join(entry.folder, file))
for pattern in entry.file_patterns:
mentioned_patterns.append(os.path.join(entry.folder, pattern))
cand = [x[0] for x in self.info.modified_files
if not self.is_changelog_filename(x[0])]
changed_files = set(cand)
for file in sorted(mentioned_files - changed_files):
msg = 'unchanged file mentioned in a ChangeLog'
self.errors.append(Error(msg, file))
for file in sorted(changed_files - mentioned_files):
if not self.in_ignored_location(file):
if file in self.new_files:
changelog_location = self.get_changelog_by_path(file)
# Python2: we cannot use next(filter(...))
entries = filter(lambda x: x.folder == changelog_location,
self.changelog_entries)
entries = list(entries)
entry = entries[0] if entries else None
if not entry:
prs = self.top_level_prs
if not prs:
# if all ChangeLog entries have identical PRs
# then use them
prs = self.changelog_entries[0].prs
for entry in self.changelog_entries:
if entry.prs != prs:
prs = []
break
entry = ChangeLogEntry(changelog_location,
self.top_level_authors,
prs)
self.changelog_entries.append(entry)
# strip prefix of the file
assert file.startswith(entry.folder)
file = file[len(entry.folder):].lstrip('/')
entry.lines.append('\t* %s: New file.' % file)
entry.files.append(file)
else:
used_pattern = [p for p in mentioned_patterns
if file.startswith(p)]
used_pattern = used_pattern[0] if used_pattern else None
if used_pattern:
used_patterns.add(used_pattern)
else:
msg = 'changed file not mentioned in a ChangeLog'
self.errors.append(Error(msg, file))
for pattern in mentioned_patterns:
if pattern not in used_patterns:
error = 'pattern doesn''t match any changed files'
self.errors.append(Error(error, pattern))
def check_for_correct_changelog(self):
for entry in self.changelog_entries:
for file in entry.files:
full_path = os.path.join(entry.folder, file)
changelog_location = self.get_changelog_by_path(full_path)
if changelog_location != entry.folder:
msg = 'wrong ChangeLog location "%s", should be "%s"'
err = Error(msg % (entry.folder, changelog_location), file)
self.errors.append(err)
@classmethod
def format_authors_in_changelog(cls, authors, timestamp, prefix=''):
output = ''
for i, author in enumerate(authors):
if i == 0:
output += '%s%s %s\n' % (prefix, timestamp, author)
else:
output += '%s\t %s\n' % (prefix, author)
output += '\n'
return output
def to_changelog_entries(self, use_commit_ts=False):
current_timestamp = self.info.date.strftime(DATE_FORMAT)
for entry in self.changelog_entries:
output = ''
timestamp = entry.datetime
if self.revert_commit:
timestamp = current_timestamp
orig_date = self.original_info.date
current_timestamp = orig_date.strftime(DATE_FORMAT)
elif self.cherry_pick_commit:
info = self.commit_to_info_hook(self.cherry_pick_commit)
# it can happen that it is a cherry-pick for a different
# repository
if info:
timestamp = info.date.strftime(DATE_FORMAT)
else:
timestamp = current_timestamp
elif not timestamp or use_commit_ts:
timestamp = current_timestamp
authors = entry.authors if entry.authors else [self.info.author]
# add Co-Authored-By authors to all ChangeLog entries
for author in self.co_authors:
if author not in authors:
authors.append(author)
if self.cherry_pick_commit or self.revert_commit:
original_author = self.original_info.author
output += self.format_authors_in_changelog([original_author],
current_timestamp)
if self.revert_commit:
output += '\tRevert:\n'
else:
output += '\tBackported from master:\n'
output += self.format_authors_in_changelog(authors,
timestamp, '\t')
else:
output += self.format_authors_in_changelog(authors, timestamp)
for pr in entry.prs:
output += '\t%s\n' % pr
for line in entry.lines:
output += line + '\n'
yield (entry.folder, output.rstrip())
def print_output(self):
for entry, output in self.to_changelog_entries():
print('------ %s/ChangeLog ------ ' % entry)
print(output)
def print_errors(self):
print('Errors:')
for error in self.errors:
print(error)

View File

@ -0,0 +1,107 @@
#!/usr/bin/env python3
#
# 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/>. */
import os
import sys
from itertools import takewhile
from dateutil.parser import parse
from git_commit import GitCommit, GitInfo
from unidiff import PatchSet
DATE_PREFIX = 'Date: '
FROM_PREFIX = 'From: '
class GitEmail(GitCommit):
def __init__(self, filename, strict=False):
self.filename = filename
diff = PatchSet.from_filename(filename)
date = None
author = None
with open(self.filename, 'r') as f:
lines = f.read().splitlines()
lines = list(takewhile(lambda line: line != '---', lines))
for line in lines:
if line.startswith(DATE_PREFIX):
date = parse(line[len(DATE_PREFIX):])
elif line.startswith(FROM_PREFIX):
author = GitCommit.format_git_author(line[len(FROM_PREFIX):])
header = list(takewhile(lambda line: line != '', lines))
body = lines[len(header) + 1:]
modified_files = []
for f in diff:
# Strip "a/" and "b/" prefixes
source = f.source_file[2:]
target = f.target_file[2:]
if f.is_added_file:
t = 'A'
elif f.is_removed_file:
t = 'D'
elif f.is_rename:
# Consider that renamed files are two operations: the deletion
# of the original name and the addition of the new one.
modified_files.append((source, 'D'))
t = 'A'
else:
t = 'M'
modified_files.append((target, t))
git_info = GitInfo(None, date, author, body, modified_files)
super().__init__(git_info, strict=strict,
commit_to_info_hook=lambda x: None)
# With zero arguments, process every patch file in the ./patches directory.
# With one argument, process the named patch file.
# Patch files must be in 'git format-patch' format.
if __name__ == '__main__':
if len(sys.argv) == 1:
allfiles = []
for root, _dirs, files in os.walk('patches'):
for f in files:
full = os.path.join(root, f)
allfiles.append(full)
success = 0
for full in sorted(allfiles):
email = GitEmail(full, False)
print(email.filename)
if email.success:
success += 1
print(' OK')
else:
for error in email.errors:
print(' ERR: %s' % error)
print()
print('Successfully parsed: %d/%d' % (success, len(allfiles)))
else:
email = GitEmail(sys.argv[1], False)
if email.success:
print('OK')
email.print_output()
else:
if not email.info.lines:
print('Error: patch contains no parsed lines', file=sys.stderr)
email.print_errors()
sys.exit(1)

View File

@ -0,0 +1,78 @@
#!/usr/bin/env python3
#
# 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/>. */
from datetime import datetime
try:
from git import Repo
except ImportError:
print('Cannot import GitPython package, please install the package:')
print(' Fedora, openSUSE: python3-GitPython')
print(' Debian, Ubuntu: python3-git')
exit(1)
from git_commit import GitCommit, GitInfo
def parse_git_revisions(repo_path, revisions, strict=False):
repo = Repo(repo_path)
def commit_to_info(commit):
try:
c = repo.commit(commit)
diff = repo.commit(commit + '~').diff(commit)
modified_files = []
for file in diff:
if hasattr(file, 'renamed_file'):
is_renamed = file.renamed_file
else:
is_renamed = file.renamed
if file.new_file:
t = 'A'
elif file.deleted_file:
t = 'D'
elif is_renamed:
# Consider that renamed files are two operations:
# the deletion of the original name
# and the addition of the new one.
modified_files.append((file.a_path, 'D'))
t = 'A'
else:
t = 'M'
modified_files.append((file.b_path, t))
date = datetime.utcfromtimestamp(c.committed_date)
author = '%s <%s>' % (c.author.name, c.author.email)
git_info = GitInfo(c.hexsha, date, author,
c.message.split('\n'), modified_files)
return git_info
except ValueError:
return None
parsed_commits = []
if '..' in revisions:
commits = list(repo.iter_commits(revisions))
else:
commits = [repo.commit(revisions)]
for commit in commits:
git_commit = GitCommit(commit_to_info(commit.hexsha), strict=strict,
commit_to_info_hook=commit_to_info)
parsed_commits.append(git_commit)
return parsed_commits

View File

@ -0,0 +1,145 @@
#!/usr/bin/env python3
#
# 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/>. */
import argparse
import datetime
import os
from git import Repo
from git_repository import parse_git_revisions
current_timestamp = datetime.datetime.now().strftime('%Y%m%d\n')
def read_timestamp(path):
with open(path) as f:
return f.read()
def prepend_to_changelog_files(repo, folder, git_commit, add_to_git):
if not git_commit.success:
for error in git_commit.errors:
print(error)
raise AssertionError()
for entry, output in git_commit.to_changelog_entries(use_commit_ts=True):
full_path = os.path.join(folder, entry, 'ChangeLog')
print('writing to %s' % full_path)
if os.path.exists(full_path):
with open(full_path) as f:
content = f.read()
else:
content = ''
with open(full_path, 'w+') as f:
f.write(output)
if content:
f.write('\n\n')
f.write(content)
if add_to_git:
repo.git.add(full_path)
active_refs = ['master', 'releases/gcc-8', 'releases/gcc-9', 'releases/gcc-10']
parser = argparse.ArgumentParser(description='Update DATESTAMP and generate '
'ChangeLog entries')
parser.add_argument('-g', '--git-path', default='.',
help='Path to git repository')
parser.add_argument('-p', '--push', action='store_true',
help='Push updated active branches')
parser.add_argument('-d', '--dry-mode',
help='Generate patch for ChangeLog entries and do it'
' even if DATESTAMP is unchanged; folder argument'
' is expected')
parser.add_argument('-c', '--current', action='store_true',
help='Modify current branch (--push argument is ignored)')
args = parser.parse_args()
repo = Repo(args.git_path)
origin = repo.remotes['origin']
def update_current_branch():
commit = repo.head.commit
commit_count = 1
while commit:
if (commit.author.email == 'gccadmin@gcc.gnu.org'
and commit.message.strip() == 'Daily bump.'):
break
# We support merge commits but only with 2 parensts
assert len(commit.parents) <= 2
commit = commit.parents[-1]
commit_count += 1
print('%d revisions since last Daily bump' % commit_count)
datestamp_path = os.path.join(args.git_path, 'gcc/DATESTAMP')
if (read_timestamp(datestamp_path) != current_timestamp
or args.dry_mode or args.current):
head = repo.head.commit
# if HEAD is a merge commit, start with second parent
# (branched that is being merged into the current one)
assert len(head.parents) <= 2
if len(head.parents) == 2:
head = head.parents[1]
commits = parse_git_revisions(args.git_path, '%s..%s'
% (commit.hexsha, head.hexsha))
for git_commit in reversed(commits):
prepend_to_changelog_files(repo, args.git_path, git_commit,
not args.dry_mode)
if args.dry_mode:
diff = repo.git.diff('HEAD')
patch = os.path.join(args.dry_mode,
branch.name.split('/')[-1] + '.patch')
with open(patch, 'w+') as f:
f.write(diff)
print('branch diff written to %s' % patch)
repo.git.checkout(force=True)
else:
# update timestamp
print('DATESTAMP will be changed:')
with open(datestamp_path, 'w+') as f:
f.write(current_timestamp)
repo.git.add(datestamp_path)
if not args.current:
repo.index.commit('Daily bump.')
if args.push:
repo.git.push('origin', branch)
print('branch is pushed')
else:
print('DATESTAMP unchanged')
if args.current:
print('=== Working on the current branch ===', flush=True)
update_current_branch()
else:
for ref in origin.refs:
assert ref.name.startswith('origin/')
name = ref.name[len('origin/'):]
if name in active_refs:
if name in repo.branches:
branch = repo.branches[name]
else:
branch = repo.create_head(name, ref).set_tracking_branch(ref)
print('=== Working on: %s ===' % branch, flush=True)
branch.checkout()
origin.pull(rebase=True)
print('branch pulled and checked out')
update_current_branch()
assert not repo.index.diff(None)
print('branch is done\n', flush=True)

View File

@ -0,0 +1,367 @@
#!/usr/bin/env python3
#
# 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/>. */
import os
import tempfile
import unittest
from git_commit import GitCommit
from git_email import GitEmail
import unidiff
script_path = os.path.dirname(os.path.realpath(__file__))
unidiff_supports_renaming = hasattr(unidiff.PatchedFile(), 'is_rename')
NAME_STATUS1 = """
M gcc/ada/impunit.adb'
R097 gcc/ada/libgnat/s-atopar.adb gcc/ada/libgnat/s-aoinar.adb
"""
class TestGccChangelog(unittest.TestCase):
def setUp(self):
self.patches = {}
self.temps = []
filename = None
patch_lines = []
with open(os.path.join(script_path, 'test_patches.txt')) as f:
lines = f.read()
for line in lines.split('\n'):
if line.startswith('==='):
if patch_lines:
self.patches[filename] = patch_lines
filename = line.split(' ')[1]
patch_lines = []
else:
patch_lines.append(line)
if patch_lines:
self.patches[filename] = patch_lines
def tearDown(self):
for t in self.temps:
assert t.endswith('.patch')
os.remove(t)
def get_git_email(self, filename, strict=False):
with tempfile.NamedTemporaryFile(mode='w+', suffix='.patch',
delete=False) as f:
f.write('\n'.join(self.patches[filename]))
self.temps.append(f.name)
return GitEmail(f.name, strict)
def from_patch_glob(self, name, strict=False):
files = [f for f in self.patches.keys() if f.startswith(name)]
assert len(files) == 1
return self.get_git_email(files[0], strict)
def test_simple_patch_format(self):
email = self.get_git_email('0577-aarch64-Add-an-and.patch')
assert not email.errors
assert len(email.changelog_entries) == 2
entry = email.changelog_entries[0]
assert (entry.author_lines ==
[('Richard Sandiford <richard.sandiford@arm.com>',
'2020-02-06')])
assert len(entry.authors) == 1
assert (entry.authors[0]
== 'Richard Sandiford <richard.sandiford@arm.com>')
assert entry.folder == 'gcc'
assert entry.prs == ['PR target/87763']
assert len(entry.files) == 3
assert entry.files[0] == 'config/aarch64/aarch64-protos.h'
def test_daily_bump(self):
email = self.get_git_email('0085-Daily-bump.patch')
assert not email.errors
assert not email.changelog_entries
def test_deduce_changelog_entries(self):
email = self.from_patch_glob('0040')
assert len(email.changelog_entries) == 2
assert email.changelog_entries[0].folder == 'gcc/cp'
assert email.changelog_entries[0].prs == ['PR c++/90916']
assert email.changelog_entries[0].files == ['pt.c']
# this one is added automatically
assert email.changelog_entries[1].folder == 'gcc/testsuite'
def test_only_changelog_updated(self):
email = self.from_patch_glob('0129')
assert not email.errors
assert not email.changelog_entries
def test_wrong_mentioned_filename(self):
email = self.from_patch_glob('0096')
assert email.errors
err = email.errors[0]
assert err.message == 'unchanged file mentioned in a ChangeLog'
assert err.line == 'gcc/testsuite/gcc.target/aarch64/' \
'advsimd-intrinsics/vdot-compile-3-1.c'
def test_missing_tab(self):
email = self.from_patch_glob('0031')
assert len(email.errors) == 2
err = email.errors[0]
assert err.message == 'line should start with a tab'
assert err.line == ' * cfgloopanal.c (average_num_loop_insns): ' \
'Free bbs when early'
def test_leading_changelog_format(self):
email = self.from_patch_glob('0184')
assert len(email.errors) == 4
assert email.errors[0].line == 'gcc/c-family/c-cppbuiltins.c'
assert email.errors[2].line == 'gcc/c-family/c-cppbuiltin.c'
def test_cannot_deduce_no_blank_line(self):
email = self.from_patch_glob('0334')
assert len(email.errors) == 1
assert len(email.changelog_entries) == 1
assert email.changelog_entries[0].folder is None
def test_author_lines(self):
email = self.from_patch_glob('0814')
assert not email.errors
assert (email.changelog_entries[0].author_lines ==
[('Martin Jambor <mjambor@suse.cz>', '2020-02-19')])
def test_multiple_authors_and_prs(self):
email = self.from_patch_glob('0735')
assert len(email.changelog_entries) == 1
entry = email.changelog_entries[0]
assert len(entry.author_lines) == 2
assert len(entry.authors) == 2
assert (entry.author_lines[1] ==
('Bernd Edlinger <bernd.edlinger@hotmail.de>', None))
def test_multiple_prs(self):
email = self.from_patch_glob('1699')
assert len(email.changelog_entries) == 2
assert len(email.changelog_entries[0].prs) == 2
def test_missing_PR_component(self):
email = self.from_patch_glob('0735')
assert len(email.errors) == 1
assert email.errors[0].message == 'missing PR component'
def test_invalid_PR_component(self):
email = self.from_patch_glob('0198')
assert len(email.errors) == 1
assert email.errors[0].message == 'invalid PR component'
def test_additional_author_list(self):
email = self.from_patch_glob('0342')
msg = 'additional author must be indented ' \
'with one tab and four spaces'
assert email.errors[1].message == msg
def test_trailing_whitespaces(self):
email = self.get_git_email('trailing-whitespaces.patch')
assert len(email.errors) == 3
def test_space_after_asterisk(self):
email = self.from_patch_glob('1999')
assert len(email.errors) == 1
assert email.errors[0].message == 'one space should follow asterisk'
def test_long_lines(self):
email = self.get_git_email('long-lines.patch')
assert len(email.errors) == 1
assert email.errors[0].message == 'line exceeds 100 character limit'
def test_new_files(self):
email = self.from_patch_glob('0030')
assert not email.errors
def test_wrong_changelog_location(self):
email = self.from_patch_glob('0043')
assert len(email.errors) == 2
assert (email.errors[0].message ==
'wrong ChangeLog location "gcc", should be "gcc/testsuite"')
def test_single_author_name(self):
email = self.from_patch_glob('1975')
assert len(email.changelog_entries) == 2
assert len(email.changelog_entries[0].author_lines) == 1
assert len(email.changelog_entries[1].author_lines) == 1
def test_bad_first_line(self):
email = self.from_patch_glob('0413')
assert len(email.errors) == 1
def test_co_authored_by(self):
email = self.from_patch_glob('1850')
assert email.co_authors == ['Jakub Jelinek <jakub@redhat.com>']
output_entries = list(email.to_changelog_entries())
assert len(output_entries) == 2
ent0 = output_entries[0]
assert ent0[1].startswith('2020-04-16 Martin Liska '
'<mliska@suse.cz>\n\t'
' Jakub Jelinek <jakub@redhat.com>')
def test_multiple_co_author_formats(self):
email = self.get_git_email('co-authored-by.patch')
assert len(email.co_authors) == 3
assert email.co_authors[0] == 'Jakub Jelinek <jakub@redhat.com>'
assert email.co_authors[1] == 'John Miller <jm@example.com>'
assert email.co_authors[2] == 'John Miller2 <jm2@example.com>'
def test_new_file_added_entry(self):
email = self.from_patch_glob('1957')
output_entries = list(email.to_changelog_entries())
assert len(output_entries) == 2
needle = ('\t* g++.dg/cpp2a/lambda-generic-variadic20.C'
': New file.')
assert output_entries[1][1].endswith(needle)
assert email.changelog_entries[1].prs == ['PR c++/94546']
def test_global_pr_entry(self):
email = self.from_patch_glob('2004')
assert not email.errors
assert email.changelog_entries[0].prs == ['PR other/94629']
def test_unique_prs(self):
email = self.get_git_email('pr-check1.patch')
assert not email.errors
assert email.changelog_entries[0].prs == ['PR ipa/12345']
assert email.changelog_entries[1].prs == []
def test_multiple_prs_not_added(self):
email = self.from_patch_glob('0001-Add-patch_are')
assert not email.errors
assert email.changelog_entries[0].prs == ['PR target/93492']
assert email.changelog_entries[1].prs == ['PR target/12345']
assert email.changelog_entries[2].prs == []
assert email.changelog_entries[2].folder == 'gcc/testsuite'
def test_strict_mode(self):
email = self.from_patch_glob('0001-Add-patch_are',
True)
msg = 'ChangeLog, DATESTAMP, BASE-VER and DEV-PHASE updates should ' \
'be done separately from normal commits'
assert email.errors[0].message == msg
def test_strict_mode_normal_patch(self):
email = self.get_git_email('0001-Just-test-it.patch', True)
assert not email.errors
def test_strict_mode_datestamp_only(self):
email = self.get_git_email('0002-Bump-date.patch', True)
assert not email.errors
def test_wrong_changelog_entry(self):
email = self.from_patch_glob('0020-IPA-Avoid')
msg = 'first line should start with a tab, an asterisk and a space'
assert (email.errors[0].message == msg)
def test_cherry_pick_format(self):
email = self.from_patch_glob('0001-c-Alias.patch')
assert not email.errors
def test_signatures(self):
email = self.from_patch_glob('0001-RISC-V-Make-unique.patch')
assert not email.errors
assert len(email.changelog_entries) == 1
def test_duplicate_top_level_author(self):
email = self.from_patch_glob('0001-Fortran-ProcPtr-function.patch')
assert not email.errors
assert len(email.changelog_entries[0].author_lines) == 1
def test_dr_entry(self):
email = self.from_patch_glob('0001-c-C-20-DR-2237.patch')
assert email.changelog_entries[0].prs == ['DR 2237']
def test_changes_only_in_ignored_location(self):
email = self.from_patch_glob('0001-go-in-ignored-location.patch')
assert not email.errors
def test_changelog_for_ignored_location(self):
email = self.from_patch_glob('0001-Update-merge.sh-to-reflect.patch')
assert (email.changelog_entries[0].lines[0]
== '\t* LOCAL_PATCHES: Use git hash instead of SVN id.')
def test_multiline_file_list(self):
email = self.from_patch_glob(
'0001-Ada-Reuse-Is_Package_Or_Generic_Package-where-possib.patch')
assert (email.changelog_entries[0].files
== ['contracts.adb', 'einfo.adb', 'exp_ch9.adb',
'sem_ch12.adb', 'sem_ch4.adb', 'sem_ch7.adb',
'sem_ch8.adb', 'sem_elab.adb', 'sem_type.adb',
'sem_util.adb'])
@unittest.skipIf(not unidiff_supports_renaming,
'Newer version of unidiff is needed (0.6.0+)')
def test_renamed_file(self):
email = self.from_patch_glob(
'0001-Ada-Add-support-for-XDR-streaming-in-the-default-run.patch')
assert not email.errors
def test_duplicite_author_lines(self):
email = self.from_patch_glob('0001-Fortran-type-is-real-kind-1.patch')
assert (email.changelog_entries[0].author_lines[0][0]
== 'Steven G. Kargl <kargl@gcc.gnu.org>')
assert (email.changelog_entries[0].author_lines[1][0]
== 'Mark Eggleston <markeggleston@gcc.gnu.org>')
def test_missing_change_description(self):
email = self.from_patch_glob('0001-Missing-change-description.patch')
assert len(email.errors) == 2
assert email.errors[0].message == 'missing description of a change'
assert email.errors[1].message == 'missing description of a change'
def test_libstdcxx_html_regenerated(self):
email = self.from_patch_glob('0001-Fix-text-of-hyperlink')
assert not email.errors
email = self.from_patch_glob('0002-libstdc-Fake-test-change-1.patch')
assert len(email.errors) == 1
msg = 'pattern doesn''t match any changed files'
assert email.errors[0].message == msg
assert email.errors[0].line == 'libstdc++-v3/doc/html/'
email = self.from_patch_glob('0003-libstdc-Fake-test-change-2.patch')
assert len(email.errors) == 1
msg = 'changed file not mentioned in a ChangeLog'
assert email.errors[0].message == msg
def test_not_deduce(self):
email = self.from_patch_glob('0001-configure.patch')
assert not email.errors
assert len(email.changelog_entries) == 2
def test_parse_git_name_status(self):
modified_files = GitCommit.parse_git_name_status(NAME_STATUS1)
assert len(modified_files) == 3
assert modified_files[1] == ('gcc/ada/libgnat/s-atopar.adb', 'D')
assert modified_files[2] == ('gcc/ada/libgnat/s-aoinar.adb', 'A')
def test_backport(self):
email = self.from_patch_glob('0001-asan-fix-RTX-emission.patch')
assert not email.errors
assert len(email.changelog_entries) == 1
entry = list(email.to_changelog_entries())[0][1]
assert entry.startswith('2020-06-11 Martin Liska <mliska@suse.cz>')
assert '\tBackported from master:' in entry
assert '\t2020-06-11 Martin Liska <mliska@suse.cz>' in entry
assert '\t\t Jakub Jelinek <jakub@redhat.com>' in entry
def test_square_and_lt_gt(self):
email = self.from_patch_glob('0001-Check-for-more-missing')
assert not email.errors

File diff suppressed because it is too large Load Diff

View File

@ -25,6 +25,11 @@ git config alias.svn-rev '!f() { rev=$1; shift; git log --all --grep="^From-SVN:
git config alias.gcc-descr \!"f() { if test \${1:-no} = --full; then c=\${2:-master}; r=\$(git describe --all --abbrev=40 --match 'basepoints/gcc-[0-9]*' \$c | sed -n 's,^\\(tags/\\)\\?basepoints/gcc-,r,p'); expr match \${r:-no} '^r[0-9]\\+\$' >/dev/null && r=\${r}-0-g\$(git rev-parse \${2:-master}); else c=\${1:-master}; r=\$(git describe --all --match 'basepoints/gcc-[0-9]*' \$c | sed -n 's,^\\(tags/\\)\\?basepoints/gcc-\\([0-9]\\+\\)-\\([0-9]\\+\\)-g[0-9a-f]*\$,r\\2-\\3,p;s,^\\(tags/\\)\\?basepoints/gcc-\\([0-9]\\+\\)\$,r\\2-0,p'); fi; if test -n \$r; then o=\$(git config --get gcc-config.upstream); rr=\$(echo \$r | sed -n 's,^r\\([0-9]\\+\\)-[0-9]\\+\\(-g[0-9a-f]\\+\\)\\?\$,\\1,p'); if git rev-parse --verify --quiet \${o:-origin}/releases/gcc-\$rr >/dev/null; then m=releases/gcc-\$rr; else m=master; fi; git merge-base --is-ancestor \$c \${o:-origin}/\$m && \echo \${r}; fi; }; f"
git config alias.gcc-undescr \!"f() { o=\$(git config --get gcc-config.upstream); r=\$(echo \$1 | sed -n 's,^r\\([0-9]\\+\\)-[0-9]\\+\$,\\1,p'); n=\$(echo \$1 | sed -n 's,^r[0-9]\\+-\\([0-9]\\+\\)\$,\\1,p'); test -z \$r && echo Invalid id \$1 && exit 1; h=\$(git rev-parse --verify --quiet \${o:-origin}/releases/gcc-\$r); test -z \$h && h=\$(git rev-parse --verify --quiet \${o:-origin}/master); p=\$(git describe --all --match 'basepoints/gcc-'\$r \$h | sed -n 's,^\\(tags/\\)\\?basepoints/gcc-[0-9]\\+-\\([0-9]\\+\\)-g[0-9a-f]*\$,\\2,p;s,^\\(tags/\\)\\?basepoints/gcc-[0-9]\\+\$,0,p'); git rev-parse --verify \$h~\$(expr \$p - \$n); }; f"
git config alias.gcc-verify '!f() { "`git rev-parse --show-toplevel`/contrib/gcc-changelog/git_check_commit.py" $@; } ; f'
git config alias.gcc-backport '!f() { "`git rev-parse --show-toplevel`/contrib/git-backport.py" $@; } ; f'
git config alias.gcc-mklog '!f() { "`git rev-parse --show-toplevel`/contrib/mklog.py" $@; } ; f'
git config alias.gcc-commit-mklog '!f() { GCC_FORCE_MKLOG=1 git commit "$@"; }; f'
# Make diff on MD files use "(define" as a function marker.
# Use this in conjunction with a .gitattributes file containing
# *.md diff=md
@ -122,6 +127,17 @@ echo "(local branches starting <prefix>/ can be pushed directly to your"
ask "personal area on the gcc server)" $old_pfx new_pfx
git config "gcc-config.userpfx" "$new_pfx"
echo
ask "Install prepare-commit-msg git hook for 'git commit-mklog' alias" yes dohook
if [ "x$dohook" = xyes ]; then
hookdir=`git rev-parse --git-path hooks`
if [ -f "$hookdir/prepare-commit-msg" ]; then
echo " Moving existing prepare-commit-msg hook to prepare-commit-msg.bak"
mv "$hookdir/prepare-commit-msg" "$hookdir/prepare-commit-msg.bak"
fi
install -c "`git rev-parse --show-toplevel`/contrib/prepare-commit-msg" "$hookdir"
fi
# Scan the existing settings to see if there are any we need to rewrite.
vendors=$(git config --get-all "remote.${upstream}.fetch" "refs/vendors/" | sed -r "s:.*refs/vendors/([^/]+)/.*:\1:" | sort | uniq)
url=$(git config --get "remote.${upstream}.url")

65
contrib/git-backport.py Executable file
View File

@ -0,0 +1,65 @@
#!/usr/bin/env python3
# Copyright (C) 2020 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 COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
import argparse
import subprocess
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Backport a git revision and '
'stash all ChangeLog files.')
parser.add_argument('revision', help='Revision')
args = parser.parse_args()
r = subprocess.run('git cherry-pick -x %s' % args.revision, shell=True)
if r.returncode == 0:
cmd = 'git show --name-only --pretty="" -- "*ChangeLog"'
changelogs = subprocess.check_output(cmd, shell=True, encoding='utf8')
changelogs = changelogs.strip()
if changelogs:
for changelog in changelogs.split('\n'):
subprocess.check_output('git checkout HEAD~ %s' % changelog,
shell=True)
subprocess.check_output('git commit --amend --no-edit', shell=True)
else:
# 1) remove all ChangeLog files from conflicts
out = subprocess.check_output('git diff --name-only --diff-filter=U',
shell=True,
encoding='utf8')
conflicts = out.strip().split('\n')
changelogs = [c for c in conflicts if c.endswith('ChangeLog')]
if changelogs:
cmd = 'git checkout --theirs %s' % ' '.join(changelogs)
subprocess.check_output(cmd, shell=True)
# 2) remove all ChangeLog files from index
cmd = 'git diff --name-only --diff-filter=M HEAD'
out = subprocess.check_output(cmd, shell=True, encoding='utf8')
out = out.strip().split('\n')
modified = [c for c in out if c.endswith('ChangeLog')]
for m in modified:
subprocess.check_output('git reset %s' % m, shell=True)
subprocess.check_output('git checkout %s' % m, shell=True)
# try to continue
if len(conflicts) == len(changelogs):
cmd = 'git -c core.editor=true cherry-pick --continue'
subprocess.check_output(cmd, shell=True)
else:
print('Please resolve all remaining file conflicts.')

261
contrib/mklog.py Executable file
View File

@ -0,0 +1,261 @@
#!/usr/bin/env python3
# Copyright (C) 2020 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 COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
# This script parses a .diff file generated with 'diff -up' or 'diff -cp'
# and adds a skeleton ChangeLog file to the file. It does not try to be
# too smart when parsing function names, but it produces a reasonable
# approximation.
#
# Author: Martin Liska <mliska@suse.cz>
import argparse
import os
import re
import sys
from itertools import takewhile
import requests
from unidiff import PatchSet
pr_regex = re.compile(r'(\/(\/|\*)|[Cc*!])\s+(?P<pr>PR [a-z+-]+\/[0-9]+)')
dr_regex = re.compile(r'(\/(\/|\*)|[Cc*!])\s+(?P<dr>DR [0-9]+)')
identifier_regex = re.compile(r'^([a-zA-Z0-9_#].*)')
comment_regex = re.compile(r'^\/\*')
struct_regex = re.compile(r'^(class|struct|union|enum)\s+'
r'(GTY\(.*\)\s+)?([a-zA-Z0-9_]+)')
macro_regex = re.compile(r'#\s*(define|undef)\s+([a-zA-Z0-9_]+)')
super_macro_regex = re.compile(r'^DEF[A-Z0-9_]+\s*\(([a-zA-Z0-9_]+)')
fn_regex = re.compile(r'([a-zA-Z_][^()\s]*)\s*\([^*]')
template_and_param_regex = re.compile(r'<[^<>]*>')
bugzilla_url = 'https://gcc.gnu.org/bugzilla/rest.cgi/bug?id=%s&' \
'include_fields=summary'
function_extensions = set(['.c', '.cpp', '.C', '.cc', '.h', '.inc', '.def'])
help_message = """\
Generate ChangeLog template for PATCH.
PATCH must be generated using diff(1)'s -up or -cp options
(or their equivalent in git).
"""
script_folder = os.path.realpath(__file__)
gcc_root = os.path.dirname(os.path.dirname(script_folder))
def find_changelog(path):
folder = os.path.split(path)[0]
while True:
if os.path.exists(os.path.join(gcc_root, folder, 'ChangeLog')):
return folder
folder = os.path.dirname(folder)
if folder == '':
return folder
raise AssertionError()
def extract_function_name(line):
if comment_regex.match(line):
return None
m = struct_regex.search(line)
if m:
# Struct declaration
return m.group(1) + ' ' + m.group(3)
m = macro_regex.search(line)
if m:
# Macro definition
return m.group(2)
m = super_macro_regex.search(line)
if m:
# Supermacro
return m.group(1)
m = fn_regex.search(line)
if m:
# Discard template and function parameters.
fn = m.group(1)
fn = re.sub(template_and_param_regex, '', fn)
return fn.rstrip()
return None
def try_add_function(functions, line):
fn = extract_function_name(line)
if fn and fn not in functions:
functions.append(fn)
return bool(fn)
def sort_changelog_files(changed_file):
return (changed_file.is_added_file, changed_file.is_removed_file)
def get_pr_titles(prs):
output = ''
for pr in prs:
id = pr.split('/')[-1]
r = requests.get(bugzilla_url % id)
bugs = r.json()['bugs']
if len(bugs) == 1:
output += '%s - %s\n' % (pr, bugs[0]['summary'])
print(output)
if output:
output += '\n'
return output
def generate_changelog(data, no_functions=False, fill_pr_titles=False):
changelogs = {}
changelog_list = []
prs = []
out = ''
diff = PatchSet(data)
for file in diff:
changelog = find_changelog(file.path)
if changelog not in changelogs:
changelogs[changelog] = []
changelog_list.append(changelog)
changelogs[changelog].append(file)
# Extract PR entries from newly added tests
if 'testsuite' in file.path and file.is_added_file:
for line in list(file)[0]:
m = pr_regex.search(line.value)
if m:
pr = m.group('pr')
if pr not in prs:
prs.append(pr)
else:
m = dr_regex.search(line.value)
if m:
dr = m.group('dr')
if dr not in prs:
prs.append(dr)
else:
break
if fill_pr_titles:
out += get_pr_titles(prs)
# sort ChangeLog so that 'testsuite' is at the end
for changelog in sorted(changelog_list, key=lambda x: 'testsuite' in x):
files = changelogs[changelog]
out += '%s:\n' % os.path.join(changelog, 'ChangeLog')
out += '\n'
for pr in prs:
out += '\t%s\n' % pr
# new and deleted files should be at the end
for file in sorted(files, key=sort_changelog_files):
assert file.path.startswith(changelog)
in_tests = 'testsuite' in changelog or 'testsuite' in file.path
relative_path = file.path[len(changelog):].lstrip('/')
functions = []
if file.is_added_file:
msg = 'New test' if in_tests else 'New file'
out += '\t* %s: %s.\n' % (relative_path, msg)
elif file.is_removed_file:
out += '\t* %s: Removed.\n' % (relative_path)
elif hasattr(file, 'is_rename') and file.is_rename:
out += '\t* %s: Moved to...\n' % (relative_path)
new_path = file.target_file[2:]
# A file can be theoretically moved to a location that
# belongs to a different ChangeLog. Let user fix it.
if new_path.startswith(changelog):
new_path = new_path[len(changelog):].lstrip('/')
out += '\t* %s: ...here.\n' % (new_path)
else:
if not no_functions:
for hunk in file:
# Do not add function names for testsuite files
extension = os.path.splitext(relative_path)[1]
if not in_tests and extension in function_extensions:
last_fn = None
modified_visited = False
success = False
for line in hunk:
m = identifier_regex.match(line.value)
if line.is_added or line.is_removed:
if not line.value.strip():
continue
modified_visited = True
if m and try_add_function(functions,
m.group(1)):
last_fn = None
success = True
elif line.is_context:
if last_fn and modified_visited:
try_add_function(functions, last_fn)
last_fn = None
modified_visited = False
success = True
elif m:
last_fn = m.group(1)
modified_visited = False
if not success:
try_add_function(functions,
hunk.section_header)
if functions:
out += '\t* %s (%s):\n' % (relative_path, functions[0])
for fn in functions[1:]:
out += '\t(%s):\n' % fn
else:
out += '\t* %s:\n' % relative_path
out += '\n'
return out
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=help_message)
parser.add_argument('input', nargs='?',
help='Patch file (or missing, read standard input)')
parser.add_argument('-s', '--no-functions', action='store_true',
help='Do not generate function names in ChangeLogs')
parser.add_argument('-p', '--fill-up-bug-titles', action='store_true',
help='Download title of mentioned PRs')
parser.add_argument('-c', '--changelog',
help='Append the ChangeLog to a git commit message '
'file')
args = parser.parse_args()
if args.input == '-':
args.input = None
input = open(args.input) if args.input else sys.stdin
data = input.read()
output = generate_changelog(data, args.no_functions,
args.fill_up_bug_titles)
if args.changelog:
lines = open(args.changelog).read().split('\n')
start = list(takewhile(lambda l: not l.startswith('#'), lines))
end = lines[len(start):]
with open(args.changelog, 'w') as f:
if start:
# appent empty line
if start[-1] != '':
start.append('')
else:
# append 2 empty lines
start = 2 * ['']
f.write('\n'.join(start))
f.write('\n')
f.write(output)
f.write('\n'.join(end))
else:
print(output, end='')

81
contrib/prepare-commit-msg Executable file
View File

@ -0,0 +1,81 @@
#!/bin/sh
# Copyright (C) 2020 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 COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
COMMIT_MSG_FILE=$1
COMMIT_SOURCE=$2
SHA1=$3
# We might be on a branch before the file was added.
if ! [ -x contrib/mklog.py ]; then exit 0; fi
# Can't do anything if $COMMIT_MSG_FILE isn't a file.
if ! [ -f "$COMMIT_MSG_FILE" ]; then exit 0; fi
# Don't do anything unless requested to.
if [ -z "$GCC_FORCE_MKLOG" ]; then exit 0; fi
if [ -z "$COMMIT_SOURCE" ] || [ $COMMIT_SOURCE = template ]; then
# No source or "template" means new commit.
cmd="diff --cached"
elif [ $COMMIT_SOURCE = message ]; then
# "message" means -m; assume a new commit if there are any changes staged.
if ! git diff --cached --quiet; then
cmd="diff --cached"
else
cmd="diff --cached HEAD^"
fi
elif [ $COMMIT_SOURCE = commit ]; then
# The message of an existing commit. If it's HEAD, assume --amend;
# otherwise, assume a new commit with -C.
if [ $SHA1 = HEAD ]; then
cmd="diff --cached HEAD^"
if [ "$(git config gcc-config.mklog-hook-type)" = "smart-amend" ]; then
# Check if the existing message still describes the staged changes.
f=$(mktemp /tmp/git-commit.XXXXXX) || exit 1
git log -1 --pretty=email HEAD > $f
printf '\n---\n\n' >> $f
git $cmd >> $f
if contrib/gcc-changelog/git_email.py "$f" >/dev/null 2>&1; then
# Existing commit message is still OK for amended commit.
rm $f
exit 0
fi
rm $f
fi
else
cmd="diff --cached"
fi
else
# Do nothing for merge or squash.
exit 0
fi
# Save diff to a file if requested.
DIFF_FILE=$(git config gcc-config.diff-file)
if ! [ -z "$DIFF_FILE" ]; then
tee="tee $DIFF_FILE"
else
tee="cat"
fi
git $cmd | $tee | git gcc-mklog -c "$COMMIT_MSG_FILE"

439
contrib/test_mklog.py Executable file
View File

@ -0,0 +1,439 @@
#!/usr/bin/env python3
# Copyright (C) 2020 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 COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
# This script parses a .diff file generated with 'diff -up' or 'diff -cp'
# and adds a skeleton ChangeLog file to the file. It does not try to be
# too smart when parsing function names, but it produces a reasonable
# approximation.
#
# Author: Martin Liska <mliska@suse.cz>
import unittest
from mklog import generate_changelog
import unidiff
unidiff_supports_renaming = hasattr(unidiff.PatchedFile(), 'is_rename')
PATCH1 = '''\
diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h
index 567c23380fe..e6209ede9d6 100644
--- a/gcc/config/riscv/riscv.h
+++ b/gcc/config/riscv/riscv.h
@@ -920,6 +920,7 @@ extern unsigned riscv_stack_boundary;
#define SHIFT_RS1 15
#define SHIFT_IMM 20
#define IMM_BITS 12
+#define C_S_BITS 5
#define C_SxSP_BITS 6
#define IMM_REACH (1LL << IMM_BITS)
@@ -929,6 +930,10 @@ extern unsigned riscv_stack_boundary;
#define SWSP_REACH (4LL << C_SxSP_BITS)
#define SDSP_REACH (8LL << C_SxSP_BITS)
+/* This is the maximum value that can be represented in a compressed load/store
+ offset (an unsigned 5-bit value scaled by 4). */
+#define CSW_MAX_OFFSET ((4LL << C_S_BITS) - 1) & ~3
+
/* Called from RISCV_REORG, this is defined in riscv-sr.c. */
extern void riscv_remove_unneeded_save_restore_calls (void);
'''
EXPECTED1 = '''\
gcc/ChangeLog:
* config/riscv/riscv.h (C_S_BITS):
(CSW_MAX_OFFSET):
'''
PATCH2 = '''\
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index 9704d23f1db..b572a36e8cf 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -120,7 +120,7 @@ extern bool default_empty_mask_is_expensive (unsigned);
extern void *default_init_cost (class loop *);
extern unsigned default_add_stmt_cost (class vec_info *, void *, int,
enum vect_cost_for_stmt,
- class _stmt_vec_info *, int,
+ class _stmt_vec_info *, tree, int,
enum vect_cost_model_location);
extern void default_finish_cost (void *, unsigned *, unsigned *, unsigned *);
extern void default_destroy_cost_data (void *);
@@ -186,6 +186,7 @@ extern tree default_emutls_var_init (tree, tree, tree);
extern unsigned int default_hard_regno_nregs (unsigned int, machine_mode);
extern bool default_hard_regno_scratch_ok (unsigned int);
extern bool default_mode_dependent_address_p (const_rtx, addr_space_t);
+extern bool default_new_address_profitable_p (rtx, rtx_insn *, rtx);
extern bool default_target_option_valid_attribute_p (tree, tree, tree, int);
extern bool default_target_option_pragma_parse (tree, tree);
extern bool default_target_can_inline_p (tree, tree);
'''
EXPECTED2 = '''\
gcc/ChangeLog:
* targhooks.h (default_add_stmt_cost):
(default_new_address_profitable_p):
'''
PATCH3 = '''\
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index 2b1e33f94ae..7f47402f9b9 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -173,7 +173,7 @@ enum c_lang {CLK_GNUC89 = 0, CLK_GNUC99, CLK_GNUC11, CLK_GNUC17, CLK_GNUC2X,
CLK_STDC2X,
CLK_GNUCXX, CLK_CXX98, CLK_GNUCXX11, CLK_CXX11,
CLK_GNUCXX14, CLK_CXX14, CLK_GNUCXX17, CLK_CXX17,
- CLK_GNUCXX2A, CLK_CXX2A, CLK_ASM};
+ CLK_GNUCXX20, CLK_CXX20, CLK_ASM};
/* Payload of a NUMBER, STRING, CHAR or COMMENT token. */
struct GTY(()) cpp_string {
@@ -484,7 +484,7 @@ struct cpp_options
/* Nonzero for C2X decimal floating-point constants. */
unsigned char dfp_constants;
- /* Nonzero for C++2a __VA_OPT__ feature. */
+ /* Nonzero for C++20 __VA_OPT__ feature. */
unsigned char va_opt;
/* Nonzero for the '::' token. */
'''
EXPECTED3 = '''\
libcpp/ChangeLog:
* include/cpplib.h (enum c_lang):
(struct cpp_options):
'''
EXPECTED3B = '''\
libcpp/ChangeLog:
* include/cpplib.h:
'''
PATCH4 = '''\
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index aab79492357..f0df1002488 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -1,5 +1,7 @@
+
+
/* Interprocedural Identical Code Folding pass
Copyright (C) 2014-2020 Free Software Foundation, Inc.
diff --git a/gcc/testsuite/gcc.dg/pr32374.c b/gcc/testsuite/gcc.dg/pr32374.c
deleted file mode 100644
index de15d559f5b..00000000000
--- a/gcc/testsuite/gcc.dg/pr32374.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O2" } */
-
-extern int *stderr;
-
-void f (int *, const char *, ...);
-
-void g (const char *conf_name)
-{
- typedef struct
- {
- const char *label;
- const int value;
- } Section;
-
- const Section sections[2] = { {"", 0}, {"", 1} };
-
- f (stderr, "", "", conf_name, 0, sections[0]);
- f (stderr, "", "", conf_name, 0, sections[0]);
-}
diff --git a/gcc/testsuite/gcc.dg/pr40209.c b/gcc/testsuite/gcc.dg/pr40209.c
index 4e77df5c2e6..c23d69d1f1b 100644
--- a/gcc/testsuite/gcc.dg/pr40209.c
+++ b/gcc/testsuite/gcc.dg/pr40209.c
@@ -1,6 +1,8 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fprofile-use -fopt-info -Wno-missing-profile" } */
+
+
void process(const char *s);
struct BaseHolder {
diff --git a/gcc/testsuite/gcc.dg/pr50209.c b/gcc/testsuite/gcc.dg/pr50209.c
new file mode 100644
index 00000000000..b28b04f6431
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr50209.c
@@ -0,0 +1,3 @@
+
+
+
diff --git a/gcc/testsuite/gcc.dg/pr63567-1.c b/gcc/testsuite/gcc.dg/pr63567-1.c
index 97da171563e..00c5ecc11fa 100644
--- a/gcc/testsuite/gcc.dg/pr63567-1.c
+++ b/gcc/testsuite/gcc.dg/pr63567-1.c
@@ -1,3 +1,4 @@
+
/* PR c/63567 */
/* { dg-do compile } */
/* { dg-options "" } */
diff --git a/gcc/varasm.c b/gcc/varasm.c
index f062e48071f..fd3c7ca8cf3 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1,3 +1,5 @@
+
+
/* Output variables, constants and external declarations, for GNU compiler.
Copyright (C) 1987-2020 Free Software Foundation, Inc.
diff --git a/libssp/gets-chk.c b/libssp/gets-chk.c
index 4ad78c1f77b..6687b368038 100644
--- a/libssp/gets-chk.c
+++ b/libssp/gets-chk.c
@@ -32,6 +32,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
<http://www.gnu.org/licenses/>. */
+
+
#include "config.h"
#include <ssp/ssp.h>
#include <stdarg.h>
'''
EXPECTED4 = '''\
gcc/ChangeLog:
* ipa-icf.c:
* varasm.c:
libssp/ChangeLog:
* gets-chk.c:
gcc/testsuite/ChangeLog:
* gcc.dg/pr40209.c:
* gcc.dg/pr63567-1.c:
* gcc.dg/pr32374.c: Removed.
* gcc.dg/pr50209.c: New test.
'''
PATCH5 = '''\
diff --git a/gcc/testsuite/gcc.target/i386/pr95046-6.c b/gcc/testsuite/gcc.target/i386/pr95046-6.c
new file mode 100644
index 00000000000..dcc8999c446
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr95046-6.c
@@ -0,0 +1,44 @@
+/* PR target/95046 */
+/* { dg-do compile { target { ! ia32 } } } */
+/* { dg-options "-O3 -mavx512vl" } */
+
+
+double r[2];
+int s[2];
+unsigned int u[2];
+
+void
+test_float (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = s[i];
+}
+
+/* { dg-final { scan-assembler "\tvcvtdq2pd" } } */
+
+void
+test_ufloat (void)
+{
+ for (int i = 0; i < 2; i++)
+ r[i] = u[i];
+}
+
+/* { dg-final { scan-assembler "\tvcvtudq2pd" } } */
+
+void
+test_fix (void)
+{
+ for (int i = 0; i < 2; i++)
+ s[i] = r[i];
+}
+
+/* { dg-final { scan-assembler "\tvcvttpd2dqx" } } */
+
+void
+test_ufix (void)
+{
+ for (int i = 0; i < 2; i++)
+ u[i] = r[i];
+}
+
+/* { dg-final { scan-assembler "\tvcvttpd2udqx" } } */
--
2.26.2
'''
EXPECTED5 = '''\
PR target/95046 - Vectorize V2SFmode operations
gcc/testsuite/ChangeLog:
PR target/95046
* gcc.target/i386/pr95046-6.c: New test.
'''
PATCH6 = '''\
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index 5ddeb65269b..cfae6e91da9 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -937,7 +937,8 @@ struct GTY((tag ("SYMTAB_FUNCTION"))) cgraph_node : public symtab_node
split_part (false), indirect_call_target (false), local (false),
versionable (false), can_change_signature (false),
redefined_extern_inline (false), tm_may_enter_irr (false),
- ipcp_clone (false), m_uid (uid), m_summary_id (-1)
+ ipcp_clone (false), declare_variant_alt (false),
+ calls_declare_variant_alt (false), m_uid (uid), m_summary_id (-1)
{}
/* Remove the node from cgraph and all inline clones inlined into it.
'''
EXPECTED6 = '''\
gcc/ChangeLog:
* cgraph.h (struct cgraph_node):
'''
PATCH7 = '''\
diff --git a/gcc/testsuite/g++.dg/DRs/dr2237.C b/gcc/testsuite/g++.dg/DRs/dr2237.C
new file mode 100644
index 00000000000..f3d6d11e61e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/DRs/dr2237.C
@@ -0,0 +1,18 @@
+// DR 2237 - Can a template-id name a constructor?
+
+template<class T>
+struct X {
+ X<T>(); // { dg-error "expected" "" { target c++20 } }
+ X(int); // OK, injected-class-name used
+ ~X<T>(); // { dg-error "template-id not allowed for destructor" "" { target c++20 } }
+};
+
+// ill-formed since DR1435
+template<typename T> X<T>::X<T>() {} // { dg-error "names the constructor|as no template constructors" }
+template<typename T> X<T>::~X<T>() {} // { dg-error "template-id not allowed for destructor" "" { target c++20 } }
+
+struct Q {
+ // ill-formed since DR1435
+ template<typename T> friend X<T>::X<T>(); // { dg-error "names the constructor|as no template constructors" }
+ template<typename T> friend X<T>::~X<T>(); // { dg-error "template-id not allowed for destructor" "" { target c++20 } }
+};
'''
EXPECTED7 = '''\
gcc/testsuite/ChangeLog:
DR 2237
* g++.dg/DRs/dr2237.C: New test.
'''
PATCH8 = '''\
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf2.c
similarity index 100%
rename from gcc/ipa-icf.c
rename to gcc/ipa-icf2.c
'''
EXPECTED8 = '''\
gcc/ChangeLog:
* ipa-icf.c: Moved to...
* ipa-icf2.c: ...here.
'''
class TestMklog(unittest.TestCase):
def test_macro_definition(self):
changelog = generate_changelog(PATCH1)
assert changelog == EXPECTED1
def test_changed_argument(self):
changelog = generate_changelog(PATCH2)
assert changelog == EXPECTED2
def test_enum_and_struct(self):
changelog = generate_changelog(PATCH3)
assert changelog == EXPECTED3
def test_no_function(self):
changelog = generate_changelog(PATCH3, True)
assert changelog == EXPECTED3B
def test_sorting(self):
changelog = generate_changelog(PATCH4)
assert changelog == EXPECTED4
def test_pr_bugzilla_download(self):
changelog = generate_changelog(PATCH5, fill_pr_titles=True)
assert changelog == EXPECTED5
def test_gty_in_struct(self):
changelog = generate_changelog(PATCH6, fill_pr_titles=True)
assert changelog == EXPECTED6
def test_dr_detection_in_test_case(self):
changelog = generate_changelog(PATCH7)
assert changelog == EXPECTED7
@unittest.skipIf(not unidiff_supports_renaming,
'Newer version of unidiff is needed (0.6.0+)')
def test_renaming(self):
changelog = generate_changelog(PATCH8)
assert changelog == EXPECTED8

View File

@ -39,9 +39,13 @@ function! SetStyle()
setlocal shiftwidth=2
setlocal noexpandtab
endif
setlocal textwidth=80
if &filetype == "gitcommit"
setlocal textwidth=72
else
setlocal textwidth=80
endif
setlocal formatoptions-=ro formatoptions+=cqlt
if index(l:c_exts, l:ext) != -1
if index(l:c_exts, l:ext) != -1 || &filetype == "c" || &filetype == "cpp"
setlocal cindent
setlocal cinoptions=>4,n-2,{2,^-2,:2,=2,g0,f0,h2,p4,t0,+2,(0,u0,w1,m0
endif

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
20200505
20200817

View File

@ -262,6 +262,10 @@ LINKER = $(CC)
LINKER_FLAGS = $(CFLAGS)
endif
# Enable Intel CET on Intel CET enabled host if needed.
CET_HOST_FLAGS = @CET_HOST_FLAGS@
COMPILER += $(CET_HOST_FLAGS)
NO_PIE_CFLAGS = @NO_PIE_CFLAGS@
NO_PIE_FLAG = @NO_PIE_FLAG@
@ -929,8 +933,7 @@ FIXED_VALUE_H = fixed-value.h
RTL_H = $(RTL_BASE_H) $(FLAGS_H) genrtl.h
READ_MD_H = $(OBSTACK_H) $(HASHTAB_H) read-md.h
BUILTINS_DEF = builtins.def sync-builtins.def omp-builtins.def \
gtm-builtins.def sanitizer.def \
hsa-builtins.def
gtm-builtins.def sanitizer.def
INTERNAL_FN_DEF = internal-fn.def
INTERNAL_FN_H = internal-fn.h $(INTERNAL_FN_DEF)
TREE_CORE_H = tree-core.h $(CORETYPES_H) all-tree.def tree.def \
@ -1042,10 +1045,12 @@ ALL_LINKERFLAGS = $(ALL_CXXFLAGS)
# Build and host support libraries.
# Use the "pic" build of libiberty if --enable-host-shared.
# Use the "pic" build of libiberty if --enable-host-shared, unless we are
# building for mingw.
LIBIBERTY_PICDIR=$(if $(findstring mingw,$(target)),,pic)
ifeq ($(enable_host_shared),yes)
LIBIBERTY = ../libiberty/pic/libiberty.a
BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/pic/libiberty.a
LIBIBERTY = ../libiberty/$(LIBIBERTY_PICDIR)/libiberty.a
BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/$(LIBIBERTY_PICDIR)/libiberty.a
else
LIBIBERTY = ../libiberty/libiberty.a
BUILD_LIBIBERTY = $(build_libobjdir)/libiberty/libiberty.a
@ -1075,7 +1080,8 @@ GNATMAKE = @GNATMAKE@
# Libs needed (at present) just for jcf-dump.
LDEXP_LIB = @LDEXP_LIB@
ZSTD_LIB = @ZSTD_LIB@
ZSTD_INC = @ZSTD_CPPFLAGS@
ZSTD_LIB = @ZSTD_LDFLAGS@ @ZSTD_LIB@
# Likewise, for use in the tools that must run on this machine
# even if we are cross-building GCC.
@ -1231,7 +1237,11 @@ ANALYZER_OBJS = \
analyzer/pending-diagnostic.o \
analyzer/program-point.o \
analyzer/program-state.o \
analyzer/region.o \
analyzer/region-model.o \
analyzer/region-model-impl-calls.o \
analyzer/region-model-manager.o \
analyzer/region-model-reachability.o \
analyzer/sm.o \
analyzer/sm-file.o \
analyzer/sm-malloc.o \
@ -1240,7 +1250,9 @@ ANALYZER_OBJS = \
analyzer/sm-signal.o \
analyzer/sm-taint.o \
analyzer/state-purge.o \
analyzer/supergraph.o
analyzer/store.o \
analyzer/supergraph.o \
analyzer/svalue.o
# Language-independent object files.
# We put the *-match.o and insn-*.o files first so that a parallel make
@ -1263,6 +1275,7 @@ OBJS = \
insn-recog.o \
insn-enums.o \
ggc-page.o \
adjust-alignment.o \
alias.o \
alloc-pool.o \
auto-inc-dec.o \
@ -1345,6 +1358,7 @@ OBJS = \
ggc-common.o \
ggc-tests.o \
gimple.o \
gimple-array-bounds.o \
gimple-builder.o \
gimple-expr.o \
gimple-iterator.o \
@ -1386,11 +1400,6 @@ OBJS = \
haifa-sched.o \
hash-map-tests.o \
hash-set-tests.o \
hsa-common.o \
hsa-gen.o \
hsa-regalloc.o \
hsa-brig.o \
hsa-dump.o \
hw-doloop.o \
hwint.o \
ifcvt.o \
@ -1418,7 +1427,6 @@ OBJS = \
ipa-icf.o \
ipa-icf-gimple.o \
ipa-reference.o \
ipa-hsa.o \
ipa-ref.o \
ipa-utils.o \
ipa.o \
@ -1464,7 +1472,6 @@ OBJS = \
omp-offload.o \
omp-expand.o \
omp-general.o \
omp-grid.o \
omp-low.o \
omp-simd-clone.o \
opt-problem.o \
@ -1624,6 +1631,7 @@ OBJS = \
tree-streamer-out.o \
tree-tailcall.o \
tree-vect-generic.o \
gimple-isel.o \
tree-vect-patterns.o \
tree-vect-data-refs.o \
tree-vect-stmts.o \
@ -1639,6 +1647,7 @@ OBJS = \
unique-ptr-tests.o \
valtrack.o \
value-range.o \
value-range-equiv.o \
value-prof.o \
var-tracking.o \
varasm.o \
@ -1723,11 +1732,15 @@ MOSTLYCLEANFILES = insn-flags.h insn-config.h insn-codes.h \
# This symlink makes the full installation name of the driver be available
# from within the *build* directory, for use when running the JIT library
# from there (e.g. when running its testsuite).
$(FULL_DRIVER_NAME): ./xgcc
$(FULL_DRIVER_NAME): ./xgcc$(exeext)
rm -f $@
$(LN_S) $< $@
#
# SELFTEST_DEPS need to be set before including language makefile fragments.
# Otherwise $(SELFTEST_DEPS) is empty when used from <LANG>/Make-lang.in.
SELFTEST_DEPS = $(GCC_PASSES) stmp-int-hdrs $(srcdir)/testsuite/selftests
# Language makefile fragments.
# The following targets define the interface between us and the languages.
@ -1750,22 +1763,16 @@ $(FULL_DRIVER_NAME): ./xgcc
gnat_install_lib = @gnat_install_lib@
# per-language makefile fragments
ifneq ($(LANG_MAKEFRAGS),)
include $(LANG_MAKEFRAGS)
endif
-include $(LANG_MAKEFRAGS)
# target and host overrides must follow the per-language makefile fragments
# so they can override or augment language-specific variables
# target overrides
ifneq ($(tmake_file),)
include $(tmake_file)
endif
-include $(tmake_file)
# host overrides
ifneq ($(xmake_file),)
include $(xmake_file)
endif
-include $(xmake_file)
# all-tree.def includes all the tree.def files.
all-tree.def: s-alltree; @true
@ -2003,8 +2010,6 @@ DEVNULL=$(if $(findstring mingw,$(build)),nul,/dev/null)
SELFTEST_FLAGS = -nostdinc $(DEVNULL) -S -o $(DEVNULL) \
-fself-test=$(srcdir)/testsuite/selftests
SELFTEST_DEPS = $(GCC_PASSES) stmp-int-hdrs $(srcdir)/testsuite/selftests
# Run the selftests during the build once we have a driver and the frontend,
# so that self-test failures are caught as early as possible.
# Use "s-selftest-FE" to ensure that we only run the selftests if the
@ -2277,7 +2282,7 @@ CFLAGS-version.o += -DBASEVER=$(BASEVER_s) -DDATESTAMP=$(DATESTAMP_s) \
version.o: $(REVISION) $(DATESTAMP) $(BASEVER) $(DEVPHASE)
# lto-compress.o needs $(ZLIBINC) added to the include flags.
CFLAGS-lto-compress.o += $(ZLIBINC)
CFLAGS-lto-compress.o += $(ZLIBINC) $(ZSTD_INC)
CFLAGS-lto-streamer-in.o += -DTARGET_MACHINE=\"$(target_noncanonical)\"
@ -2590,6 +2595,7 @@ GTFILES = $(CPPLIB_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/dwarf2cfi.c \
$(srcdir)/dwarf2out.c \
$(srcdir)/tree-vect-generic.c \
$(srcdir)/gimple-isel.cc \
$(srcdir)/dojump.c $(srcdir)/emit-rtl.h \
$(srcdir)/emit-rtl.c $(srcdir)/except.h $(srcdir)/explow.c $(srcdir)/expr.c \
$(srcdir)/expr.h \
@ -2613,7 +2619,7 @@ GTFILES = $(CPPLIB_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/tree-profile.c $(srcdir)/tree-nested.c \
$(srcdir)/omp-offload.h \
$(srcdir)/omp-offload.c \
$(srcdir)/omp-expand.c \
$(srcdir)/omp-general.c \
$(srcdir)/omp-low.c \
$(srcdir)/targhooks.c $(out_file) $(srcdir)/passes.c $(srcdir)/cgraphunit.c \
$(srcdir)/cgraphclones.c \
@ -2621,13 +2627,13 @@ GTFILES = $(CPPLIB_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/tree-ssa-alias.h \
$(srcdir)/tree-ssanames.h \
$(srcdir)/tree-vrp.h \
$(srcdir)/value-range.h \
$(srcdir)/ipa-prop.h \
$(srcdir)/trans-mem.c \
$(srcdir)/lto-streamer.h \
$(srcdir)/target-globals.h \
$(srcdir)/ipa-predicate.h \
$(srcdir)/ipa-fnsummary.h \
$(srcdir)/value-range.h \
$(srcdir)/vtable-verify.c \
$(srcdir)/asan.c \
$(srcdir)/ubsan.c \
@ -2636,7 +2642,6 @@ GTFILES = $(CPPLIB_H) $(srcdir)/input.h $(srcdir)/coretypes.h \
$(srcdir)/sancov.c \
$(srcdir)/ipa-devirt.c \
$(srcdir)/internal-fn.h \
$(srcdir)/hsa-common.c \
$(srcdir)/calls.c \
$(srcdir)/omp-general.h \
@all_gtfiles@
@ -3494,7 +3499,6 @@ distclean: clean lang.distclean
-cd testsuite && rm -f x *.x *.x? *.exe *.rpo *.o *.s *.S *.c
-cd testsuite && rm -f *.out *.gcov *$(coverageexts)
-rm -rf ${QMTEST_DIR} stamp-qmtest
-rm -f cxxmain.c
-rm -f .gdbinit configargs.h
-rm -f gcov.pod
# Delete po/*.gmo only if we are not building in the source directory.
@ -4241,7 +4245,7 @@ TAGS: lang.tags
../include/*.h ../libiberty/*.c \
../libcpp/*.c ../libcpp/include/*.h \
--language=none --regex="/\(char\|unsigned int\|int\|bool\|void\|HOST_WIDE_INT\|enum [A-Za-z_0-9]+\) [*]?\([A-Za-z_0-9]+\)/\2/" common.opt \
--language=none --regex="/\(DEF_RTL_EXPR\|DEFTREECODE\|DEFGSCODE\|DEFTIMEVAR\|DEFPARAM\|DEFPARAMENUM5\)[ ]?(\([A-Za-z_0-9]+\)/\2/" rtl.def tree.def gimple.def timevar.def params.def \
--language=none --regex="/\(DEF_RTL_EXPR\|DEFTREECODE\|DEFGSCODE\|DEFTIMEVAR\|DEFPARAM\|DEFPARAMENUM5\)[ ]?(\([A-Za-z_0-9]+\)/\2/" rtl.def tree.def gimple.def timevar.def \
; \
etags --include TAGS.sub $$incs)

2
gcc/aclocal.m4 vendored
View File

@ -18,9 +18,11 @@ m4_include([../ltsugar.m4])
m4_include([../ltversion.m4])
m4_include([../lt~obsolete.m4])
m4_include([../config/acx.m4])
m4_include([../config/cet.m4])
m4_include([../config/codeset.m4])
m4_include([../config/depstand.m4])
m4_include([../config/dfp.m4])
m4_include([../config/enable.m4])
m4_include([../config/gcc-plugin.m4])
m4_include([../config/gettext-sister.m4])
m4_include([../config/iconv.m4])

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
# Makefile.rtl for GNU Ada Compiler (GNAT).
# Copyright (C) 2003-2017, Free Software Foundation, Inc.
# Copyright (C) 2003-2020, Free Software Foundation, Inc.
#This file is part of GCC.
@ -39,6 +39,7 @@ GNATRTL_TASKING_OBJS= \
a-sytaco$(objext) \
a-tasatt$(objext) \
a-taside$(objext) \
a-tasini$(objext) \
a-taster$(objext) \
g-boubuf$(objext) \
g-boumai$(objext) \
@ -52,6 +53,7 @@ GNATRTL_TASKING_OBJS= \
s-mudido$(objext) \
s-osinte$(objext) \
s-proinf$(objext) \
s-putaim$(objext) \
s-solita$(objext) \
s-stusta$(objext) \
s-taenca$(objext) \
@ -79,7 +81,7 @@ GNATRTL_TASKING_OBJS= \
thread$(objext) \
$(EXTRA_GNATRTL_TASKING_OBJS)
# Objects the require IEEE Float
# Objects that require IEEE Float
GNATRTL_ALTIVEC_OBJS= \
g-allein$(objext) \
g-alleve$(objext) \
@ -263,9 +265,18 @@ GNATRTL_NONTASKING_OBJS= \
a-stboha$(objext) \
a-stfiha$(objext) \
a-stmaco$(objext) \
a-stobbu$(objext) \
a-stobfi$(objext) \
a-storio$(objext) \
a-stoubu$(objext) \
a-stoufi$(objext) \
a-stoufo$(objext) \
a-stouut$(objext) \
a-strbou$(objext) \
a-stream$(objext) \
a-strsto$(objext) \
a-ststbo$(objext) \
a-ststun$(objext) \
a-strfix$(objext) \
a-strhas$(objext) \
a-string$(objext) \
@ -274,6 +285,7 @@ GNATRTL_NONTASKING_OBJS= \
a-strsup$(objext) \
a-strunb$(objext) \
a-ststio$(objext) \
a-stteou$(objext) \
a-stunau$(objext) \
a-stunha$(objext) \
a-stuten$(objext) \
@ -421,7 +433,6 @@ GNATRTL_NONTASKING_OBJS= \
g-excact$(objext) \
g-except$(objext) \
g-exctra$(objext) \
s-exctra$(objext) \
g-expect$(objext) \
g-exptty$(objext) \
g-flocon$(objext) \
@ -476,7 +487,6 @@ GNATRTL_NONTASKING_OBJS= \
g-timsta$(objext) \
g-traceb$(objext) \
g-trasym$(objext) \
s-trasym$(objext) \
g-tty$(objext) \
g-u3spch$(objext) \
g-utf_32$(objext) \
@ -498,13 +508,14 @@ GNATRTL_NONTASKING_OBJS= \
machcode$(objext) \
s-addima$(objext) \
s-addope$(objext) \
s-aoinar$(objext) \
s-aomoar$(objext) \
s-aotase$(objext) \
s-arit64$(objext) \
s-assert$(objext) \
s-atacco$(objext) \
s-atocou$(objext) \
s-atoope$(objext) \
s-atopar$(objext) \
s-atopex$(objext) \
s-atopri$(objext) \
s-auxdec$(objext) \
@ -539,7 +550,6 @@ GNATRTL_NONTASKING_OBJS= \
s-dfmkio$(objext) \
s-dfmopr$(objext) \
s-dgmgop$(objext) \
s-dlmopr$(objext) \
s-diflio$(objext) \
s-diflmk$(objext) \
s-digemk$(objext) \
@ -550,12 +560,14 @@ GNATRTL_NONTASKING_OBJS= \
s-dimmks$(objext) \
s-direio$(objext) \
s-dlmkio$(objext) \
s-dlmopr$(objext) \
s-dmotpr$(objext) \
s-dsaser$(objext) \
s-elaall$(objext) \
s-excdeb$(objext) \
s-except$(objext) \
s-exctab$(objext) \
s-exctra$(objext) \
s-exnint$(objext) \
s-exnllf$(objext) \
s-exnlli$(objext) \
@ -672,6 +684,7 @@ GNATRTL_NONTASKING_OBJS= \
s-poosiz$(objext) \
s-powtab$(objext) \
s-purexc$(objext) \
s-putima$(objext) \
s-rannum$(objext) \
s-ransee$(objext) \
s-regexp$(objext) \
@ -683,6 +696,7 @@ GNATRTL_NONTASKING_OBJS= \
s-scaval$(objext) \
s-secsta$(objext) \
s-sequio$(objext) \
s-shabig$(objext) \
s-shasto$(objext) \
s-soflin$(objext) \
s-soliin$(objext) \
@ -694,12 +708,14 @@ GNATRTL_NONTASKING_OBJS= \
s-stopoo$(objext) \
s-stposu$(objext) \
s-stratt$(objext) \
s-statxd$(objext) \
s-strhas$(objext) \
s-string$(objext) \
s-ststop$(objext) \
s-tasloc$(objext) \
s-traceb$(objext) \
s-traent$(objext) \
s-trasym$(objext) \
s-unstyp$(objext) \
s-utf_32$(objext) \
s-valboo$(objext) \
@ -818,13 +834,13 @@ ATOMICS_BUILTINS_TARGET_PAIRS = \
# Special version of units for x86 and x86-64 platforms.
X86_TARGET_PAIRS = \
a-numaux.ads<libgnat/a-numaux__x86.ads \
a-numaux.adb<libgnat/a-numaux__x86.adb \
a-numaux.ads<libgnat/a-numaux__libc-x86.ads \
a-numaux.adb<libgnat/a-numaux__dummy.adb \
s-atocou.adb<libgnat/s-atocou__x86.adb
X86_64_TARGET_PAIRS = \
a-numaux.ads<libgnat/a-numaux__x86.ads \
a-numaux.adb<libgnat/a-numaux__x86.adb \
a-numaux.ads<libgnat/a-numaux__libc-x86.ads \
a-numaux.adb<libgnat/a-numaux__dummy.adb \
s-atocou.adb<libgnat/s-atocou__builtin.adb
# Implementation of symbolic traceback based on dwarf
@ -1024,7 +1040,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworksae vxworksaespe,$(target_cpu) $(t
a-elchha.adb<libgnat/a-elchha__vxworks-ppc-full.adb \
a-intnam.ads<libgnarl/a-intnam__vxworks.ads \
a-numaux.ads<libgnat/a-numaux__vxworks.ads \
g-io.adb<hie/g-io__vxworks-ppc-cert.adb \
g-io.adb<hie/g-io__vxworks-cert.adb \
s-inmaop.adb<libgnarl/s-inmaop__vxworks.adb \
s-interr.adb<libgnarl/s-interr__vxworks.adb \
s-intman.ads<libgnarl/s-intman__vxworks.ads \
@ -1080,7 +1096,7 @@ ifeq ($(strip $(filter-out %86 wrs vxworksae,$(target_cpu) $(target_vendor) $(ta
a-elchha.adb<libgnat/a-elchha__vxworks-ppc-full.adb \
a-intnam.ads<libgnarl/a-intnam__vxworks.ads \
a-numaux.ads<libgnat/a-numaux__vxworks.ads \
g-io.adb<hie/g-io__vxworks-ppc-cert.adb \
g-io.adb<hie/g-io__vxworks-cert.adb \
s-inmaop.adb<libgnarl/s-inmaop__vxworks.adb \
s-interr.adb<libgnarl/s-interr__vxworks.adb \
s-intman.ads<libgnarl/s-intman__vxworks.ads \
@ -1632,8 +1648,8 @@ endif
ifeq ($(strip $(filter-out x86_64 kfreebsd%,$(target_cpu) $(target_os))),)
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<libgnarl/a-intnam__freebsd.ads \
a-numaux.adb<libgnat/a-numaux__x86.adb \
a-numaux.ads<libgnat/a-numaux__x86.ads \
a-numaux.ads<libgnat/a-numaux__libc-x86.ads \
a-numaux.adb<libgnat/a-numaux__dummy.adb \
s-inmaop.adb<libgnarl/s-inmaop__posix.adb \
s-intman.adb<libgnarl/s-intman__posix.adb \
s-osinte.adb<libgnarl/s-osinte__posix.adb \
@ -1895,7 +1911,6 @@ ifeq ($(strip $(filter-out lynxos178%,$(target_os))),)
endif
ifeq ($(strip $(filter-out %86, $(target_cpu))),)
LIBGNAT_TARGET_PAIRS += system.ads<libgnat/system-lynxos178-x86.ads
LIBGNAT_TARGET_PAIRS += $(X86_TARGET_PAIRS)
endif
ifeq ($(strip $(filter-out lynxos178e,$(target_os))),)
@ -2621,7 +2636,7 @@ LIBGNAT_OBJS = adadecode.o adaint.o argv.o aux-io.o \
LIBGNAT_SRCS = $(patsubst %.o,%.c,$(LIBGNAT_OBJS)) \
adadecode.h adaint.h env.h gsocket.h raise.h standard.ads.h \
tb-gcc.c runtime.h libgnarl/thread.c $(EXTRA_LIBGNAT_SRCS)
runtime.h $(EXTRA_LIBGNAT_SRCS)
# memtrack.o is special as not put into libgnat.
GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
@ -2634,7 +2649,8 @@ GNATRTL_OBJS = $(GNATRTL_NONTASKING_OBJS) $(GNATRTL_TASKING_OBJS) \
ADA_INCLUDE_SRCS =\
libgnat/ada.ads libgnat/calendar.ads libgnat/directio.ads libgnat/gnat.ads libgnat/interfac.ads libgnat/ioexcept.ads \
libgnat/machcode.ads libgnat/text_io.ads libgnat/unchconv.ads libgnat/unchdeal.ads \
libgnat/sequenio.ads libgnat/system.ads Makefile.adalib libgnat/memtrack.adb \
libgnat/sequenio.ads libgnat/system.ads libgnat/memtrack.adb \
libgna*/*.gpr \
libgnat/a-[a-o]*.adb libgnat/a-[a-o]*.ads \
libgnat/a-[p-z]*.adb libgnat/a-[p-z]*.ads \
libgnat/g-[a-o]*.adb libgnat/g-[a-o]*.ads \
@ -2680,7 +2696,7 @@ setup-rts: force
$(MKDIR) $(RTSDIR)
$(CHMOD) u+w $(RTSDIR)
# Copy target independent sources
$(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS), \
$(foreach f,$(ADA_INCLUDE_SRCS) $(LIBGNAT_SRCS) libgnarl/thread.c, \
$(LN_S) $(GNAT_SRC)/$(f) $(RTSDIR) ;) true
# Remove files not used
$(RM) $(patsubst %,$(RTSDIR)/%,$(ADA_EXCLUDE_FILES))
@ -2688,15 +2704,31 @@ setup-rts: force
$(RM) $(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
$(RTSDIR)/$(word 1,$(subst <, ,$(PAIR))))
for f in $(RTSDIR)/*-*__*.ads $(RTSDIR)/*-*__*.adb; do \
case "$$f" in \
$(RTSDIR)/s-stratt__*) ;; \
*) $(RM) $$f ;; \
esac; \
$(RM) $$f ; \
done
# Copy new target dependent sources
$(foreach PAIR,$(LIBGNAT_TARGET_PAIRS), \
$(LN_S) $(GNAT_SRC)/$(word 2,$(subst <, ,$(PAIR))) \
$(RTSDIR)/$(word 1,$(subst <, ,$(PAIR)));)
# And finally generate libgnat.lst and libgnarl.lst
@for f in \
$(foreach F,$(GNATRTL_TASKING_OBJS),$(subst $(objext),.ads,$(F))) \
$(foreach F,$(GNATRTL_TASKING_OBJS),$(subst $(objext),.adb,$(F))); \
do \
if [ -f $(RTSDIR)/$$f ]; then echo $$f >> $(RTSDIR)/libgnarl.lst; fi \
done
@echo thread.c >> $(RTSDIR)/libgnarl.lst
@for f in \
$(foreach F,$(GNATRTL_NONTASKING_OBJS),$(subst $(objext),.ads,$(F))) \
$(foreach F,$(GNATRTL_NONTASKING_OBJS),$(subst $(objext),.adb,$(F))); \
do \
if [ -f $(RTSDIR)/$$f ]; then echo $$f >> $(RTSDIR)/libgnat.lst; fi \
done
# s-oscons.ads is generated later, so hardcode it here
@echo s-oscons.ads >> $(RTSDIR)/libgnat.lst
@for f in $(LIBGNAT_SRCS); do \
echo $$f >> $(RTSDIR)/libgnat.lst; \
done
# Special flags. It is recommended not to change the compilation flags
# without a careful analysis of the consequences because (part of) the
@ -2773,3 +2805,10 @@ a-tags.o : a-tags.adb a-tags.ads
s-memory.o : s-memory.adb s-memory.ads
$(ADAC) -c $(ALL_ADAFLAGS) $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) \
$< $(OUTPUT_OPTION)
# Need to keep functions ordered on g-debpoo.o since labels are used to
# exclude subprograms from traceback computation.
g-debpoo.o: g-debpoo.adb g-debpoo.ads
$(ADAC) -c $(ALL_ADAFLAGS) $(NO_REORDER_ADAFLAGS) $(ADA_INCLUDES) \
$< $(OUTPUT_OPTION)

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2001-2019, AdaCore --
-- Copyright (C) 2001-2020, AdaCore --
-- --
-- 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- --
@ -189,7 +189,6 @@ package body Adabkend is
elsif Switch_Chars (First .. Last) = "fno-inline" then
Lib.Store_Compilation_Switch (Switch_Chars);
Opt.Disable_FE_Inline := True;
Opt.Disable_FE_Inline_Always := True;
return;
-- Similar processing for -fpreserve-control-flow

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --

View File

@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
* Copyright (C) 2001-2019, Free Software Foundation, Inc. *
* Copyright (C) 2001-2020, 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- *

View File

@ -6,7 +6,7 @@
* *
* C Header File *
* *
* Copyright (C) 2001-2019, Free Software Foundation, Inc. *
* Copyright (C) 2001-2020, 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- *

View File

@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
* Copyright (C) 1992-2019, Free Software Foundation, Inc. *
* Copyright (C) 1992-2020, 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- *
@ -264,6 +264,9 @@ UINT __gnat_current_ccs_encoding;
#ifndef DIR_SEPARATOR
#define DIR_SEPARATOR '/'
#define IS_DIRECTORY_SEPARATOR(c) ((c) == DIR_SEPARATOR)
#else
#define IS_DIRECTORY_SEPARATOR(c) ((c) == '/' || (c) == DIR_SEPARATOR)
#endif
/* Check for cross-compilation. */
@ -1709,9 +1712,10 @@ __gnat_is_absolute_path (char *name, int length)
return 0;
#else
return (length != 0) &&
(*name == '/' || *name == DIR_SEPARATOR
(IS_DIRECTORY_SEPARATOR(*name)
#if defined (WINNT) || defined(__DJGPP__)
|| (length > 1 && ISALPHA (name[0]) && name[1] == ':')
|| (length > 2 && ISALPHA (name[0]) && name[1] == ':'
&& IS_DIRECTORY_SEPARATOR(name[2]))
#endif
);
#endif
@ -2845,7 +2849,7 @@ __gnat_locate_file_with_predicate (char *file_name, char *path_val,
/* If file_name include directory separator(s), try it first as
a path name relative to the current directory */
for (ptr = file_name; *ptr && *ptr != '/' && *ptr != DIR_SEPARATOR; ptr++)
for (ptr = file_name; *ptr && !IS_DIRECTORY_SEPARATOR(*ptr); ptr++)
;
if (*ptr != 0)
@ -2886,7 +2890,7 @@ __gnat_locate_file_with_predicate (char *file_name, char *path_val,
if (*ptr == '"')
ptr--;
if (*ptr != '/' && *ptr != DIR_SEPARATOR)
if (!IS_DIRECTORY_SEPARATOR(*ptr))
*++ptr = DIR_SEPARATOR;
strcpy (++ptr, file_name);

View File

@ -6,7 +6,7 @@
* *
* C Header File *
* *
* Copyright (C) 1992-2019, Free Software Foundation, Inc. *
* Copyright (C) 1992-2020, 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- *
@ -282,9 +282,10 @@ extern char *mktemp (char *);
extern void __gnat_set_exit_status (int);
extern int __gnat_expect_fork (void);
extern void __gnat_expect_portable_execvp (char *, char *[]);
extern void __gnat_expect_portable_execvp (int *, char *, char *[]);
extern int __gnat_pipe (int *);
extern int __gnat_expect_poll (int *, int, int, int *);
extern int __gnat_expect_poll (int *, int, int, int *,
int *);
extern void __gnat_set_binary_mode (int);
extern void __gnat_set_text_mode (int);
extern void __gnat_set_mode (int,int);

View File

@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
* Copyright (C) 2005-2019, Free Software Foundation, Inc. *
* Copyright (C) 2005-2020, 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- *

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --
@ -242,31 +242,33 @@ package body ALI is
-- The following variable records which characters currently are used as
-- line type markers in the ALI file. This is used in Scan_ALI to detect
-- (or skip) invalid lines. The following letters are still available:
--
-- B F H J K O Q Z
-- (or skip) invalid lines.
Known_ALI_Lines : constant array (Character range 'A' .. 'Z') of Boolean :=
('A' => True, -- argument
'C' => True, -- SCO information
'D' => True, -- dependency
'E' => True, -- external
'G' => True, -- invocation graph
'I' => True, -- interrupt
'L' => True, -- linker option
'M' => True, -- main program
'N' => True, -- notes
'P' => True, -- program
'R' => True, -- restriction
'S' => True, -- specific dispatching
'T' => True, -- task stack information
'U' => True, -- unit
'V' => True, -- version
'W' => True, -- with
'X' => True, -- xref
'Y' => True, -- limited_with
'Z' => True, -- implicit with from instantiation
others => False);
('A' | -- argument
'C' | -- SCO information
'D' | -- dependency
'E' | -- external
'G' | -- invocation graph
'I' | -- interrupt
'L' | -- linker option
'M' | -- main program
'N' | -- notes
'P' | -- program
'R' | -- restriction
'S' | -- specific dispatching
'T' | -- task stack information
'U' | -- unit
'V' | -- version
'W' | -- with
'X' | -- xref
'Y' | -- limited_with
'Z' -- implicit with from instantiation
=> True,
-- Still available:
'B' | 'F' | 'H' | 'J' | 'K' | 'O' | 'Q' => False);
------------------------------
-- Add_Invocation_Construct --

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --

View File

@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
* Copyright (C) 1992-2019, Free Software Foundation, Inc. *
* Copyright (C) 1992-2020, 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- *

View File

@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
* Copyright (C) 1992-2019, Free Software Foundation, Inc. *
* Copyright (C) 1992-2020, 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- *

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2010-2019, Free Software Foundation, Inc. --
-- Copyright (C) 2010-2020, 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- --
@ -33,7 +33,6 @@ with Atree; use Atree;
with Einfo; use Einfo;
with Nlists; use Nlists;
with Sinfo; use Sinfo;
with Tree_IO; use Tree_IO;
with GNAT.HTable;
@ -70,16 +69,6 @@ package body Aspects is
Aspect_Variable_Indexing => True,
others => False);
procedure Set_Aspect_Specifications_No_Check (N : Node_Id; L : List_Id);
-- Same as Set_Aspect_Specifications, but does not contain the assertion
-- that checks that N does not already have aspect specifications. This
-- subprogram is supposed to be used as a part of Tree_Read. When reading
-- tree, first read nodes with their basic properties (as Atree.Tree_Read),
-- this includes reading the Has_Aspects flag for each node, then we reed
-- all the list tables and only after that we call Tree_Read for Aspects.
-- That is, when reading the tree, the list of aspects is attached to the
-- node that already has Has_Aspects flag set ON.
------------------------------------------
-- Hash Table for Aspect Specifications --
------------------------------------------
@ -153,12 +142,9 @@ package body Aspects is
-- The routine should be invoked on a body [stub] with aspects
pragma Assert (Has_Aspects (N));
pragma Assert (Nkind (N) in N_Body_Stub
or else Nkind_In (N, N_Entry_Body,
N_Package_Body,
N_Protected_Body,
N_Subprogram_Body,
N_Task_Body));
pragma Assert
(Nkind (N) in N_Body_Stub | N_Entry_Body | N_Package_Body |
N_Protected_Body | N_Subprogram_Body | N_Task_Body);
-- Look through all aspects and see whether they can be applied to a
-- body [stub].
@ -412,9 +398,8 @@ package body Aspects is
-- Note: It is better to use Is_Single_Concurrent_Type_Declaration
-- here, but Aspects and Sem_Util have incompatible licenses.
elsif Nkind_In
(Original_Node (From), N_Single_Protected_Declaration,
N_Single_Task_Declaration)
elsif Nkind (Original_Node (From)) in
N_Single_Protected_Declaration | N_Single_Task_Declaration
then
Asp_Id := Get_Aspect_Id (Asp);
@ -511,136 +496,36 @@ package body Aspects is
-- Table used for Same_Aspect, maps aspect to canonical aspect
Canonical_Aspect : constant array (Aspect_Id) of Aspect_Id :=
(No_Aspect => No_Aspect,
Aspect_Abstract_State => Aspect_Abstract_State,
Aspect_Address => Aspect_Address,
Aspect_Alignment => Aspect_Alignment,
Aspect_All_Calls_Remote => Aspect_All_Calls_Remote,
Aspect_Annotate => Aspect_Annotate,
Aspect_Async_Readers => Aspect_Async_Readers,
Aspect_Async_Writers => Aspect_Async_Writers,
Aspect_Asynchronous => Aspect_Asynchronous,
Aspect_Atomic => Aspect_Atomic,
Aspect_Atomic_Components => Aspect_Atomic_Components,
Aspect_Attach_Handler => Aspect_Attach_Handler,
Aspect_Bit_Order => Aspect_Bit_Order,
Aspect_Component_Size => Aspect_Component_Size,
Aspect_Constant_After_Elaboration => Aspect_Constant_After_Elaboration,
Aspect_Constant_Indexing => Aspect_Constant_Indexing,
Aspect_Contract_Cases => Aspect_Contract_Cases,
Aspect_Convention => Aspect_Convention,
Aspect_CPU => Aspect_CPU,
Aspect_Default_Component_Value => Aspect_Default_Component_Value,
Aspect_Default_Initial_Condition => Aspect_Default_Initial_Condition,
Aspect_Default_Iterator => Aspect_Default_Iterator,
Aspect_Default_Storage_Pool => Aspect_Default_Storage_Pool,
Aspect_Default_Value => Aspect_Default_Value,
Aspect_Depends => Aspect_Depends,
Aspect_Dimension => Aspect_Dimension,
Aspect_Dimension_System => Aspect_Dimension_System,
Aspect_Disable_Controlled => Aspect_Disable_Controlled,
Aspect_Discard_Names => Aspect_Discard_Names,
Aspect_Dispatching_Domain => Aspect_Dispatching_Domain,
Aspect_Dynamic_Predicate => Aspect_Predicate,
Aspect_Effective_Reads => Aspect_Effective_Reads,
Aspect_Effective_Writes => Aspect_Effective_Writes,
Aspect_Elaborate_Body => Aspect_Elaborate_Body,
Aspect_Export => Aspect_Export,
Aspect_Extensions_Visible => Aspect_Extensions_Visible,
Aspect_External_Name => Aspect_External_Name,
Aspect_External_Tag => Aspect_External_Tag,
Aspect_Favor_Top_Level => Aspect_Favor_Top_Level,
Aspect_Ghost => Aspect_Ghost,
Aspect_Global => Aspect_Global,
Aspect_Implicit_Dereference => Aspect_Implicit_Dereference,
Aspect_Import => Aspect_Import,
Aspect_Independent => Aspect_Independent,
Aspect_Independent_Components => Aspect_Independent_Components,
Aspect_Inline => Aspect_Inline,
Aspect_Inline_Always => Aspect_Inline,
Aspect_Initial_Condition => Aspect_Initial_Condition,
Aspect_Initializes => Aspect_Initializes,
Aspect_Input => Aspect_Input,
Aspect_Interrupt_Handler => Aspect_Interrupt_Handler,
Aspect_Interrupt_Priority => Aspect_Priority,
Aspect_Invariant => Aspect_Invariant,
Aspect_Iterable => Aspect_Iterable,
Aspect_Iterator_Element => Aspect_Iterator_Element,
Aspect_Link_Name => Aspect_Link_Name,
Aspect_Linker_Section => Aspect_Linker_Section,
Aspect_Lock_Free => Aspect_Lock_Free,
Aspect_Machine_Radix => Aspect_Machine_Radix,
Aspect_Max_Entry_Queue_Depth => Aspect_Max_Entry_Queue_Depth,
Aspect_Max_Entry_Queue_Length => Aspect_Max_Entry_Queue_Length,
Aspect_Max_Queue_Length => Aspect_Max_Queue_Length,
Aspect_No_Caching => Aspect_No_Caching,
Aspect_No_Elaboration_Code_All => Aspect_No_Elaboration_Code_All,
Aspect_No_Inline => Aspect_No_Inline,
Aspect_No_Return => Aspect_No_Return,
Aspect_No_Tagged_Streams => Aspect_No_Tagged_Streams,
Aspect_Obsolescent => Aspect_Obsolescent,
Aspect_Object_Size => Aspect_Object_Size,
Aspect_Output => Aspect_Output,
Aspect_Pack => Aspect_Pack,
Aspect_Part_Of => Aspect_Part_Of,
Aspect_Persistent_BSS => Aspect_Persistent_BSS,
Aspect_Post => Aspect_Post,
Aspect_Postcondition => Aspect_Post,
Aspect_Pre => Aspect_Pre,
Aspect_Precondition => Aspect_Pre,
Aspect_Predicate => Aspect_Predicate,
Aspect_Predicate_Failure => Aspect_Predicate_Failure,
Aspect_Preelaborate => Aspect_Preelaborate,
Aspect_Preelaborable_Initialization => Aspect_Preelaborable_Initialization,
Aspect_Priority => Aspect_Priority,
Aspect_Pure => Aspect_Pure,
Aspect_Pure_Function => Aspect_Pure_Function,
Aspect_Refined_Depends => Aspect_Refined_Depends,
Aspect_Refined_Global => Aspect_Refined_Global,
Aspect_Refined_Post => Aspect_Refined_Post,
Aspect_Refined_State => Aspect_Refined_State,
Aspect_Remote_Access_Type => Aspect_Remote_Access_Type,
Aspect_Remote_Call_Interface => Aspect_Remote_Call_Interface,
Aspect_Remote_Types => Aspect_Remote_Types,
Aspect_Read => Aspect_Read,
Aspect_Relative_Deadline => Aspect_Relative_Deadline,
Aspect_Scalar_Storage_Order => Aspect_Scalar_Storage_Order,
Aspect_Secondary_Stack_Size => Aspect_Secondary_Stack_Size,
Aspect_Shared => Aspect_Atomic,
Aspect_Shared_Passive => Aspect_Shared_Passive,
Aspect_Simple_Storage_Pool => Aspect_Simple_Storage_Pool,
Aspect_Simple_Storage_Pool_Type => Aspect_Simple_Storage_Pool_Type,
Aspect_Size => Aspect_Size,
Aspect_Small => Aspect_Small,
Aspect_SPARK_Mode => Aspect_SPARK_Mode,
Aspect_Static_Predicate => Aspect_Predicate,
Aspect_Storage_Pool => Aspect_Storage_Pool,
Aspect_Storage_Size => Aspect_Storage_Size,
Aspect_Stream_Size => Aspect_Stream_Size,
Aspect_Suppress => Aspect_Suppress,
Aspect_Suppress_Debug_Info => Aspect_Suppress_Debug_Info,
Aspect_Suppress_Initialization => Aspect_Suppress_Initialization,
Aspect_Synchronization => Aspect_Synchronization,
Aspect_Test_Case => Aspect_Test_Case,
Aspect_Thread_Local_Storage => Aspect_Thread_Local_Storage,
Aspect_Type_Invariant => Aspect_Invariant,
Aspect_Unchecked_Union => Aspect_Unchecked_Union,
Aspect_Unimplemented => Aspect_Unimplemented,
Aspect_Universal_Aliasing => Aspect_Universal_Aliasing,
Aspect_Universal_Data => Aspect_Universal_Data,
Aspect_Unmodified => Aspect_Unmodified,
Aspect_Unreferenced => Aspect_Unreferenced,
Aspect_Unreferenced_Objects => Aspect_Unreferenced_Objects,
Aspect_Unsuppress => Aspect_Unsuppress,
Aspect_Variable_Indexing => Aspect_Variable_Indexing,
Aspect_Value_Size => Aspect_Value_Size,
Aspect_Volatile => Aspect_Volatile,
Aspect_Volatile_Components => Aspect_Volatile_Components,
Aspect_Volatile_Full_Access => Aspect_Volatile_Full_Access,
Aspect_Volatile_Function => Aspect_Volatile_Function,
Aspect_Warnings => Aspect_Warnings,
Aspect_Write => Aspect_Write);
type Aspect_To_Aspect_Mapping is array (Aspect_Id) of Aspect_Id;
function Init_Canonical_Aspect return Aspect_To_Aspect_Mapping;
-- Initialize the Canonical_Aspect mapping below
function Init_Canonical_Aspect return Aspect_To_Aspect_Mapping is
Result : Aspect_To_Aspect_Mapping;
begin
-- They all map to themselves...
for Aspect in Aspect_Id loop
Result (Aspect) := Aspect;
end loop;
-- ...except for these:
Result (Aspect_Dynamic_Predicate) := Aspect_Predicate;
Result (Aspect_Inline_Always) := Aspect_Inline;
Result (Aspect_Interrupt_Priority) := Aspect_Priority;
Result (Aspect_Postcondition) := Aspect_Post;
Result (Aspect_Precondition) := Aspect_Pre;
Result (Aspect_Shared) := Aspect_Atomic;
Result (Aspect_Static_Predicate) := Aspect_Predicate;
Result (Aspect_Type_Invariant) := Aspect_Invariant;
return Result;
end Init_Canonical_Aspect;
Canonical_Aspect : constant Aspect_To_Aspect_Mapping :=
Init_Canonical_Aspect;
function Same_Aspect (A1 : Aspect_Id; A2 : Aspect_Id) return Boolean is
begin
@ -662,53 +547,6 @@ package body Aspects is
Aspect_Specifications_Hash_Table.Set (N, L);
end Set_Aspect_Specifications;
----------------------------------------
-- Set_Aspect_Specifications_No_Check --
----------------------------------------
procedure Set_Aspect_Specifications_No_Check (N : Node_Id; L : List_Id) is
begin
pragma Assert (Permits_Aspect_Specifications (N));
pragma Assert (L /= No_List);
Set_Has_Aspects (N);
Set_Parent (L, N);
Aspect_Specifications_Hash_Table.Set (N, L);
end Set_Aspect_Specifications_No_Check;
---------------
-- Tree_Read --
---------------
procedure Tree_Read is
Node : Node_Id;
List : List_Id;
begin
loop
Tree_Read_Int (Int (Node));
Tree_Read_Int (Int (List));
exit when List = No_List;
Set_Aspect_Specifications_No_Check (Node, List);
end loop;
end Tree_Read;
----------------
-- Tree_Write --
----------------
procedure Tree_Write is
Node : Node_Id := Empty;
List : List_Id;
begin
Aspect_Specifications_Hash_Table.Get_First (Node, List);
loop
Tree_Write_Int (Int (Node));
Tree_Write_Int (Int (List));
exit when List = No_List;
Aspect_Specifications_Hash_Table.Get_Next (Node, List);
end loop;
end Tree_Write;
-- Package initialization sets up Aspect Id hash table
begin

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2010-2019, Free Software Foundation, Inc. --
-- Copyright (C) 2010-2020, 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- --
@ -38,11 +38,11 @@
-- Adding New Aspects --
------------------------
-- In general, each aspect should have a corresponding pragma, so that the
-- newly developed functionality is available for Ada versions < Ada 2012.
-- In general, each aspect should have a corresponding pragma or attribute, so
-- that the newly developed functionality is available for old Ada versions.
-- When both are defined, it is convenient to first transform the aspect into
-- an equivalent pragma in Sem_Ch13.Analyze_Aspect_Specifications, and then
-- analyze the pragma in Sem_Prag.Analyze_Pragma.
-- an equivalent pragma or attribute in Sem_Ch13.Analyze_Aspect_Specifications
-- and then analyze that.
-- To add a new aspect, you need to do the following
@ -57,7 +57,7 @@
-- treatments later.
-- 5. If the semantic analysis of expressions/names in the aspect should not
-- occur at the point the aspect is defined, add code in the adequate
-- occur at the point the aspect is defined, add code in the appropriate
-- semantic analysis procedure for the aspect. For example, this is the
-- case for aspects Pre and Post on subprograms, which are preanalyzed
-- at the end of the declaration list to which the subprogram belongs,
@ -76,6 +76,7 @@ package Aspects is
(No_Aspect, -- Dummy entry for no aspect
Aspect_Abstract_State, -- GNAT
Aspect_Address,
Aspect_Aggregate,
Aspect_Alignment,
Aspect_Annotate, -- GNAT
Aspect_Async_Readers, -- GNAT
@ -109,6 +110,7 @@ package Aspects is
Aspect_Initial_Condition, -- GNAT
Aspect_Initializes, -- GNAT
Aspect_Input,
Aspect_Integer_Literal,
Aspect_Interrupt_Priority,
Aspect_Invariant, -- GNAT
Aspect_Iterator_Element,
@ -131,12 +133,15 @@ package Aspects is
Aspect_Predicate, -- GNAT
Aspect_Predicate_Failure,
Aspect_Priority,
Aspect_Put_Image,
Aspect_Read,
Aspect_Real_Literal,
Aspect_Refined_Depends, -- GNAT
Aspect_Refined_Global, -- GNAT
Aspect_Refined_Post, -- GNAT
Aspect_Refined_State, -- GNAT
Aspect_Relative_Deadline,
Aspect_Relaxed_Initialization, -- GNAT
Aspect_Scalar_Storage_Order, -- GNAT
Aspect_Secondary_Stack_Size, -- GNAT
Aspect_Simple_Storage_Pool, -- GNAT
@ -147,6 +152,7 @@ package Aspects is
Aspect_Storage_Pool,
Aspect_Storage_Size,
Aspect_Stream_Size,
Aspect_String_Literal,
Aspect_Suppress,
Aspect_Synchronization,
Aspect_Test_Case, -- GNAT
@ -183,6 +189,7 @@ package Aspects is
Aspect_Atomic_Components,
Aspect_Disable_Controlled, -- GNAT
Aspect_Discard_Names,
Aspect_CUDA_Global, -- GNAT
Aspect_Export,
Aspect_Favor_Top_Level, -- GNAT
Aspect_Independent,
@ -202,6 +209,7 @@ package Aspects is
Aspect_Remote_Access_Type, -- GNAT
Aspect_Shared, -- GNAT (equivalent to Atomic)
Aspect_Simple_Storage_Pool_Type, -- GNAT
Aspect_Static,
Aspect_Suppress_Debug_Info, -- GNAT
Aspect_Suppress_Initialization, -- GNAT
Aspect_Thread_Local_Storage, -- GNAT
@ -212,7 +220,8 @@ package Aspects is
Aspect_Unreferenced_Objects, -- GNAT
Aspect_Volatile,
Aspect_Volatile_Components,
Aspect_Volatile_Full_Access); -- GNAT
Aspect_Volatile_Full_Access, -- GNAT
Aspect_Yield);
subtype Aspect_Id_Exclude_No_Aspect is
Aspect_Id range Aspect_Id'Succ (No_Aspect) .. Aspect_Id'Last;
@ -260,6 +269,7 @@ package Aspects is
Aspect_Persistent_BSS => True,
Aspect_Predicate => True,
Aspect_Pure_Function => True,
Aspect_Relaxed_Initialization => True,
Aspect_Remote_Access_Type => True,
Aspect_Scalar_Storage_Order => True,
Aspect_Secondary_Stack_Size => True,
@ -292,6 +302,7 @@ package Aspects is
Aspect_Iterator_Element => True,
Aspect_Iterable => True,
Aspect_Variable_Indexing => True,
Aspect_Aggregate => True,
others => False);
-- The following array indicates aspects for which multiple occurrences of
@ -337,6 +348,7 @@ package Aspects is
(No_Aspect => Optional_Expression,
Aspect_Abstract_State => Expression,
Aspect_Address => Expression,
Aspect_Aggregate => Expression,
Aspect_Alignment => Expression,
Aspect_Annotate => Expression,
Aspect_Async_Readers => Optional_Expression,
@ -370,6 +382,7 @@ package Aspects is
Aspect_Initial_Condition => Expression,
Aspect_Initializes => Expression,
Aspect_Input => Name,
Aspect_Integer_Literal => Name,
Aspect_Interrupt_Priority => Expression,
Aspect_Invariant => Expression,
Aspect_Iterable => Expression,
@ -392,12 +405,15 @@ package Aspects is
Aspect_Predicate => Expression,
Aspect_Predicate_Failure => Expression,
Aspect_Priority => Expression,
Aspect_Put_Image => Name,
Aspect_Read => Name,
Aspect_Real_Literal => Name,
Aspect_Refined_Depends => Expression,
Aspect_Refined_Global => Expression,
Aspect_Refined_Post => Expression,
Aspect_Refined_State => Expression,
Aspect_Relative_Deadline => Expression,
Aspect_Relaxed_Initialization => Optional_Expression,
Aspect_Scalar_Storage_Order => Expression,
Aspect_Secondary_Stack_Size => Expression,
Aspect_Simple_Storage_Pool => Name,
@ -408,6 +424,7 @@ package Aspects is
Aspect_Storage_Pool => Name,
Aspect_Storage_Size => Expression,
Aspect_Stream_Size => Expression,
Aspect_String_Literal => Name,
Aspect_Suppress => Name,
Aspect_Synchronization => Name,
Aspect_Test_Case => Expression,
@ -423,6 +440,142 @@ package Aspects is
Boolean_Aspects => Optional_Expression,
Library_Unit_Aspects => Optional_Expression);
-- The following array indicates what aspects are representation aspects
Is_Representation_Aspect : constant array (Aspect_Id) of Boolean :=
(No_Aspect => False,
Aspect_Abstract_State => False,
Aspect_Address => True,
Aspect_Aggregate => False,
Aspect_Alignment => True,
Aspect_Annotate => False,
Aspect_Async_Readers => False,
Aspect_Async_Writers => False,
Aspect_Attach_Handler => False,
Aspect_Bit_Order => True,
Aspect_Component_Size => True,
Aspect_Constant_After_Elaboration => False,
Aspect_Constant_Indexing => False,
Aspect_Contract_Cases => False,
Aspect_Convention => True,
Aspect_CPU => False,
Aspect_CUDA_Global => False,
Aspect_Default_Component_Value => True,
Aspect_Default_Initial_Condition => False,
Aspect_Default_Iterator => False,
Aspect_Default_Storage_Pool => True,
Aspect_Default_Value => True,
Aspect_Depends => False,
Aspect_Dimension => False,
Aspect_Dimension_System => False,
Aspect_Dispatching_Domain => False,
Aspect_Dynamic_Predicate => False,
Aspect_Effective_Reads => False,
Aspect_Effective_Writes => False,
Aspect_Extensions_Visible => False,
Aspect_External_Name => False,
Aspect_External_Tag => False,
Aspect_Ghost => False,
Aspect_Global => False,
Aspect_Implicit_Dereference => False,
Aspect_Initial_Condition => False,
Aspect_Initializes => False,
Aspect_Input => False,
Aspect_Integer_Literal => False,
Aspect_Interrupt_Priority => False,
Aspect_Invariant => False,
Aspect_Iterable => False,
Aspect_Iterator_Element => False,
Aspect_Link_Name => True,
Aspect_Linker_Section => True,
Aspect_Machine_Radix => True,
Aspect_Max_Entry_Queue_Depth => False,
Aspect_Max_Entry_Queue_Length => False,
Aspect_Max_Queue_Length => False,
Aspect_No_Caching => False,
Aspect_Object_Size => True,
Aspect_Obsolescent => False,
Aspect_Output => False,
Aspect_Part_Of => False,
Aspect_Post => False,
Aspect_Postcondition => False,
Aspect_Pre => False,
Aspect_Precondition => False,
Aspect_Predicate => False,
Aspect_Predicate_Failure => False,
Aspect_Priority => False,
Aspect_Put_Image => False,
Aspect_Read => False,
Aspect_Real_Literal => False,
Aspect_Refined_Depends => False,
Aspect_Refined_Global => False,
Aspect_Refined_Post => False,
Aspect_Refined_State => False,
Aspect_Relative_Deadline => False,
Aspect_Relaxed_Initialization => False,
Aspect_Scalar_Storage_Order => True,
Aspect_Secondary_Stack_Size => True,
Aspect_Simple_Storage_Pool => True,
Aspect_Size => True,
Aspect_Small => True,
Aspect_SPARK_Mode => False,
Aspect_Static_Predicate => False,
Aspect_Storage_Pool => True,
Aspect_Storage_Size => True,
Aspect_Stream_Size => True,
Aspect_String_Literal => False,
Aspect_Suppress => False,
Aspect_Synchronization => False,
Aspect_Test_Case => False,
Aspect_Type_Invariant => False,
Aspect_Unimplemented => False,
Aspect_Unsuppress => False,
Aspect_Value_Size => True,
Aspect_Variable_Indexing => False,
Aspect_Volatile_Function => False,
Aspect_Warnings => False,
Aspect_Write => False,
Library_Unit_Aspects => False,
Aspect_Asynchronous => True,
Aspect_Atomic => True,
Aspect_Atomic_Components => True,
Aspect_Disable_Controlled => False,
Aspect_Discard_Names => True,
Aspect_Export => True,
Aspect_Favor_Top_Level => False,
Aspect_Independent => True,
Aspect_Independent_Components => True,
Aspect_Import => True,
Aspect_Inline => False,
Aspect_Inline_Always => False,
Aspect_Interrupt_Handler => False,
Aspect_Lock_Free => False,
Aspect_No_Inline => False,
Aspect_No_Return => False,
Aspect_No_Tagged_Streams => False,
Aspect_Pack => True,
Aspect_Persistent_BSS => True,
Aspect_Preelaborable_Initialization => False,
Aspect_Pure_Function => False,
Aspect_Remote_Access_Type => False,
Aspect_Shared => True,
Aspect_Simple_Storage_Pool_Type => True,
Aspect_Static => False,
Aspect_Suppress_Debug_Info => False,
Aspect_Suppress_Initialization => False,
Aspect_Thread_Local_Storage => True,
Aspect_Unchecked_Union => True,
Aspect_Universal_Aliasing => False,
Aspect_Unmodified => False,
Aspect_Unreferenced => False,
Aspect_Unreferenced_Objects => False,
Aspect_Volatile => True,
Aspect_Volatile_Components => True,
Aspect_Volatile_Full_Access => True,
Aspect_Yield => False);
-----------------------------------------
-- Table Linking Names and Aspect_Id's --
-----------------------------------------
@ -433,6 +586,7 @@ package Aspects is
(No_Aspect => No_Name,
Aspect_Abstract_State => Name_Abstract_State,
Aspect_Address => Name_Address,
Aspect_Aggregate => Name_Aggregate,
Aspect_Alignment => Name_Alignment,
Aspect_All_Calls_Remote => Name_All_Calls_Remote,
Aspect_Annotate => Name_Annotate,
@ -449,6 +603,7 @@ package Aspects is
Aspect_Contract_Cases => Name_Contract_Cases,
Aspect_Convention => Name_Convention,
Aspect_CPU => Name_CPU,
Aspect_CUDA_Global => Name_CUDA_Global,
Aspect_Default_Component_Value => Name_Default_Component_Value,
Aspect_Default_Initial_Condition => Name_Default_Initial_Condition,
Aspect_Default_Iterator => Name_Default_Iterator,
@ -480,6 +635,7 @@ package Aspects is
Aspect_Initial_Condition => Name_Initial_Condition,
Aspect_Initializes => Name_Initializes,
Aspect_Input => Name_Input,
Aspect_Integer_Literal => Name_Integer_Literal,
Aspect_Interrupt_Handler => Name_Interrupt_Handler,
Aspect_Interrupt_Priority => Name_Interrupt_Priority,
Aspect_Invariant => Name_Invariant,
@ -514,12 +670,15 @@ package Aspects is
Aspect_Priority => Name_Priority,
Aspect_Pure => Name_Pure,
Aspect_Pure_Function => Name_Pure_Function,
Aspect_Put_Image => Name_Put_Image,
Aspect_Read => Name_Read,
Aspect_Real_Literal => Name_Real_Literal,
Aspect_Refined_Depends => Name_Refined_Depends,
Aspect_Refined_Global => Name_Refined_Global,
Aspect_Refined_Post => Name_Refined_Post,
Aspect_Refined_State => Name_Refined_State,
Aspect_Relative_Deadline => Name_Relative_Deadline,
Aspect_Relaxed_Initialization => Name_Relaxed_Initialization,
Aspect_Remote_Access_Type => Name_Remote_Access_Type,
Aspect_Remote_Call_Interface => Name_Remote_Call_Interface,
Aspect_Remote_Types => Name_Remote_Types,
@ -532,10 +691,12 @@ package Aspects is
Aspect_Size => Name_Size,
Aspect_Small => Name_Small,
Aspect_SPARK_Mode => Name_SPARK_Mode,
Aspect_Static => Name_Static,
Aspect_Static_Predicate => Name_Static_Predicate,
Aspect_Storage_Pool => Name_Storage_Pool,
Aspect_Storage_Size => Name_Storage_Size,
Aspect_Stream_Size => Name_Stream_Size,
Aspect_String_Literal => Name_String_Literal,
Aspect_Suppress => Name_Suppress,
Aspect_Suppress_Debug_Info => Name_Suppress_Debug_Info,
Aspect_Suppress_Initialization => Name_Suppress_Initialization,
@ -558,7 +719,8 @@ package Aspects is
Aspect_Volatile_Full_Access => Name_Volatile_Full_Access,
Aspect_Volatile_Function => Name_Volatile_Function,
Aspect_Warnings => Name_Warnings,
Aspect_Write => Name_Write);
Aspect_Write => Name_Write,
Aspect_Yield => Name_Yield);
function Get_Aspect_Id (Name : Name_Id) return Aspect_Id;
pragma Inline (Get_Aspect_Id);
@ -674,11 +836,13 @@ package Aspects is
Aspect_Delay : constant array (Aspect_Id) of Delay_Type :=
(No_Aspect => Always_Delay,
Aspect_Address => Always_Delay,
Aspect_Aggregate => Always_Delay,
Aspect_All_Calls_Remote => Always_Delay,
Aspect_Asynchronous => Always_Delay,
Aspect_Attach_Handler => Always_Delay,
Aspect_Constant_Indexing => Always_Delay,
Aspect_CPU => Always_Delay,
Aspect_CUDA_Global => Always_Delay,
Aspect_Default_Iterator => Always_Delay,
Aspect_Default_Storage_Pool => Always_Delay,
Aspect_Default_Value => Always_Delay,
@ -696,6 +860,7 @@ package Aspects is
Aspect_Inline => Always_Delay,
Aspect_Inline_Always => Always_Delay,
Aspect_Input => Always_Delay,
Aspect_Integer_Literal => Always_Delay,
Aspect_Interrupt_Handler => Always_Delay,
Aspect_Interrupt_Priority => Always_Delay,
Aspect_Invariant => Always_Delay,
@ -719,7 +884,9 @@ package Aspects is
Aspect_Priority => Always_Delay,
Aspect_Pure => Always_Delay,
Aspect_Pure_Function => Always_Delay,
Aspect_Put_Image => Always_Delay,
Aspect_Read => Always_Delay,
Aspect_Real_Literal => Always_Delay,
Aspect_Relative_Deadline => Always_Delay,
Aspect_Remote_Access_Type => Always_Delay,
Aspect_Remote_Call_Interface => Always_Delay,
@ -732,6 +899,7 @@ package Aspects is
Aspect_Static_Predicate => Always_Delay,
Aspect_Storage_Pool => Always_Delay,
Aspect_Stream_Size => Always_Delay,
Aspect_String_Literal => Always_Delay,
Aspect_Suppress => Always_Delay,
Aspect_Suppress_Debug_Info => Always_Delay,
Aspect_Suppress_Initialization => Always_Delay,
@ -780,12 +948,15 @@ package Aspects is
Aspect_Refined_Global => Never_Delay,
Aspect_Refined_Post => Never_Delay,
Aspect_Refined_State => Never_Delay,
Aspect_Relaxed_Initialization => Never_Delay,
Aspect_SPARK_Mode => Never_Delay,
Aspect_Static => Never_Delay,
Aspect_Synchronization => Never_Delay,
Aspect_Test_Case => Never_Delay,
Aspect_Unimplemented => Never_Delay,
Aspect_Volatile_Function => Never_Delay,
Aspect_Warnings => Never_Delay,
Aspect_Yield => Never_Delay,
Aspect_Alignment => Rep_Aspect,
Aspect_Atomic => Rep_Aspect,
@ -959,10 +1130,4 @@ package Aspects is
-- node that has its Has_Aspects flag set True on entry, or with L being an
-- empty list or No_List.
procedure Tree_Read;
-- Reads contents of Aspect_Specifications hash table from the tree file
procedure Tree_Write;
-- Writes contents of Aspect_Specifications hash table to the tree file
end Aspects;

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --
@ -42,7 +42,6 @@ with Nlists; use Nlists;
with Opt; use Opt;
with Output; use Output;
with Sinput; use Sinput;
with Tree_IO; use Tree_IO;
with GNAT.Heap_Sort_G;
@ -961,9 +960,9 @@ package body Atree is
-- The following code is a bit kludgy. It would be cleaner to
-- Add an entry Change_Expanded_Name_To_Selected_Component to
-- Sinfo.CN, but that's an earthquake, because it has the wrong
-- license, and Atree is used outside the compiler, e.g. in the
-- binder and in ASIS, so we don't want to add that dependency.
-- Sinfo.CN, but that's delicate because Atree is used in the
-- binder, so we don't want to add that dependency.
-- ??? Revisit now that ASIS is no longer using this unit.
-- Consequently we have no choice but to hold our noses and do
-- the change manually. At least we are Atree, so this odd use
@ -995,336 +994,6 @@ package body Atree is
return N_To_E (Nodes.Table (E + 1).Nkind);
end Ekind;
--------------
-- Ekind_In --
--------------
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind) return Boolean
is
begin
return T = V1 or else
T = V2;
end Ekind_In;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind) return Boolean
is
begin
return T = V1 or else
T = V2 or else
T = V3;
end Ekind_In;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind) return Boolean
is
begin
return T = V1 or else
T = V2 or else
T = V3 or else
T = V4;
end Ekind_In;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind) return Boolean
is
begin
return T = V1 or else
T = V2 or else
T = V3 or else
T = V4 or else
T = V5;
end Ekind_In;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind) return Boolean
is
begin
return T = V1 or else
T = V2 or else
T = V3 or else
T = V4 or else
T = V5 or else
T = V6;
end Ekind_In;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind) return Boolean
is
begin
return T = V1 or else
T = V2 or else
T = V3 or else
T = V4 or else
T = V5 or else
T = V6 or else
T = V7;
end Ekind_In;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind;
V8 : Entity_Kind) return Boolean
is
begin
return T = V1 or else
T = V2 or else
T = V3 or else
T = V4 or else
T = V5 or else
T = V6 or else
T = V7 or else
T = V8;
end Ekind_In;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind;
V8 : Entity_Kind;
V9 : Entity_Kind) return Boolean
is
begin
return T = V1 or else
T = V2 or else
T = V3 or else
T = V4 or else
T = V5 or else
T = V6 or else
T = V7 or else
T = V8 or else
T = V9;
end Ekind_In;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind;
V8 : Entity_Kind;
V9 : Entity_Kind;
V10 : Entity_Kind) return Boolean
is
begin
return T = V1 or else
T = V2 or else
T = V3 or else
T = V4 or else
T = V5 or else
T = V6 or else
T = V7 or else
T = V8 or else
T = V9 or else
T = V10;
end Ekind_In;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind;
V8 : Entity_Kind;
V9 : Entity_Kind;
V10 : Entity_Kind;
V11 : Entity_Kind) return Boolean
is
begin
return T = V1 or else
T = V2 or else
T = V3 or else
T = V4 or else
T = V5 or else
T = V6 or else
T = V7 or else
T = V8 or else
T = V9 or else
T = V10 or else
T = V11;
end Ekind_In;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind) return Boolean
is
begin
return Ekind_In (Ekind (E), V1, V2);
end Ekind_In;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind) return Boolean
is
begin
return Ekind_In (Ekind (E), V1, V2, V3);
end Ekind_In;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind) return Boolean
is
begin
return Ekind_In (Ekind (E), V1, V2, V3, V4);
end Ekind_In;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind) return Boolean
is
begin
return Ekind_In (Ekind (E), V1, V2, V3, V4, V5);
end Ekind_In;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind) return Boolean
is
begin
return Ekind_In (Ekind (E), V1, V2, V3, V4, V5, V6);
end Ekind_In;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind) return Boolean
is
begin
return Ekind_In (Ekind (E), V1, V2, V3, V4, V5, V6, V7);
end Ekind_In;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind;
V8 : Entity_Kind) return Boolean
is
begin
return Ekind_In (Ekind (E), V1, V2, V3, V4, V5, V6, V7, V8);
end Ekind_In;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind;
V8 : Entity_Kind;
V9 : Entity_Kind) return Boolean
is
begin
return Ekind_In (Ekind (E), V1, V2, V3, V4, V5, V6, V7, V8, V9);
end Ekind_In;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind;
V8 : Entity_Kind;
V9 : Entity_Kind;
V10 : Entity_Kind) return Boolean
is
begin
return Ekind_In (Ekind (E), V1, V2, V3, V4, V5, V6, V7, V8, V9, V10);
end Ekind_In;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind;
V8 : Entity_Kind;
V9 : Entity_Kind;
V10 : Entity_Kind;
V11 : Entity_Kind) return Boolean
is
begin
return
Ekind_In (Ekind (E), V1, V2, V3, V4, V5, V6, V7, V8, V9, V10, V11);
end Ekind_In;
------------------
-- Error_Posted --
------------------
@ -1784,170 +1453,6 @@ package body Atree is
return Nodes.Table (N).Nkind;
end Nkind;
--------------
-- Nkind_In --
--------------
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind) return Boolean
is
begin
return Nkind_In (Nkind (N), V1, V2);
end Nkind_In;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind) return Boolean
is
begin
return Nkind_In (Nkind (N), V1, V2, V3);
end Nkind_In;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind) return Boolean
is
begin
return Nkind_In (Nkind (N), V1, V2, V3, V4);
end Nkind_In;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind;
V5 : Node_Kind) return Boolean
is
begin
return Nkind_In (Nkind (N), V1, V2, V3, V4, V5);
end Nkind_In;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind;
V5 : Node_Kind;
V6 : Node_Kind) return Boolean
is
begin
return Nkind_In (Nkind (N), V1, V2, V3, V4, V5, V6);
end Nkind_In;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind;
V5 : Node_Kind;
V6 : Node_Kind;
V7 : Node_Kind) return Boolean
is
begin
return Nkind_In (Nkind (N), V1, V2, V3, V4, V5, V6, V7);
end Nkind_In;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind;
V5 : Node_Kind;
V6 : Node_Kind;
V7 : Node_Kind;
V8 : Node_Kind) return Boolean
is
begin
return Nkind_In (Nkind (N), V1, V2, V3, V4, V5, V6, V7, V8);
end Nkind_In;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind;
V5 : Node_Kind;
V6 : Node_Kind;
V7 : Node_Kind;
V8 : Node_Kind;
V9 : Node_Kind) return Boolean
is
begin
return Nkind_In (Nkind (N), V1, V2, V3, V4, V5, V6, V7, V8, V9);
end Nkind_In;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind;
V5 : Node_Kind;
V6 : Node_Kind;
V7 : Node_Kind;
V8 : Node_Kind;
V9 : Node_Kind;
V10 : Node_Kind) return Boolean
is
begin
return Nkind_In (Nkind (N), V1, V2, V3, V4, V5, V6, V7, V8, V9, V10);
end Nkind_In;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind;
V5 : Node_Kind;
V6 : Node_Kind;
V7 : Node_Kind;
V8 : Node_Kind;
V9 : Node_Kind;
V10 : Node_Kind;
V11 : Node_Kind) return Boolean
is
begin
return Nkind_In (Nkind (N), V1, V2, V3, V4, V5, V6, V7, V8, V9, V10,
V11);
end Nkind_In;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind;
V5 : Node_Kind;
V6 : Node_Kind;
V7 : Node_Kind;
V8 : Node_Kind;
V9 : Node_Kind;
V10 : Node_Kind;
V11 : Node_Kind;
V12 : Node_Kind;
V13 : Node_Kind;
V14 : Node_Kind;
V15 : Node_Kind;
V16 : Node_Kind) return Boolean
is
begin
return Nkind_In (Nkind (N), V1, V2, V3, V4, V5, V6, V7, V8, V9, V10,
V11, V12, V13, V14, V15, V16);
end Nkind_In;
--------
-- No --
--------
@ -2071,8 +1576,7 @@ package body Atree is
procedure Preserve_Comes_From_Source (NewN, OldN : Node_Id) is
begin
Nodes.Table (NewN).Comes_From_Source :=
Nodes.Table (OldN).Comes_From_Source;
Set_Comes_From_Source (NewN, Comes_From_Source (OldN));
end Preserve_Comes_From_Source;
----------------------
@ -2686,32 +2190,6 @@ package body Atree is
Discard := Traverse (Node);
end Traverse_Proc;
---------------
-- Tree_Read --
---------------
procedure Tree_Read is
begin
Tree_Read_Int (Node_Count);
Nodes.Tree_Read;
Flags.Tree_Read;
Orig_Nodes.Tree_Read;
Paren_Counts.Tree_Read;
end Tree_Read;
----------------
-- Tree_Write --
----------------
procedure Tree_Write is
begin
Tree_Write_Int (Node_Count);
Nodes.Tree_Write;
Flags.Tree_Write;
Orig_Nodes.Tree_Write;
Paren_Counts.Tree_Write;
end Tree_Write;
------------------------------
-- Unchecked Access Package --
------------------------------

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --
@ -406,8 +406,7 @@ package Atree is
procedure Initialize;
-- Called at the start of compilation to initialize the allocation of
-- the node and list tables and make the standard entries for Empty,
-- Error and Error_List. Note that Initialize must not be called if
-- Tree_Read is used.
-- Error and Error_List.
procedure Lock;
-- Called before the back end is invoked to lock the nodes table
@ -425,15 +424,6 @@ package Atree is
-- Called to unlock entity modifications when assertions are enabled; if
-- assertions are not enabled calling this subprogram has no effect.
procedure Tree_Read;
-- Initializes internal tables from current tree file using the relevant
-- Table.Tree_Read routines. Note that Initialize should not be called if
-- Tree_Read is used. Tree_Read includes all necessary initialization.
procedure Tree_Write;
-- Writes out internal tables to current tree file using the relevant
-- Table.Tree_Write routines.
function New_Node
(New_Node_Kind : Node_Kind;
New_Sloc : Source_Ptr) return Node_Id;
@ -680,334 +670,6 @@ package Atree is
function Sloc (N : Node_Id) return Source_Ptr;
pragma Inline (Sloc);
---------------------
-- Node_Kind Tests --
---------------------
-- These are like the functions in Sinfo, but the first argument is a
-- Node_Id, and the tested field is Nkind (N).
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind) return Boolean;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind) return Boolean;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind) return Boolean;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind;
V5 : Node_Kind) return Boolean;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind;
V5 : Node_Kind;
V6 : Node_Kind) return Boolean;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind;
V5 : Node_Kind;
V6 : Node_Kind;
V7 : Node_Kind) return Boolean;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind;
V5 : Node_Kind;
V6 : Node_Kind;
V7 : Node_Kind;
V8 : Node_Kind) return Boolean;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind;
V5 : Node_Kind;
V6 : Node_Kind;
V7 : Node_Kind;
V8 : Node_Kind;
V9 : Node_Kind) return Boolean;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind;
V5 : Node_Kind;
V6 : Node_Kind;
V7 : Node_Kind;
V8 : Node_Kind;
V9 : Node_Kind;
V10 : Node_Kind) return Boolean;
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind;
V5 : Node_Kind;
V6 : Node_Kind;
V7 : Node_Kind;
V8 : Node_Kind;
V9 : Node_Kind;
V10 : Node_Kind;
V11 : Node_Kind) return Boolean;
-- 12..15-parameter versions are not yet needed
function Nkind_In
(N : Node_Id;
V1 : Node_Kind;
V2 : Node_Kind;
V3 : Node_Kind;
V4 : Node_Kind;
V5 : Node_Kind;
V6 : Node_Kind;
V7 : Node_Kind;
V8 : Node_Kind;
V9 : Node_Kind;
V10 : Node_Kind;
V11 : Node_Kind;
V12 : Node_Kind;
V13 : Node_Kind;
V14 : Node_Kind;
V15 : Node_Kind;
V16 : Node_Kind) return Boolean;
pragma Inline (Nkind_In);
-- Inline all above functions
-----------------------
-- Entity_Kind_Tests --
-----------------------
-- Utility functions to test whether an Entity_Kind value, either given
-- directly as the first argument, or the Ekind field of an Entity given
-- as the first argument, matches any of the given list of Entity_Kind
-- values. Return True if any match, False if no match.
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind) return Boolean;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind) return Boolean;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind) return Boolean;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind) return Boolean;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind) return Boolean;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind) return Boolean;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind;
V8 : Entity_Kind) return Boolean;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind;
V8 : Entity_Kind;
V9 : Entity_Kind) return Boolean;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind;
V8 : Entity_Kind;
V9 : Entity_Kind;
V10 : Entity_Kind) return Boolean;
function Ekind_In
(E : Entity_Id;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind;
V8 : Entity_Kind;
V9 : Entity_Kind;
V10 : Entity_Kind;
V11 : Entity_Kind) return Boolean;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind) return Boolean;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind) return Boolean;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind) return Boolean;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind) return Boolean;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind) return Boolean;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind) return Boolean;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind;
V8 : Entity_Kind) return Boolean;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind;
V8 : Entity_Kind;
V9 : Entity_Kind) return Boolean;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind;
V8 : Entity_Kind;
V9 : Entity_Kind;
V10 : Entity_Kind) return Boolean;
function Ekind_In
(T : Entity_Kind;
V1 : Entity_Kind;
V2 : Entity_Kind;
V3 : Entity_Kind;
V4 : Entity_Kind;
V5 : Entity_Kind;
V6 : Entity_Kind;
V7 : Entity_Kind;
V8 : Entity_Kind;
V9 : Entity_Kind;
V10 : Entity_Kind;
V11 : Entity_Kind) return Boolean;
pragma Inline (Ekind_In);
-- Inline all above functions
-----------------------------
-- Entity Access Functions --
-----------------------------
@ -1055,10 +717,7 @@ package Atree is
procedure Set_Original_Node (N : Node_Id; Val : Node_Id);
pragma Inline (Set_Original_Node);
-- Note that this routine is used only in very peculiar cases. In normal
-- cases, the Original_Node link is set by calls to Rewrite. We currently
-- use it in ASIS mode to manually set the link from pragma expressions to
-- their aspect original source expressions, so that the original source
-- expressions accessed by ASIS are also semantically analyzed.
-- cases, the Original_Node link is set by calls to Rewrite.
procedure Set_Parent (N : Node_Id; Val : Node_Id);
pragma Inline (Set_Parent);
@ -1180,10 +839,9 @@ package Atree is
function Original_Node (Node : Node_Id) return Node_Id;
pragma Inline (Original_Node);
-- If Node has not been rewritten, then returns its input argument
-- unchanged, else returns the Node for the original subtree. Note that
-- this is used extensively by ASIS on the trees constructed in ASIS mode
-- to reconstruct the original semantic tree. See section in sinfo.ads
-- for requirements on original nodes returned by this function.
-- unchanged, else returns the Node for the original subtree. See section
-- in sinfo.ads for requirements on original nodes returned by this
-- function.
--
-- Note: Parents are not preserved in original tree nodes that are
-- retrieved in this way (i.e. their children may have children whose

View File

@ -6,7 +6,7 @@
* *
* C Header File *
* *
* Copyright (C) 1992-2019, Free Software Foundation, Inc. *
* Copyright (C) 1992-2020, 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- *

View File

@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
* Copyright (C) 1992-2019, Free Software Foundation, Inc. *
* Copyright (C) 1992-2020, 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- *

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --
@ -385,9 +385,6 @@ package body Back_End is
elsif Is_Front_End_Switch (Argv) then
Scan_Front_End_Switches (Argv, Args, Next_Arg);
elsif Argv (Argv'First + 1 .. Argv'Last) = "fopenacc" then
Opt.OpenAcc_Enabled := True;
-- All non-front-end switches are back-end switches
else

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --
@ -67,7 +67,6 @@ package Back_End is
-- default for all of these in Opt is False).
--
-- Opt.Disable_FE_Inline
-- Opt.Disable_FE_Inline_Always
-- Opt.Suppress_Control_Float_Optimizations
-- Opt.Generate_SCO
-- Opt.Generate_SCO_Instance_Table

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --
@ -771,7 +771,7 @@ package body Bcheck is
-- Reset when we find a unit that depends on the default and does
-- not have a local specification of the Optimize_Alignment setting.
OA_Unit : Unit_Id;
OA_Unit : Unit_Id := No_Unit_Id;
-- Id of unit from which OA_Setting was set
C : Character;
@ -789,6 +789,7 @@ package body Bcheck is
null;
else
pragma Assert (Present (OA_Unit));
Error_Msg_Unit_1 := Units.Table (OA_Unit).Uname;
Error_Msg_Unit_2 := Units.Table (U).Uname;

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --
@ -1056,6 +1056,8 @@ package body Binde is
-- becomes zero, then add to no-predecessor list.
S := UNR.Table (Chosen).Successors;
pragma Annotate (CodePeer, Modified, S);
while S /= No_Successor loop
U := Succ.Table (S).After;
UNR.Table (U).Num_Pred := UNR.Table (U).Num_Pred - 1;
@ -2390,6 +2392,8 @@ package body Binde is
begin
if ST.Reason in Elab_All .. Elab_All_Desirable then
L := ST.Elab_All_Link;
pragma Annotate (CodePeer, Modified, L);
while L /= No_Elab_All_Link loop
Nam := Elab_All_Entries.Table (L).Needed_By;
Error_Msg_Unit_1 := Nam;

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --
@ -197,6 +197,7 @@ package body Bindgen is
-- Main_CPU : Integer;
-- Default_Sized_SS_Pool : System.Address;
-- Binder_Sec_Stacks_Count : Natural;
-- XDR_Stream : Integer;
-- Main_Priority is the priority value set by pragma Priority in the main
-- program. If no such pragma is present, the value is -1.
@ -295,6 +296,9 @@ package body Bindgen is
-- Binder_Sec_Stacks_Count is the number of generated secondary stacks in
-- the Default_Sized_SS_Pool.
-- XDR_Stream indicates whether streaming should be performed using the
-- XDR protocol. A value of one indicates that XDR streaming is enabled.
procedure WBI (Info : String) renames Osint.B.Write_Binder_Info;
-- Convenient shorthand used throughout
@ -457,7 +461,7 @@ package body Bindgen is
if not Bind_For_Library and not CodePeer_Mode then
WBI (" procedure s_stalib_adafinal;");
Set_String (" pragma Import (C, s_stalib_adafinal, ");
Set_String (" pragma Import (Ada, s_stalib_adafinal, ");
Set_String ("""system__standard_library__adafinal"");");
Write_Statement_Buffer;
end if;
@ -758,13 +762,21 @@ package body Bindgen is
"""__gnat_default_ss_size"");");
end if;
WBI (" Leap_Seconds_Support : Integer;");
WBI (" pragma Import (C, Leap_Seconds_Support, " &
"""__gl_leap_seconds_support"");");
if Leap_Seconds_Support then
WBI (" Leap_Seconds_Support : Integer;");
WBI (" pragma Import (C, Leap_Seconds_Support, " &
"""__gl_leap_seconds_support"");");
end if;
WBI (" Bind_Env_Addr : System.Address;");
WBI (" pragma Import (C, Bind_Env_Addr, " &
"""__gl_bind_env_addr"");");
if XDR_Stream then
WBI (" XDR_Stream : Integer;");
WBI (" pragma Import (C, XDR_Stream, ""__gl_xdr_stream"");");
end if;
-- Import entry point for elaboration time signal handler
-- installation, and indication of if it's been called previously.
@ -978,16 +990,13 @@ package body Bindgen is
Set_String (";");
Write_Statement_Buffer;
Set_String (" Leap_Seconds_Support := ");
if Leap_Seconds_Support then
Set_Int (1);
else
Set_Int (0);
WBI (" Leap_Seconds_Support := 1;");
end if;
Set_String (";");
Write_Statement_Buffer;
if XDR_Stream then
WBI (" XDR_Stream := 1;");
end if;
if Bind_Env_String_Built then
WBI (" Bind_Env_Addr := Bind_Env'Address;");

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2019, Free Software Foundation, Inc. --
-- Copyright (C) 2019-2020, 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- --
@ -57,7 +57,6 @@ package body Bindo.Augmentors is
procedure Visit_Elaboration_Root
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Root : Invocation_Graph_Vertex_Id);
pragma Inline (Visit_Elaboration_Root);
-- Start a DFS traversal from elaboration root Root to:
@ -67,9 +66,7 @@ package body Bindo.Augmentors is
-- * Create invocation edges for each such transition where the
-- successor is Root.
procedure Visit_Elaboration_Roots
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph);
procedure Visit_Elaboration_Roots (Inv_Graph : Invocation_Graph);
pragma Inline (Visit_Elaboration_Roots);
-- Start a DFS traversal from all elaboration roots to:
--
@ -80,7 +77,6 @@ package body Bindo.Augmentors is
procedure Visit_Vertex
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Invoker : Invocation_Graph_Vertex_Id;
Last_Vertex : Library_Graph_Vertex_Id;
Root_Vertex : Library_Graph_Vertex_Id;
@ -113,10 +109,8 @@ package body Bindo.Augmentors is
-- Augment_Library_Graph --
---------------------------
procedure Augment_Library_Graph
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph)
is
procedure Augment_Library_Graph (Inv_Graph : Invocation_Graph) is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
begin
pragma Assert (Present (Lib_Graph));
@ -133,7 +127,7 @@ package body Bindo.Augmentors is
Longest_Path := 0;
Total_Visited := 0;
Visit_Elaboration_Roots (Inv_Graph, Lib_Graph);
Visit_Elaboration_Roots (Inv_Graph);
Write_Statistics;
End_Phase (Library_Graph_Augmentation);
@ -145,9 +139,9 @@ package body Bindo.Augmentors is
procedure Visit_Elaboration_Root
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Root : Invocation_Graph_Vertex_Id)
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
pragma Assert (Present (Root));
@ -173,7 +167,6 @@ package body Bindo.Augmentors is
Visit_Vertex
(Inv_Graph => Inv_Graph,
Lib_Graph => Lib_Graph,
Invoker => Root,
Last_Vertex => Root_Vertex,
Root_Vertex => Root_Vertex,
@ -189,25 +182,20 @@ package body Bindo.Augmentors is
-- Visit_Elaboration_Roots --
-----------------------------
procedure Visit_Elaboration_Roots
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph)
is
procedure Visit_Elaboration_Roots (Inv_Graph : Invocation_Graph) is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
Iter : Elaboration_Root_Iterator;
Root : Invocation_Graph_Vertex_Id;
begin
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
Iter := Iterate_Elaboration_Roots (Inv_Graph);
while Has_Next (Iter) loop
Next (Iter, Root);
Visit_Elaboration_Root
(Inv_Graph => Inv_Graph,
Lib_Graph => Lib_Graph,
Root => Root);
Visit_Elaboration_Root (Inv_Graph => Inv_Graph, Root => Root);
end loop;
end Visit_Elaboration_Roots;
@ -217,7 +205,6 @@ package body Bindo.Augmentors is
procedure Visit_Vertex
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Invoker : Invocation_Graph_Vertex_Id;
Last_Vertex : Library_Graph_Vertex_Id;
Root_Vertex : Library_Graph_Vertex_Id;
@ -226,6 +213,8 @@ package body Bindo.Augmentors is
Internal_Controlled_Action : Boolean;
Path : Natural)
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
New_Path : constant Natural := Path + 1;
Edge : Invocation_Graph_Edge_Id;
@ -300,7 +289,6 @@ package body Bindo.Augmentors is
Visit_Vertex
(Inv_Graph => Inv_Graph,
Lib_Graph => Lib_Graph,
Invoker => Target (Inv_Graph, Edge),
Last_Vertex => Invoker_Vertex,
Root_Vertex => Root_Vertex,

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2019, Free Software Foundation, Inc. --
-- Copyright (C) 2019-2020, 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- --
@ -42,11 +42,9 @@ package Bindo.Augmentors is
------------------------------
package Library_Graph_Augmentors is
procedure Augment_Library_Graph
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph);
-- Augment library graph Lib_Graph with information from invocation
-- graph Inv_Graph as follows:
procedure Augment_Library_Graph (Inv_Graph : Invocation_Graph);
-- Augment the library graph of Inv_Graph with information from
-- invocation graph Inv_Graph as follows:
--
-- 1) Traverse the invocation graph starting from each elaboration
-- procedure of unit Root.

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2019, Free Software Foundation, Inc. --
-- Copyright (C) 2019-2020, 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- --
@ -110,7 +110,8 @@ package body Bindo.Builders is
Inv_Graph :=
Create
(Initial_Vertices => Number_Of_Elaborable_Units,
Initial_Edges => Number_Of_Elaborable_Units);
Initial_Edges => Number_Of_Elaborable_Units,
Lib_Graph => Lib_G);
Lib_Graph := Lib_G;
For_Each_Elaborable_Unit (Create_Vertices'Access);

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2019, Free Software Foundation, Inc. --
-- Copyright (C) 2019-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2019, Free Software Foundation, Inc. --
-- Copyright (C) 2019-2020, 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- --
@ -25,7 +25,6 @@
with Binderr; use Binderr;
with Debug; use Debug;
with Restrict; use Restrict;
with Rident; use Rident;
with Types; use Types;
@ -44,22 +43,18 @@ package body Bindo.Diagnostics is
-- Local subprograms --
-----------------------
procedure Diagnose_All_Cycles
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph);
procedure Diagnose_All_Cycles (Inv_Graph : Invocation_Graph);
pragma Inline (Diagnose_All_Cycles);
-- Emit diagnostics for all cycles of library graph G
procedure Diagnose_Cycle
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Cycle : Library_Graph_Cycle_Id);
pragma Inline (Diagnose_Cycle);
-- Emit diagnostics for cycle Cycle of library graph G
procedure Find_And_Output_Invocation_Paths
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Source : Library_Graph_Vertex_Id;
Destination : Library_Graph_Vertex_Id);
pragma Inline (Find_And_Output_Invocation_Paths);
@ -69,7 +64,6 @@ package body Bindo.Diagnostics is
function Find_Elaboration_Root
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Invocation_Graph_Vertex_Id;
pragma Inline (Find_Elaboration_Root);
-- Find the elaboration root in invocation graph Inv_Graph that corresponds
@ -171,7 +165,6 @@ package body Bindo.Diagnostics is
procedure Output_Invocation_Path
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Elaborated_Vertex : Library_Graph_Vertex_Id;
Path : IGE_Lists.Doubly_Linked_List;
Path_Id : in out Nat);
@ -182,11 +175,10 @@ package body Bindo.Diagnostics is
procedure Output_Invocation_Path_Transition
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Edge : Invocation_Graph_Edge_Id);
pragma Inline (Output_Invocation_Path_Transition);
-- Output a transition through edge Edge of invocation graph G, which is
-- part of an invocation path. Lib_Graph is the related library graph.
-- part of an invocation path.
procedure Output_Invocation_Related_Suggestions
(G : Library_Graph;
@ -197,7 +189,6 @@ package body Bindo.Diagnostics is
procedure Output_Invocation_Transition
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Source : Library_Graph_Vertex_Id;
Destination : Library_Graph_Vertex_Id);
pragma Inline (Output_Invocation_Transition);
@ -222,7 +213,6 @@ package body Bindo.Diagnostics is
procedure Output_Transition
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Current_Edge : Library_Graph_Edge_Id;
Next_Edge : Library_Graph_Edge_Id;
Elaborate_All_Active : Boolean);
@ -247,7 +237,6 @@ package body Bindo.Diagnostics is
procedure Visit_Vertex
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Invoker : Invocation_Graph_Vertex_Id;
Invoker_Vertex : Library_Graph_Vertex_Id;
Last_Vertex : Library_Graph_Vertex_Id;
@ -269,10 +258,9 @@ package body Bindo.Diagnostics is
-- Diagnose_All_Cycles --
-------------------------
procedure Diagnose_All_Cycles
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph)
is
procedure Diagnose_All_Cycles (Inv_Graph : Invocation_Graph) is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
Cycle : Library_Graph_Cycle_Id;
Iter : All_Cycle_Iterator;
@ -284,10 +272,7 @@ package body Bindo.Diagnostics is
while Has_Next (Iter) loop
Next (Iter, Cycle);
Diagnose_Cycle
(Inv_Graph => Inv_Graph,
Lib_Graph => Lib_Graph,
Cycle => Cycle);
Diagnose_Cycle (Inv_Graph => Inv_Graph, Cycle => Cycle);
end loop;
end Diagnose_All_Cycles;
@ -295,10 +280,8 @@ package body Bindo.Diagnostics is
-- Diagnose_Circularities --
----------------------------
procedure Diagnose_Circularities
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph)
is
procedure Diagnose_Circularities (Inv_Graph : Invocation_Graph) is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
begin
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
@ -313,14 +296,13 @@ package body Bindo.Diagnostics is
-- switch -d_C (diagnose all cycles) is in effect.
if Debug_Flag_Underscore_CC then
Diagnose_All_Cycles (Inv_Graph, Lib_Graph);
Diagnose_All_Cycles (Inv_Graph);
-- Otherwise diagnose the most important cycle in the graph
else
Diagnose_Cycle
(Inv_Graph => Inv_Graph,
Lib_Graph => Lib_Graph,
Cycle => Highest_Precedence_Cycle (Lib_Graph));
end if;
end Diagnose_Circularities;
@ -331,9 +313,10 @@ package body Bindo.Diagnostics is
procedure Diagnose_Cycle
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Cycle : Library_Graph_Cycle_Id)
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
pragma Assert (Present (Cycle));
@ -343,7 +326,7 @@ package body Bindo.Diagnostics is
(G => Lib_Graph,
Cycle => Cycle);
Current_Edge : Library_Graph_Edge_Id;
Current_Edge : Library_Graph_Edge_Id := No_Library_Graph_Edge;
First_Edge : Library_Graph_Edge_Id;
Iter : Edges_Of_Cycle_Iterator;
Next_Edge : Library_Graph_Edge_Id;
@ -382,7 +365,6 @@ package body Bindo.Diagnostics is
Output_Transition
(Inv_Graph => Inv_Graph,
Lib_Graph => Lib_Graph,
Current_Edge => Current_Edge,
Next_Edge => Next_Edge,
Elaborate_All_Active => Elaborate_All_Active);
@ -394,7 +376,6 @@ package body Bindo.Diagnostics is
Output_Transition
(Inv_Graph => Inv_Graph,
Lib_Graph => Lib_Graph,
Current_Edge => Current_Edge,
Next_Edge => First_Edge,
Elaborate_All_Active => Elaborate_All_Active);
@ -415,10 +396,11 @@ package body Bindo.Diagnostics is
procedure Find_And_Output_Invocation_Paths
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Source : Library_Graph_Vertex_Id;
Destination : Library_Graph_Vertex_Id)
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
Path : IGE_Lists.Doubly_Linked_List;
Path_Id : Nat;
Visited : IGV_Sets.Membership_Set;
@ -449,11 +431,9 @@ package body Bindo.Diagnostics is
Visit_Vertex
(Inv_Graph => Inv_Graph,
Lib_Graph => Lib_Graph,
Invoker =>
Find_Elaboration_Root
(Inv_Graph => Inv_Graph,
Lib_Graph => Lib_Graph,
Vertex => Source),
Invoker_Vertex => Source,
Last_Vertex => Source,
@ -473,9 +453,10 @@ package body Bindo.Diagnostics is
function Find_Elaboration_Root
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Vertex : Library_Graph_Vertex_Id) return Invocation_Graph_Vertex_Id
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
Current_Vertex : Invocation_Graph_Vertex_Id;
Iter : Elaboration_Root_Iterator;
Root_Vertex : Invocation_Graph_Vertex_Id;
@ -982,11 +963,12 @@ package body Bindo.Diagnostics is
procedure Output_Invocation_Path
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Elaborated_Vertex : Library_Graph_Vertex_Id;
Path : IGE_Lists.Doubly_Linked_List;
Path_Id : in out Nat)
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
Edge : Invocation_Graph_Edge_Id;
Iter : IGE_Lists.Iterator;
@ -1007,9 +989,7 @@ package body Bindo.Diagnostics is
IGE_Lists.Next (Iter, Edge);
Output_Invocation_Path_Transition
(Inv_Graph => Inv_Graph,
Lib_Graph => Lib_Graph,
Edge => Edge);
(Inv_Graph => Inv_Graph, Edge => Edge);
end loop;
Path_Id := Path_Id + 1;
@ -1021,9 +1001,10 @@ package body Bindo.Diagnostics is
procedure Output_Invocation_Path_Transition
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Edge : Invocation_Graph_Edge_Id)
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
pragma Assert (Present (Edge));
@ -1162,7 +1143,7 @@ package body Bindo.Diagnostics is
-- within the task body on a select or accept statement, eliminating
-- subsequent invocation edges, thus breaking the cycle.
if not Restriction_Active (No_Entry_Calls_In_Elaboration_Code)
if not Cumulative_Restrictions.Set (No_Entry_Calls_In_Elaboration_Code)
and then Contains_Task_Activation (G, Cycle)
then
Error_Msg_Info
@ -1186,10 +1167,10 @@ package body Bindo.Diagnostics is
procedure Output_Invocation_Transition
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Source : Library_Graph_Vertex_Id;
Destination : Library_Graph_Vertex_Id)
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
begin
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
@ -1203,7 +1184,6 @@ package body Bindo.Diagnostics is
Find_And_Output_Invocation_Paths
(Inv_Graph => Inv_Graph,
Lib_Graph => Lib_Graph,
Source => Source,
Destination => Destination);
end Output_Invocation_Transition;
@ -1302,11 +1282,12 @@ package body Bindo.Diagnostics is
procedure Output_Transition
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Current_Edge : Library_Graph_Edge_Id;
Next_Edge : Library_Graph_Edge_Id;
Elaborate_All_Active : Boolean)
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
pragma Assert (Present (Inv_Graph));
pragma Assert (Present (Lib_Graph));
pragma Assert (Present (Current_Edge));
@ -1353,7 +1334,6 @@ package body Bindo.Diagnostics is
elsif Is_Invocation_Edge (Lib_Graph, Current_Edge) then
Output_Invocation_Transition
(Inv_Graph => Inv_Graph,
Lib_Graph => Lib_Graph,
Source => Source,
Destination => Expected_Destination);
@ -1466,7 +1446,6 @@ package body Bindo.Diagnostics is
procedure Visit_Vertex
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph;
Invoker : Invocation_Graph_Vertex_Id;
Invoker_Vertex : Library_Graph_Vertex_Id;
Last_Vertex : Library_Graph_Vertex_Id;
@ -1476,6 +1455,8 @@ package body Bindo.Diagnostics is
Path : IGE_Lists.Doubly_Linked_List;
Path_Id : in out Nat)
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (Inv_Graph);
Edge : Invocation_Graph_Edge_Id;
Iter : Edges_To_Targets_Iterator;
Targ : Invocation_Graph_Vertex_Id;
@ -1500,7 +1481,6 @@ package body Bindo.Diagnostics is
then
Output_Invocation_Path
(Inv_Graph => Inv_Graph,
Lib_Graph => Lib_Graph,
Elaborated_Vertex => Elaborated_Vertex,
Path => Path,
Path_Id => Path_Id);
@ -1531,7 +1511,6 @@ package body Bindo.Diagnostics is
Visit_Vertex
(Inv_Graph => Inv_Graph,
Lib_Graph => Lib_Graph,
Invoker => Targ,
Invoker_Vertex => Body_Vertex (Inv_Graph, Targ),
Last_Vertex => Invoker_Vertex,

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2019, Free Software Foundation, Inc. --
-- Copyright (C) 2019-2020, 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- --
@ -51,11 +51,9 @@ package Bindo.Diagnostics is
-- API --
---------
procedure Diagnose_Circularities
(Inv_Graph : Invocation_Graph;
Lib_Graph : Library_Graph);
procedure Diagnose_Circularities (Inv_Graph : Invocation_Graph);
pragma Inline (Diagnose_Circularities);
-- Diagnose all cycles of library graph Lib_Graph with matching invocation
-- graph Inv_Graph.
-- Diagnose all cycles of the library graph of Inv_Graph with matching
-- invocation graph Inv_Graph.
end Bindo.Diagnostics;

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2019, Free Software Foundation, Inc. --
-- Copyright (C) 2019-2020, 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- --
@ -733,7 +733,7 @@ package body Bindo.Elaborators is
-- order to discover transitions of the execution flow from a unit
-- to a unit that result in extra edges within the library graph.
Augment_Library_Graph (Inv_Graph, Lib_Graph);
Augment_Library_Graph (Inv_Graph);
-- Create the component graph by collapsing all library items into
-- library units and traversing the library graph.
@ -780,7 +780,7 @@ package body Bindo.Elaborators is
-- Otherwise the library graph contains at least one circularity
else
Diagnose_Circularities (Inv_Graph, Lib_Graph);
Diagnose_Circularities (Inv_Graph);
end if;
Destroy (Inv_Graph);

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2019, Free Software Foundation, Inc. --
-- Copyright (C) 2019-2020, 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- --

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2019, Free Software Foundation, Inc. --
-- Copyright (C) 2019-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2019, Free Software Foundation, Inc. --
-- Copyright (C) 2019-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2019, Free Software Foundation, Inc. --
-- Copyright (C) 2019-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2019, Free Software Foundation, Inc. --
-- Copyright (C) 2019-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2019, Free Software Foundation, Inc. --
-- Copyright (C) 2019-2020, 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- --
@ -927,6 +927,10 @@ package body Bindo.Writers is
(G : Invocation_Graph;
Vertex : Invocation_Graph_Vertex_Id)
is
Lib_Graph : constant Library_Graph := Get_Lib_Graph (G);
B : constant Library_Graph_Vertex_Id := Body_Vertex (G, Vertex);
S : constant Library_Graph_Vertex_Id := Spec_Vertex (G, Vertex);
begin
pragma Assert (Present (G));
pragma Assert (Present (Vertex));
@ -938,8 +942,9 @@ package body Bindo.Writers is
Write_Eol;
Write_Str (" Body_Vertex (LGV_Id_");
Write_Int (Int (Body_Vertex (G, Vertex)));
Write_Str (")");
Write_Int (Int (B));
Write_Str (") name = ");
Write_Name (Name (Lib_Graph, B));
Write_Eol;
Write_Str (" Construct (IC_Id_");
@ -948,8 +953,9 @@ package body Bindo.Writers is
Write_Eol;
Write_Str (" Spec_Vertex (LGV_Id_");
Write_Int (Int (Spec_Vertex (G, Vertex)));
Write_Str (")");
Write_Int (Int (S));
Write_Str (") name = ");
Write_Name (Name (Lib_Graph, S));
Write_Eol;
Write_Invocation_Graph_Edges (G, Vertex);
@ -1031,7 +1037,7 @@ package body Bindo.Writers is
-- output.
procedure Write_Components (G : Library_Graph);
pragma Inline (Write_Component);
pragma Inline (Write_Components);
-- Write all components of library graph G to standard output
procedure Write_Edges_To_Successors

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2019, Free Software Foundation, Inc. --
-- Copyright (C) 2019-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2019, Free Software Foundation, Inc. --
-- Copyright (C) 2019-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2019, Free Software Foundation, Inc. --
-- Copyright (C) 2019-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --
@ -315,6 +315,11 @@ package body Bindusg is
Write_Line
(" -x Exclude source files (check object consistency only)");
-- Line for -xdr switch
Write_Line
(" -xdr Use the XDR protocol for streaming");
-- Line for -X switch
Write_Line

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --

View File

@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
* Copyright (C) 1992-2019, Free Software Foundation, Inc. *
* Copyright (C) 1992-2020, 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- *

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1998-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1998-2020, 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- --

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --
@ -23,10 +23,10 @@
-- --
------------------------------------------------------------------------------
-- Package containing routines used to deal with runtime checks. These
-- Package containing routines used to deal with run-time checks. These
-- routines are used both by the semantics and by the expander. In some
-- cases, checks are enabled simply by setting flags for gigi, and in
-- other cases the code for the check is expanded.
-- cases, checks are enabled simply by setting a flag for the back end,
-- and in other cases the code for the check is expanded.
-- The approach used for range and length checks, in regards to suppressed
-- checks, is to attempt to detect at compilation time that a constraint
@ -48,23 +48,23 @@ package Checks is
-- Called for each new main source program, to initialize internal
-- variables used in the package body of the Checks unit.
function Access_Checks_Suppressed (E : Entity_Id) return Boolean;
function Accessibility_Checks_Suppressed (E : Entity_Id) return Boolean;
function Alignment_Checks_Suppressed (E : Entity_Id) return Boolean;
function Allocation_Checks_Suppressed (E : Entity_Id) return Boolean;
function Atomic_Synchronization_Disabled (E : Entity_Id) return Boolean;
function Discriminant_Checks_Suppressed (E : Entity_Id) return Boolean;
function Division_Checks_Suppressed (E : Entity_Id) return Boolean;
function Duplicated_Tag_Checks_Suppressed (E : Entity_Id) return Boolean;
function Elaboration_Checks_Suppressed (E : Entity_Id) return Boolean;
function Index_Checks_Suppressed (E : Entity_Id) return Boolean;
function Length_Checks_Suppressed (E : Entity_Id) return Boolean;
function Overflow_Checks_Suppressed (E : Entity_Id) return Boolean;
function Predicate_Checks_Suppressed (E : Entity_Id) return Boolean;
function Range_Checks_Suppressed (E : Entity_Id) return Boolean;
function Storage_Checks_Suppressed (E : Entity_Id) return Boolean;
function Tag_Checks_Suppressed (E : Entity_Id) return Boolean;
function Validity_Checks_Suppressed (E : Entity_Id) return Boolean;
function Access_Checks_Suppressed (E : Entity_Id) return Boolean;
function Accessibility_Checks_Suppressed (E : Entity_Id) return Boolean;
function Alignment_Checks_Suppressed (E : Entity_Id) return Boolean;
function Allocation_Checks_Suppressed (E : Entity_Id) return Boolean;
function Atomic_Synchronization_Disabled (E : Entity_Id) return Boolean;
function Discriminant_Checks_Suppressed (E : Entity_Id) return Boolean;
function Division_Checks_Suppressed (E : Entity_Id) return Boolean;
function Duplicated_Tag_Checks_Suppressed (E : Entity_Id) return Boolean;
function Elaboration_Checks_Suppressed (E : Entity_Id) return Boolean;
function Index_Checks_Suppressed (E : Entity_Id) return Boolean;
function Length_Checks_Suppressed (E : Entity_Id) return Boolean;
function Overflow_Checks_Suppressed (E : Entity_Id) return Boolean;
function Predicate_Checks_Suppressed (E : Entity_Id) return Boolean;
function Range_Checks_Suppressed (E : Entity_Id) return Boolean;
function Storage_Checks_Suppressed (E : Entity_Id) return Boolean;
function Tag_Checks_Suppressed (E : Entity_Id) return Boolean;
function Validity_Checks_Suppressed (E : Entity_Id) return Boolean;
-- These functions check to see if the named check is suppressed, either
-- by an active scope suppress setting, or because the check has been
-- specifically suppressed for the given entity. If no entity is relevant
@ -179,7 +179,7 @@ package Checks is
-- operate anyway since they may generate useful compile time warnings.
procedure Apply_Access_Check (N : Node_Id);
-- Determines whether an expression node requires a runtime access
-- Determines whether an expression node requires a run-time access
-- check and if so inserts the appropriate run-time check.
procedure Apply_Accessibility_Check
@ -200,7 +200,7 @@ package Checks is
-- generated) is prepended to the Actions list of N_Freeze_Entity node N.
-- Note that the check references E'Alignment, so it cannot be emitted
-- before N (its freeze node), otherwise this would cause an illegal
-- access before elaboration error in GIGI. For the case of a clear overlay
-- access before elaboration error in gigi. For the case of a clear overlay
-- situation, we also check that the size of the overlaying object is not
-- larger than the overlaid object.
@ -339,7 +339,7 @@ package Checks is
-- value should be taken into account, which is not the case currently.
procedure Install_Null_Excluding_Check (N : Node_Id);
-- Determines whether an access node requires a runtime access check and
-- Determines whether an access node requires a run-time access check and
-- if so inserts the appropriate run-time check.
procedure Install_Primitive_Elaboration_Check (Subp_Body : Node_Id);
@ -445,13 +445,10 @@ package Checks is
-------------------------------------------------------
-- Range checks are controlled by the Do_Range_Check flag. The front end
-- is responsible for setting this flag in relevant nodes. Originally
-- the back end generated all corresponding range checks. But later on
-- we decided to generate many range checks in the front end. We are now
-- in the transitional phase where some of these checks are still done
-- by the back end, but many are done by the front end. It is possible
-- that in the future we might move all the checks to the front end. The
-- main remaining back end checks are for subscript checking.
-- is responsible for setting this flag in relevant nodes. Originally the
-- back end generated all the corresponding range checks, but later on we
-- decided to generate all the range checks in the front end and this is
-- the current situation.
-- Overflow checks are similarly controlled by the Do_Overflow_Check flag.
-- The difference here is that if back end overflow checks are inactive
@ -529,12 +526,6 @@ package Checks is
-- this node is further examined depends on the setting of
-- the parameter Source_Typ, as described below.
-- ??? Apply_Length_Check and Apply_Range_Check do not have an Expr
-- formal
-- ??? Apply_Length_Check and Apply_Range_Check have a Ck_Node formal
-- which is undocumented, is it the same as Expr?
-- Target_Typ The target type on which the check is to be based. For
-- example, if we have a scalar range check, then the check
-- is that we are in range of this type.
@ -561,7 +552,7 @@ package Checks is
-- handled by the caller.
procedure Apply_Length_Check
(Ck_Node : Node_Id;
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id := Empty);
-- This procedure builds a sequence of declarations to do a length check
@ -578,10 +569,29 @@ package Checks is
-- processes it as described above for consistency with the other routines
-- in this section.
procedure Apply_Range_Check
(Ck_Node : Node_Id;
procedure Apply_Length_Check_On_Assignment
(Expr : Node_Id;
Target_Typ : Entity_Id;
Target : Node_Id;
Source_Typ : Entity_Id := Empty);
-- Similar to Apply_Length_Check, but takes the target of an assignment for
-- which the check is to be done. Used to filter out specific cases where
-- the check is superfluous.
procedure Apply_Static_Length_Check
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id := Empty);
-- Tries to determine statically whether the two array types source type
-- and Target_Typ have the same length. If it can be determined at compile
-- time that they do not, then an N_Raise_Constraint_Error node replaces
-- Expr, and a warning message is issued.
procedure Apply_Range_Check
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id := Empty;
Insert_Node : Node_Id := Empty);
-- For a Node of kind N_Range, constructs a range check action that tests
-- first that the range is not null and then that the range is contained in
-- the Target_Typ range.
@ -606,14 +616,8 @@ package Checks is
-- The source type is used by type conversions to unconstrained array
-- types to retrieve the corresponding bounds.
procedure Apply_Static_Length_Check
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id := Empty);
-- Tries to determine statically whether the two array types source type
-- and Target_Typ have the same length. If it can be determined at compile
-- time that they do not, then an N_Raise_Constraint_Error node replaces
-- Expr, and a warning message is issued.
-- Insert_Node indicates the node where the check should be inserted.
-- If it is empty, then the check is inserted directly at Expr instead.
procedure Apply_Scalar_Range_Check
(Expr : Node_Id;
@ -621,7 +625,7 @@ package Checks is
Source_Typ : Entity_Id := Empty;
Fixed_Int : Boolean := False);
-- For scalar types, determines whether an expression node should be
-- flagged as needing a runtime range check. If the node requires such a
-- flagged as needing a run-time range check. If the node requires such a
-- check, the Do_Range_Check flag is turned on. The Fixed_Int flag if set
-- causes any fixed-point values to be treated as though they were discrete
-- values (i.e. the underlying integer value is used).
@ -631,7 +635,7 @@ package Checks is
-- call to Insert_Range_Checks procedure.
function Get_Range_Checks
(Ck_Node : Node_Id;
(Expr : Node_Id;
Target_Typ : Entity_Id;
Source_Typ : Entity_Id := Empty;
Warn_Node : Node_Id := Empty) return Check_Result;
@ -646,49 +650,37 @@ package Checks is
(Checks : Check_Result;
Stmts : List_Id;
Suppress_Typ : Entity_Id;
Static_Sloc : Source_Ptr;
Flag_Node : Node_Id);
Static_Sloc : Source_Ptr);
-- Called to append range checks as returned by a call to Get_Range_Checks.
-- Stmts is a list to which either the dynamic check is appended or the
-- raise Constraint_Error statement is appended (for static checks).
-- Static_Sloc is the Sloc at which the raise CE node points, Flag_Node is
-- used as the node at which to set the Has_Dynamic_Check flag. Checks_On
-- is a boolean value that says if range and index checking is on or not.
-- Suppress_Typ is the type to check to determine if checks are suppressed.
-- Static_Sloc is the Sloc at which the raise CE node points.
procedure Insert_Range_Checks
(Checks : Check_Result;
Node : Node_Id;
Suppress_Typ : Entity_Id;
Static_Sloc : Source_Ptr := No_Location;
Flag_Node : Node_Id := Empty;
Do_Before : Boolean := False);
Static_Sloc : Source_Ptr;
Do_Before : Boolean := False);
-- Called to insert range checks as returned by a call to Get_Range_Checks.
-- Node is the node after which either the dynamic check is inserted or
-- the raise Constraint_Error statement is inserted (for static checks).
-- Suppress_Typ is the type to check to determine if checks are suppressed.
-- Static_Sloc, if passed, is the Sloc at which the raise CE node points,
-- otherwise Sloc (Node) is used. The Has_Dynamic_Check flag is normally
-- set at Node. If Flag_Node is present, then this is used instead as the
-- node at which to set the Has_Dynamic_Check flag. Normally the check is
-- inserted after, if Do_Before is True, the check is inserted before
-- Node.
-- Static_Sloc is the Sloc at which the raise CE node points. Normally the
-- checks are inserted after Node; if Do_Before is True, they are before.
-----------------------
-- Expander Routines --
-----------------------
-- Some of the earlier processing for checks results in temporarily setting
-- the Do_Range_Check flag rather than actually generating checks. Now we
-- are moving the generation of such checks into the front end for reasons
-- of efficiency and simplicity (there were difficulties in handling this
-- in the back end when side effects were present in the expressions being
-- checked).
-- Probably we could eliminate the Do_Range_Check flag entirely and
-- generate the checks earlier, but this is a delicate area and it
-- seemed safer to implement the following routines, which are called
-- late on in the expansion process. They check the Do_Range_Check flag
-- and if it is set, generate the actual checks and reset the flag.
-- In most cases, the processing for range checks done by semantic analysis
-- only results in setting the Do_Range_Check flag, rather than actually
-- generating checks. The following routines must be called later on in the
-- expansion process upon seeing the Do_Range_Check flag; they generate the
-- actual checks and reset the flag. The remaining cases where range checks
-- are still directly generated during semantic analysis occur as part of
-- the processing of constraints in (sub)type and object declarations.
procedure Generate_Range_Check
(N : Node_Id;
@ -702,11 +694,11 @@ package Checks is
-- if raised.
--
-- Note: if the expander is not active, or if we are in GNATprove mode,
-- then we do not generate explicit range code. Instead we just turn the
-- then we do not generate explicit range checks. Instead we just turn the
-- Do_Range_Check flag on, since in these cases that's what we want to see
-- in the tree (GNATprove in particular depends on this flag being set). If
-- we generate the actual range check, then we make sure the flag is off,
-- since the code we generate takes complete care of the check.
-- we generate the actual range checks, then we make sure the flag is off
-- afterward, since the code we generate takes complete care of the checks.
--
-- Historical note: We used to just pass on the Do_Range_Check flag to the
-- back end to generate the check, but now in code-generation mode we never

View File

@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
* Copyright (C) 1992-2019, Free Software Foundation, Inc. *
* Copyright (C) 1992-2020, 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- *

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 2003-2019, Free Software Foundation, Inc. --
-- Copyright (C) 2003-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 2003-2019, Free Software Foundation, Inc. --
-- Copyright (C) 2003-2020, 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- --

View File

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --
@ -310,8 +310,8 @@ package body Comperr is
End_Line;
Write_Str
("| http://www.adacore.com/ " &
"section 'send a report'.");
("| https://www.adacore.com/login?mode=gap " &
"section 'Create New Ticket'.");
End_Line;
Write_Str
@ -325,17 +325,17 @@ package body Comperr is
End_Line;
Write_Str
("| http://www.adacore.com/gnattracker/ " &
"section 'send a report'.");
("| https://www.adacore.com/login " &
"section 'Create New Ticket'.");
End_Line;
Write_Str
("| alternatively submit a bug report by email " &
"to report@adacore.com,");
("| Or submit a bug report by email " &
"to report@adacore.com");
End_Line;
Write_Str
("| including your customer number #nnn " &
("| and include your customer number #nnn " &
"in the subject line.");
End_Line;
end if;

View File

@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
-- Copyright (C) 1992-2019, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2020, 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- --

Some files were not shown because too many files have changed in this diff Show More