From 0e06d2b3f7ba8b70239995de3630bc06b8b5f183 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Thu, 18 Aug 2016 00:13:26 +0000 Subject: [PATCH] input.c: move test functions within #CHECKING_P and into selftest:: gcc/ChangeLog: * input.c (get_source_range_for_char): Rename to... (selftest::get_source_range_for_char): ...this, and move within the #if CHECKING_P guard. (get_num_source_ranges_for_substring): Rename to... (selftest::get_num_source_ranges_for_substring): ...this, move within the #if CHECKING_P guard, and make static. (selftest::assert_num_substring_ranges): Initialize actual_num_ranges. From-SVN: r239550 --- gcc/ChangeLog | 11 +++++++++++ gcc/input.c | 14 ++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e09cdeafe6b..42d404baab8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2016-08-17 David Malcolm + + * input.c (get_source_range_for_char): Rename to... + (selftest::get_source_range_for_char): ...this, and move within + the #if CHECKING_P guard. + (get_num_source_ranges_for_substring): Rename to... + (selftest::get_num_source_ranges_for_substring): ...this, move + within the #if CHECKING_P guard, and make static. + (selftest::assert_num_substring_ranges): Initialize + actual_num_ranges. + 2016-08-18 Alan Modra PR rtl-optimization/72771 diff --git a/gcc/input.c b/gcc/input.c index 10cab77359d..172d13a8ad7 100644 --- a/gcc/input.c +++ b/gcc/input.c @@ -1454,6 +1454,12 @@ get_source_location_for_substring (cpp_reader *pfile, return NULL; } +#if CHECKING_P + +namespace selftest { + +/* Selftests of location handling. */ + /* Attempt to populate *OUT_RANGE with source location information on the given character within the string literal found at STRLOC. CHAR_IDX refers to an offset within the execution character set. @@ -1493,7 +1499,7 @@ get_source_range_for_char (cpp_reader *pfile, /* As get_source_range_for_char, but write to *OUT the number of ranges that are available. */ -const char * +static const char * get_num_source_ranges_for_substring (cpp_reader *pfile, string_concat_db *concats, location_t strloc, @@ -1513,10 +1519,6 @@ get_num_source_ranges_for_substring (cpp_reader *pfile, return NULL; } -#if CHECKING_P - -namespace selftest { - /* Selftests of location handling. */ /* Helper function for verifying location data: when location_t @@ -2039,7 +2041,7 @@ assert_num_substring_ranges (const location &loc, cpp_reader *pfile = test.m_parser; string_concat_db *concats = &test.m_concats; - int actual_num_ranges; + int actual_num_ranges = -1; const char *err = get_num_source_ranges_for_substring (pfile, concats, strloc, type, &actual_num_ranges); -- 2.30.2