Ted Kremenek, another longtime Apple developer who has been with the company since 2007, will be taking over Lattner's duties as Swift project lead.
Lattner has worked at Apple since 2005, and he's been involved in a lot of major tools and software initiatives over the years. His extensive resume lists many versions of Xcode going back to at least version 3.1, LLVM and the Clang frontend, OpenCL, LLDB, and Swift. He also did some work on macOS, helped tune software performance for the Apple A6 used in the iPhone 5, and helped with the transition to 64-bit ARM CPUs that began with the iPhone 5S. His resume shows a willingness to create, adopt, and evangelize new software and programming languages, which will no doubt be a component of his work at Tesla. He has also been a major proponent of Apple's open source work, driving the push to make Swift open source and communicating with the Swift community and steering its efforts.
Tesla's Elon Musk clearly views his company as the more appealing place to work right now; he has said that "if you don't make it at Tesla, you go work at Apple," and has referred to Apple as the "Tesla Graveyard." The company's Autopilot software currently merely assists drivers, but Tesla's stated intent is to make its cars capable of fully self-driving as early as this year.