more reliably across platforms. Patch by Tom Roeder! llvm-svn: 191343
Patch by Tom Roeder! llvm-svn: 191042