Changeset 2591 for trunk/src/kmk/incdep.c
- Timestamp:
- Jun 17, 2012, 10:45:31 PM (13 years ago)
- Location:
- trunk/src/kmk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk
- Property svn:ignore
-
old new 13 13 stamp-* 14 14 makebook* 15 15 16 .*gdbinit 17 .gdb_history 18 16 19 *.dep 17 20 *.dvi … … 31 34 *.pg 32 35 *.pgs 36 33 37 README 34 38 README.DOS 35 39 README.W32 40 README.OS2 36 41 aclocal.m4 37 42 autom4te.cache … … 52 57 config.h.W32 53 58 config.h-vms 59 54 60 loadavg 55 61 loadavg.c 56 62 make 63 57 64 .deps 58 65 .dep_segment 66 ID 67 TAGS 68 59 69 _* 60 70 sun4 … … 72 82 sol2 73 83 i486-linux 84 74 85 customs 86 75 87 install-sh 76 88 mkinstalldirs 89 90 .directive.asc
-
- Property svn:ignore
-
trunk/src/kmk/incdep.c
r2546 r2591 114 114 }; 115 115 116 struct incdep_recorded_file s117 { 118 struct incdep_recorded_file s*next;116 struct incdep_recorded_file 117 { 118 struct incdep_recorded_file *next; 119 119 120 120 /* the parameters */ 121 121 struct strcache2_entry *filename_entry; /* dep strcache; converted to a nameseq record. */ 122 const char *pattern; /* NULL */123 const char *pattern_percent; /* NULL */124 122 struct dep *deps; /* All the names are dep strcache entries. */ 125 unsigned int cmds_started; /* 0 */126 char *commands; /* NULL */127 unsigned int commands_idx; /* 0 */128 int two_colon; /* 0 */129 123 const struct floc *flocp; /* NILF */ 130 124 }; … … 149 143 struct incdep_variable_def *recorded_variable_defs_tail; 150 144 151 struct incdep_recorded_file s *recorded_files_head;152 struct incdep_recorded_file s *recorded_files_tail;145 struct incdep_recorded_file *recorded_file_head; 146 struct incdep_recorded_file *recorded_file_tail; 153 147 #endif 154 148 … … 232 226 static void incdep_flush_it (struct floc *); 233 227 static void eval_include_dep_file (struct incdep *, struct floc *); 228 static void incdep_commit_recorded_file (const char *filename, struct dep *deps, 229 const struct floc *flocp); 234 230 235 231 … … 501 497 assert (!cur->recorded_variables_in_set_head); 502 498 assert (!cur->recorded_variable_defs_head); 503 assert (!cur->recorded_file s_head);499 assert (!cur->recorded_file_head); 504 500 #endif 505 501 … … 727 723 if (rec_size < sizeof (struct incdep_variable_def)) 728 724 rec_size = sizeof (struct incdep_variable_def); 729 if (rec_size < sizeof (struct incdep_recorded_file s))730 rec_size = sizeof (struct incdep_recorded_file s);725 if (rec_size < sizeof (struct incdep_recorded_file)) 726 rec_size = sizeof (struct incdep_recorded_file); 731 727 alloccache_init (&incdep_rec_caches[i], rec_size, "incdep rec", 732 728 incdep_cache_allocator, (void *)(size_t)i); … … 849 845 struct incdep_variable_in_set *rec_vis; 850 846 struct incdep_variable_def *rec_vd; 851 struct incdep_recorded_file s*rec_f;847 struct incdep_recorded_file *rec_f; 852 848 853 849 /* define_variable_in_set */ … … 898 894 /* record_files */ 899 895 900 rec_f = cur->recorded_file s_head;901 cur->recorded_file s_head = cur->recorded_files_tail = NULL;896 rec_f = cur->recorded_file_head; 897 cur->recorded_file_head = cur->recorded_file_tail = NULL; 902 898 if (rec_f) 903 899 do … … 905 901 void *free_me = rec_f; 906 902 struct dep *dep; 907 struct nameseq *filenames;908 903 909 904 for (dep = rec_f->deps; dep; dep = dep->next) 910 905 dep->name = incdep_flush_strcache_entry ((struct strcache2_entry *)dep->name); 911 906 912 filenames = (struct nameseq *) alloccache_alloc (&nameseq_cache); 913 filenames->next = 0; 914 filenames->name = incdep_flush_strcache_entry (rec_f->filename_entry); 915 916 record_files (filenames, 917 rec_f->pattern, 918 rec_f->pattern_percent, 919 rec_f->deps, 920 rec_f->cmds_started, 921 rec_f->commands, 922 rec_f->commands_idx, 923 rec_f->two_colon, 924 rec_f->flocp); 907 incdep_commit_recorded_file (incdep_flush_strcache_entry (rec_f->filename_entry), 908 rec_f->deps, 909 rec_f->flocp); 925 910 926 911 rec_f = rec_f->next; … … 1074 1059 } 1075 1060 1076 /* Record files.*/1061 /* Similar to record_files in read.c, only much much simpler. */ 1077 1062 static void 1078 incdep_record_files (struct incdep *cur, 1079 const char *filename, const char *pattern, 1080 const char *pattern_percent, struct dep *deps, 1081 unsigned int cmds_started, char *commands, 1082 unsigned int commands_idx, int two_colon, 1083 const struct floc *flocp) 1063 incdep_commit_recorded_file (const char *filename, struct dep *deps, 1064 const struct floc *flocp) 1065 { 1066 struct file *f; 1067 1068 /* Perform some validations. */ 1069 if (filename[0] == '.' 1070 && ( streq(filename, ".POSIX") 1071 || streq(filename, ".EXPORT_ALL_VARIABLES") 1072 || streq(filename, ".INTERMEDIATE") 1073 || streq(filename, ".LOW_RESOLUTION_TIME") 1074 || streq(filename, ".NOTPARALLEL") 1075 || streq(filename, ".ONESHELL") 1076 || streq(filename, ".PHONY") 1077 || streq(filename, ".PRECIOUS") 1078 || streq(filename, ".SECONDARY") 1079 || streq(filename, ".SECONDTARGETEXPANSION") 1080 || streq(filename, ".SILENT") 1081 || streq(filename, ".SHELLFLAGS") 1082 || streq(filename, ".SUFFIXES") 1083 ) 1084 ) 1085 { 1086 error (flocp, _("reserved filename '%s' used in dependency file, ignored"), filename); 1087 return; 1088 } 1089 1090 /* Lookup or create an entry in the database. */ 1091 f = enter_file (filename); 1092 if (f->double_colon) 1093 { 1094 error (flocp, _("dependency file '%s' has a double colon entry already, ignoring"), filename); 1095 return; 1096 } 1097 f->is_target = 1; 1098 1099 /* Append dependencies. */ 1100 deps = enter_prereqs (deps, NULL); 1101 if (deps) 1102 { 1103 struct dep *last = f->deps; 1104 if (!last) 1105 f->deps = deps; 1106 else 1107 { 1108 while (last->next) 1109 last = last->next; 1110 last->next = deps; 1111 } 1112 } 1113 } 1114 1115 /* Record a file.*/ 1116 static void 1117 incdep_record_file (struct incdep *cur, 1118 const char *filename, 1119 struct dep *deps, 1120 const struct floc *flocp) 1084 1121 { 1085 1122 if (cur->worker_tid == -1) 1086 { 1087 struct nameseq *filenames = (struct nameseq *) alloccache_alloc (&nameseq_cache); 1088 filenames->next = 0; 1089 filenames->name = filename; 1090 record_files (filenames, pattern, pattern_percent, deps, cmds_started, 1091 commands, commands_idx, two_colon, flocp); 1092 } 1123 incdep_commit_recorded_file (filename, deps, flocp); 1093 1124 #ifdef PARSE_IN_WORKER 1094 1125 else 1095 1126 { 1096 struct incdep_recorded_file s*rec =1097 (struct incdep_recorded_file s*) incdep_alloc_rec (cur);1127 struct incdep_recorded_file *rec = 1128 (struct incdep_recorded_file *) incdep_alloc_rec (cur); 1098 1129 1099 1130 rec->filename_entry = (struct strcache2_entry *)filename; 1100 rec->pattern = pattern;1101 rec->pattern_percent = pattern_percent;1102 1131 rec->deps = deps; 1103 rec->cmds_started = cmds_started;1104 rec->commands = commands;1105 rec->commands_idx = commands_idx;1106 rec->two_colon = two_colon;1107 1132 rec->flocp = flocp; 1108 1133 1109 1134 rec->next = NULL; 1110 if (cur->recorded_file s_tail)1111 cur->recorded_file s_tail->next = rec;1135 if (cur->recorded_file_tail) 1136 cur->recorded_file_tail->next = rec; 1112 1137 else 1113 cur->recorded_file s_head = rec;1114 cur->recorded_file s_tail = rec;1138 cur->recorded_file_head = rec; 1139 cur->recorded_file_tail = rec; 1115 1140 } 1116 1141 #endif … … 1531 1556 1532 1557 /* enter the file with its dependencies. */ 1533 incdep_record_files (curdep, 1534 filename, NULL, NULL, deps, 0, NULL, 0, 0, f); 1558 incdep_record_file (curdep, filename, deps, f); 1535 1559 } 1536 1560 } … … 1630 1654 cur->recorded_variable_defs_head = NULL; 1631 1655 cur->recorded_variable_defs_tail = NULL; 1632 cur->recorded_file s_head = NULL;1633 cur->recorded_file s_tail = NULL;1656 cur->recorded_file_head = NULL; 1657 cur->recorded_file_tail = NULL; 1634 1658 #endif 1635 1659
Note:
See TracChangeset
for help on using the changeset viewer.