This reverts commit 50f61af3, it used the function introduced in the previous revert of 0bddef79. llvm-svn: 362826