Patch by Dmitry Vyukov <dvyukov@google.com>. Also add the relevant files to the Xcode project. llvm-svn: 150991