summaryrefslogtreecommitdiff
path: root/gcc/input.c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2016-08-18 00:13:26 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2016-08-18 00:13:26 +0000
commit0e06d2b3f7ba8b70239995de3630bc06b8b5f183 (patch)
tree22b9ace76a1c76297607199f1f111d0c3bb9a33e /gcc/input.c
parent66592e95db41216e6fb1d76a831f8efa6bcf0d6f (diff)
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
Diffstat (limited to 'gcc/input.c')
-rw-r--r--gcc/input.c14
1 files changed, 8 insertions, 6 deletions
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);