CodeGenerator: Order variable declaration

Change-Id: Ib0a2129357814f7e4e3de4488ae96a8ddea32ee0