1. A method implemented with at least one processor equipped with memory units having stored thereon executable program instructions, which when executed by the processor, cause the processor to perform the method steps, comprising: providing a first graphical model representing a system, the first graphical model being in a source language compatible with a graphical programming environment; converting, with a computing device, the first graphical model into an intermediate representation (IR), data contained in the IR being non-specific to the source language of the first graphical model, and converting the first graphical model into the IR including: generating records associated with the IR, the records describing blocks and connections analyzed from a source file associated with the first graphical model; performing an optimization transformation on the IR to produce an altered IR by exposing the IR to another programming environment, the other programming environment being different from the graphical programming environment, and producing the altered IR altering the records associated with the IR, the altered records including information that indicates modifications that produce the altered IR; generating, using the computing device, a second graphical model based on the first graphical model and the altered records.