Reapply r129401 with patch for clang.