summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/regengine.inc
Commit message (Collapse)AuthorAgeFilesLines
* [ADT] Replace std::isprint by llvm::isPrint.Michael Kruse2018-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The standard library functions ::isprint/std::isprint have platform- and locale-dependent behavior which makes LLVM's output less predictable. In particular, regression tests my fail depending on the implementation of these functions. Implement llvm::isPrint in StringExtras.h with a standard behavior and replace all uses of ::isprint/std::isprint by a call it llvm::isPrint. The function is inlined and does not look up language settings so it should perform better than the standard library's version. Such a replacement has already been done for isdigit, isalpha, isxdigit in r314883. gtest does the same in gtest-printers.cc using the following justification: // Returns true if c is a printable ASCII character. We test the // value of c directly instead of calling isprint(), which is buggy on // Windows Mobile. inline bool IsPrintableAscii(wchar_t c) { return 0x20 <= c && c <= 0x7E; } Similar issues have also been encountered by Julia: https://github.com/JuliaLang/julia/issues/7416 I noticed the problem myself when on Windows isprint('\t') started to evaluate to true (see https://stackoverflow.com/questions/51435249) and thus caused several unit tests to fail. The result of isprint doesn't seem to be well-defined even for ASCII characters. Therefore I suggest to replace isprint by a platform-independent version. Differential Revision: https://reviews.llvm.org/D49680 llvm-svn: 338034
* Clean up language and grammar.Eric Christopher2014-05-201-1/+1
| | | | | | | Based on a patch by jfcaron3@gmail.com! PR19806 llvm-svn: 209216
* Various MSVC warning fixes about truncated 64 bit shifts and const pointers ↵Benjamin Kramer2010-04-081-1/+1
| | | | | | passed to free. llvm-svn: 100767
* Push const through the regex engine. Fixes some of the warnings in PR6616.Owen Anderson2010-04-051-42/+49
| | | | llvm-svn: 100438
* Avoid warnings if assertions are off.Duncan Sands2009-09-061-0/+3
| | | | llvm-svn: 81127
* Remove some not-really-used variables, as warnedDuncan Sands2009-09-061-6/+9
| | | | | | about by icc (#593, partial). Patch by Erick Tryzelaar. llvm-svn: 81115
* Add regular expression matching support, based on OpenBSD regexec()/regcomp()Torok Edwin2009-08-301-0/+1021
implementation. llvm-svn: 80493
OpenPOWER on IntegriCloud