Home | History | Annotate | Download | only in compiler

Lines Matching defs:constants

70 	struct rc_constant *constants = c->Program.Constants.Constants;
74 if (!c->Program.Constants.Count) {
79 const_used = malloc(c->Program.Constants.Count);
80 memset(const_used, 0, c->Program.Constants.Count);
85 /* Pass 1: Mark used constants. */
94 for (unsigned i = 0; i < c->Program.Constants.Count; i++)
95 if (constants[i].Type == RC_CONSTANT_EXTERNAL)
99 /* Pass 3: Make the remapping table and remap constants.
100 * This pass removes unused constants simply by overwriting them by other constants. */
101 remap_table = malloc(c->Program.Constants.Count * sizeof(unsigned));
102 inv_remap_table = malloc(c->Program.Constants.Count * sizeof(unsigned));
105 for (unsigned i = 0; i < c->Program.Constants.Count; i++) {
111 if (constants[i].Type == RC_CONSTANT_EXTERNAL)
114 constants[new_count] = constants[i];
123 assert( is_identity || new_count < c->Program.Constants.Count);
126 /* Pass 4: Redirect reads of all constants to their new locations. */
136 * the constants have been removed at the end of the array. */
137 c->Program.Constants.Count = new_count;
150 rc_constants_print(&c->Program.Constants);