pike.git
/
src
/
program.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/program.c:2366:
p->identifiers[i].run_time_type = T_FUNCTION; } } /* Fixup identifier overrides. */ for (i = 0; i < p->num_identifier_references; i++) { struct reference *ref = p->identifier_references + i; if (ref->id_flags & ID_HIDDEN) continue; if (ref->inherit_offset != 0) continue; override_identifier (ref, ID_FROM_PTR (p, ref)->name);
-
-
if ((ref->id_flags & (ID_HIDDEN|ID_PRIVATE|ID_USED)) == ID_PRIVATE) {
-
yywarning("%S is private but not used anywhere.",
-
ID_FROM_PTR(p, ref)->name);
+
}
-
}
+
/* Ok, sort for binsearch */ for(e=i=0;i<(int)p->num_identifier_references;i++) { struct reference *funp; struct identifier *fun; funp=p->identifier_references+i; if(funp->id_flags & ID_HIDDEN) continue; fun=ID_FROM_PTR(p, funp); if(funp->id_flags & ID_INHERITED)
pike.git/src/program.c:2489:
id = probe; } p->num_identifier_index = i; } p->flags |= PROGRAM_FIXED; /* Yes, it is supposed to start at 1 /Hubbe */ for(i=1;i<NUM_LFUNS;i++) { int id = p->lfuns[i] = low_find_lfun(p, i);
+
if (id >= 0) {
+
// LFUNs are used.
+
p->identifier_references[id].id_flags |= ID_USED;
}
-
+
}
-
+
/* Complain about unused private symbols. */
+
for (i = 0; i < p->num_identifier_references; i++) {
+
struct reference *ref = p->identifier_references + i;
+
if (ref->id_flags & ID_HIDDEN) continue;
+
if (ref->inherit_offset != 0) continue;
+
+
if ((ref->id_flags & (ID_HIDDEN|ID_PRIVATE|ID_USED)) == ID_PRIVATE) {
+
yywarning("%S is private but not used anywhere.",
+
ID_FROM_PTR(p, ref)->name);
+
}
+
}
+
/* Set the PROGRAM_LIVE_OBJ flag by looking for destroy() and * inherited PROGRAM_LIVE_OBJ flags. This is done at fixation time * to allow the user to set and clear that flag while the program is * being built. */ if (!(p->flags & PROGRAM_LIVE_OBJ)) { int e, destroy = p->lfuns[LFUN_DESTROY]; if (destroy > -1) { struct identifier *id = ID_FROM_INT (p, destroy); if (!IDENTIFIER_IS_PIKE_FUNCTION (id->identifier_flags) || id->func.offset != -1) {