const correctness in codegen