Lines Matching refs:Constants
69 struct rc_constant *constants = c->Program.Constants.Constants;
73 if (!c->Program.Constants.Count) {
78 const_used = malloc(c->Program.Constants.Count);
79 memset(const_used, 0, c->Program.Constants.Count);
84 /* Pass 1: Mark used constants. */
93 for (unsigned i = 0; i < c->Program.Constants.Count; i++)
94 if (constants[i].Type == RC_CONSTANT_EXTERNAL)
98 /* Pass 3: Make the remapping table and remap constants.
99 * This pass removes unused constants simply by overwriting them by other constants. */
100 remap_table = malloc(c->Program.Constants.Count * sizeof(unsigned));
101 inv_remap_table = malloc(c->Program.Constants.Count * sizeof(unsigned));
104 for (unsigned i = 0; i < c->Program.Constants.Count; i++) {
110 if (constants[i].Type == RC_CONSTANT_EXTERNAL)
113 constants[new_count] = constants[i];
122 assert( is_identity || new_count < c->Program.Constants.Count);
125 /* Pass 4: Redirect reads of all constants to their new locations. */
135 * the constants have been removed at the end of the array. */
136 c->Program.Constants.Count = new_count;
149 rc_constants_print(&c->Program.Constants);