ruiu added a comment. What is the problem you are trying to fix? The current code is working fine for both non-Windows and Windows. This patch would make this function very slow on Windows. Repository: rL LLVM http://reviews.llvm.org/D19982