I reverted the error check that was removed in 236416. I put the it in a separate file. llvm-svn: 237107