I'd rather accumulate flags while compiling the shader rather than doing another pass at the end. Not a terribly strong opinion, though.
In principle I'd be inclined to agree, but this approach seems appropriate this close to the release. Ultimately the tpf writer should get this from the vsir_program, of course.