CodeGen: Remove unnecessary const_casts. No functionality change.