aboutsummaryrefslogtreecommitdiff
path: root/backendC/CleanCompilerSources/optimisations.c
diff options
context:
space:
mode:
authorronny2001-05-01 10:09:04 +0000
committerronny2001-05-01 10:09:04 +0000
commitb81e677eca6d5c00148d5738b0e67458eaed74ee (patch)
treecd62021b90105be6a747a264b25e41bef2890632 /backendC/CleanCompilerSources/optimisations.c
parentUse CompAlloc for memory allocation in backend.c (diff)
made name generation depend on _ANALYSE_IDENT_
marked duplicate definitions of cTypeDelimiter _ANALYSE_IDENT_ git-svn-id: https://svn.cs.ru.nl/repos/clean-compiler/trunk@375 1f8540f1-abd5-4d5b-9d24-4c5ce8603e2d
Diffstat (limited to 'backendC/CleanCompilerSources/optimisations.c')
-rw-r--r--backendC/CleanCompilerSources/optimisations.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/backendC/CleanCompilerSources/optimisations.c b/backendC/CleanCompilerSources/optimisations.c
index 3d41f1d..a327daa 100644
--- a/backendC/CleanCompilerSources/optimisations.c
+++ b/backendC/CleanCompilerSources/optimisations.c
@@ -1034,7 +1034,8 @@ static void init_apply_symb_function_state_p()
}
#endif
-#define cTypeDelimiter ';'
+#define cTypeDelimiter ';' /* also in checksupport.h */
+#define _ANALYSE_IDENT_ /* also in checksupport.c */
static int compute_length_before_type_delimiter (char *fname)
{
@@ -1043,11 +1044,30 @@ static int compute_length_before_type_delimiter (char *fname)
p=fname;
+#ifdef _ANALYSE_IDENT_
--p;
do {
c=*++p;
} while (c!=cTypeDelimiter && c!='\0');
+ if (c == cTypeDelimiter && *(p+1) != '\0')
+ {
+ p++;
+
+ if (isdigit (*p))
+ {
+ for (p = p+1; *p != cTypeDelimiter && *p != '\0'; p++)
+ ;
+ }
+ }
+#else /* ifndef _ANALYSE_IDENT_ */
+ --p;
+ do {
+ c=*++p;
+ } while (c!='\0');
+
+#endif /* _ANALYSE_IDENT_ */
+
return p-fname;
}