diff options
Diffstat (limited to 'backendC')
-rw-r--r-- | backendC/CleanCompilerSources/checksupport.c | 2 | ||||
-rw-r--r-- | backendC/CleanCompilerSources/checksupport.h | 2 | ||||
-rw-r--r-- | backendC/CleanCompilerSources/codegen.c | 1 | ||||
-rw-r--r-- | backendC/CleanCompilerSources/optimisations.c | 22 |
4 files changed, 24 insertions, 3 deletions
diff --git a/backendC/CleanCompilerSources/checksupport.c b/backendC/CleanCompilerSources/checksupport.c index a5ac666..9605040 100644 --- a/backendC/CleanCompilerSources/checksupport.c +++ b/backendC/CleanCompilerSources/checksupport.c @@ -284,7 +284,7 @@ static char *PrintTypesOfSymbol (char *type_repr, File file, ModuleInfo module_i } /* PrintTypesOfSymbol */ -#define _ANALYSE_IDENT_ +#define _ANALYSE_IDENT_ /* also in optimisations.c */ #ifndef CLEAN2 #define _ANALYSE_INSTANCE_TYPES_ #endif diff --git a/backendC/CleanCompilerSources/checksupport.h b/backendC/CleanCompilerSources/checksupport.h index bb70209..60759d2 100644 --- a/backendC/CleanCompilerSources/checksupport.h +++ b/backendC/CleanCompilerSources/checksupport.h @@ -1,5 +1,5 @@ -#define cTypeDelimiter ';' +#define cTypeDelimiter ';' /* also in optimisations.c */ #define cTypeFirstArg '<' #define cTypeLastArg '>' diff --git a/backendC/CleanCompilerSources/codegen.c b/backendC/CleanCompilerSources/codegen.c index e85fc5e..d3dba60 100644 --- a/backendC/CleanCompilerSources/codegen.c +++ b/backendC/CleanCompilerSources/codegen.c @@ -26,6 +26,7 @@ # if TAIL_CALL_MODULO_TUPLE_CONS_OPTIMIZATION #include "tuple_tail_recursion.h" # endif +#include "dbprint.h" static char *ECodeBlock = "incorrect number of output parameters"; 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; } |