aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@gcc.gnu.org>2011-04-29 00:19:35 +0000
committerXinliang David Li <davidxl@gcc.gnu.org>2011-04-29 00:19:35 +0000
commit10adac5108a971b2e4949508728251e587450595 (patch)
treed953d6304eb53816e1ea571fc8d365f55655d39a /gcc/tree.c
parent112cee354d70b375f142e342d79a5ddb93f3a0fd (diff)
downloadgcc-10adac5108a971b2e4949508728251e587450595.zip
gcc-10adac5108a971b2e4949508728251e587450595.tar.gz
gcc-10adac5108a971b2e4949508728251e587450595.tar.bz2
split checksum into cfg checksum and line checksum
From-SVN: r173147
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index b175221..ba90df8 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -8510,14 +8510,12 @@ dump_tree_statistics (void)
#define FILE_FUNCTION_FORMAT "_GLOBAL__%s_%s"
-/* Generate a crc32 of a string. */
+/* Generate a crc32 of a byte. */
unsigned
-crc32_string (unsigned chksum, const char *string)
+crc32_byte (unsigned chksum, char byte)
{
- do
- {
- unsigned value = *string << 24;
+ unsigned value = (unsigned) byte << 24;
unsigned ix;
for (ix = 8; ix--; value <<= 1)
@@ -8528,6 +8526,18 @@ crc32_string (unsigned chksum, const char *string)
chksum <<= 1;
chksum ^= feedback;
}
+ return chksum;
+}
+
+
+/* Generate a crc32 of a string. */
+
+unsigned
+crc32_string (unsigned chksum, const char *string)
+{
+ do
+ {
+ chksum = crc32_byte (chksum, *string);
}
while (*string++);
return chksum;
@@ -8551,8 +8561,10 @@ clean_symbol_name (char *p)
*p = '_';
}
-/* Generate a name for a special-purpose function function.
+/* Generate a name for a special-purpose function.
The generated name may need to be unique across the whole link.
+ Changes to this function may also require corresponding changes to
+ xstrdup_mask_random.
TYPE is some string to identify the purpose of this function to the
linker or collect2; it must start with an uppercase letter,
one of: