Patch from Todd Fiala for http://llvm.org/bugs/show_bug.cgi?id=17961