1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/tools
Michael Kruse 8fc32bf8f9 [ADT] Replace std::isprint by llvm::isPrint.
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
2018-07-26 15:31:41 +00:00
..
bugpoint Refactor ExecuteAndWait to take StringRefs. 2018-06-12 17:43:52 +00:00
bugpoint-passes Remove redundant includes from tools. 2017-12-13 21:31:10 +00:00
dsymutil [dsymutil] Add support for generating DWARF5 accelerator tables. 2018-07-25 23:01:38 +00:00
gold [gold-plugin] Disable section ordering for relocatable links 2018-07-12 20:35:58 +00:00
llc [llc] Fix sanitizer failure. 2018-06-23 19:04:10 +00:00
lli Add PerfJITEventListener for perf profiling support. 2018-07-24 00:54:06 +00:00
llvm-ar [FileSystem] Split up the OpenFlags enumeration. 2018-06-07 19:58:58 +00:00
llvm-as [ThinLTO] Parse module summary index from assembly 2018-06-26 13:56:49 +00:00
llvm-as-fuzzer make add_llvm_fuzzer calls slightly more consisten with other cmake 2018-05-11 17:58:52 +00:00
llvm-bcanalyzer [ADT] Replace std::isprint by llvm::isPrint. 2018-07-26 15:31:41 +00:00
llvm-c-test [LLVM-C] Add DIBuilder Bindings For ObjC Classes 2018-05-21 16:27:35 +00:00
llvm-cat Pass a reference to a module to the bitcode writer. 2018-02-14 19:11:32 +00:00
llvm-cfi-verify [cfi-verify] Abort on unsupported targets 2018-07-16 15:26:44 +00:00
llvm-config [llvm-config] Use WithColor for printing errors. 2018-06-23 16:50:09 +00:00
llvm-cov Refactor ExecuteAndWait to take StringRefs. 2018-06-12 17:43:52 +00:00
llvm-cvtres [llvm-cvtres] Allow parameters preceded by '-' in addition to '/' 2018-05-02 21:15:13 +00:00
llvm-cxxdump Fixing a typo; NFC. 2018-07-23 18:09:43 +00:00
llvm-cxxfilt Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
llvm-demangle-fuzzer make add_llvm_fuzzer calls slightly more consisten with other cmake 2018-05-11 17:58:52 +00:00
llvm-diff Let llvm-diff correctly deal with Undef/ConstantAggregateZero/ConstantVector/IndirectBr 2018-04-12 21:28:04 +00:00
llvm-dis [ThinLTO] Print module summary index to assembly 2018-05-26 02:34:13 +00:00
llvm-dwarfdump [DWARF] Improved error reporting for range lists. 2018-06-20 22:56:37 +00:00
llvm-dwp MC: Change the streamer ctors to take an object writer instead of a stream. NFCI. 2018-05-18 18:26:45 +00:00
llvm-exegesis [llvm-exegesis] Add uop computation for more X87 instruction classes. 2018-07-05 13:54:51 +00:00
llvm-extract Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
llvm-go Update some code.google.com links 2017-11-13 23:47:58 +00:00
llvm-isel-fuzzer CodeGen: Add a dwo output file argument to addPassesToEmitFile and hook it up to dwo output. 2018-05-21 20:16:41 +00:00
llvm-jitlistener Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
llvm-link Restore "[ThinLTO] Ensure we always select the same function copy to import" 2018-07-16 15:30:27 +00:00
llvm-lto [ThinLTO] Rename index IsAnalysis flag to HaveGVs (NFC) 2018-06-06 22:22:01 +00:00
llvm-lto2 [LTO] Allow pass remarks with hotness to be set when emitting to stderr 2018-05-04 23:59:34 +00:00
llvm-mc Support -fdebug-prefix-map in llvm-mc. This is useful to omit the 2018-07-10 14:41:54 +00:00
llvm-mc-assemble-fuzzer make add_llvm_fuzzer calls slightly more consisten with other cmake 2018-05-11 17:58:52 +00:00
llvm-mc-disassemble-fuzzer make add_llvm_fuzzer calls slightly more consisten with other cmake 2018-05-11 17:58:52 +00:00
llvm-mca [MCA] Avoid an InstrDesc copy in mca::LSUnit::reserve. 2018-07-26 00:02:54 +00:00
llvm-modextract Pass a reference to a module to the bitcode writer. 2018-02-14 19:11:32 +00:00
llvm-mt [llvm-mt] Use WithColor for printing errors. 2018-06-23 16:49:07 +00:00
llvm-nm nm: Add -no-weak flag for hiding weak symbols 2018-07-02 17:24:37 +00:00
llvm-objcopy [llvm-objcopy] Add basic support for --rename-section 2018-07-20 19:54:24 +00:00
llvm-objdump [ADT] Replace std::isprint by llvm::isPrint. 2018-07-26 15:31:41 +00:00
llvm-opt-fuzzer make add_llvm_fuzzer calls slightly more consisten with other cmake 2018-05-11 17:58:52 +00:00
llvm-opt-report Remove \brief commands from doxygen comments. 2018-05-01 15:54:18 +00:00
llvm-pdbutil [PDB] One more fix for hasing GSI records. 2018-07-06 21:01:42 +00:00
llvm-profdata [NFC] Change sample profile format enum name SPF_Raw_Binary to SPF_Binary. 2018-06-12 05:53:49 +00:00
llvm-rc [FileSystem] Split up the OpenFlags enumeration. 2018-06-07 19:58:58 +00:00
llvm-readobj [ADT] Replace std::isprint by llvm::isPrint. 2018-07-26 15:31:41 +00:00
llvm-rtdyld Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
llvm-shlib [CMake] Support building shared library for OpenBSD 2018-06-23 21:26:44 +00:00
llvm-size [llvm-size] Make global variables static 2018-06-22 22:20:10 +00:00
llvm-special-case-list-fuzzer make add_llvm_fuzzer calls slightly more consisten with other cmake 2018-05-11 17:58:52 +00:00
llvm-split Pass a reference to a module to the bitcode writer. 2018-02-14 19:11:32 +00:00
llvm-stress [Support] Rename tool_output_file to ToolOutputFile, NFC 2017-09-23 01:03:17 +00:00
llvm-strings Define InitLLVM to do common initialization all at once. 2018-04-13 18:26:06 +00:00
llvm-symbolizer [llvm-symbolizer] Simplify 2018-05-26 02:29:14 +00:00
llvm-undname [llvm-undname] Flush output before demangling. 2018-07-21 15:39:05 +00:00
llvm-xray llvm-xray: Broken chrome trace event format output 2018-07-24 01:45:34 +00:00
lto s/LLVM_ON_WIN32/_WIN32/, llvm 2018-04-29 00:45:03 +00:00
msbuild Rewrite the VS integration scripts. 2018-07-20 16:30:02 +00:00
obj2yaml Fix debug build by adding missing dependencies on libBinaryFormat 2018-05-15 00:46:43 +00:00
opt [Debugify] Export per-pass debug info loss statistics 2018-07-24 00:41:29 +00:00
opt-viewer [opt-viewer] Kill parser processes before moving onto rendering 2018-02-26 21:15:51 +00:00
sancov Rename sancov.cc to sancov.cpp 2018-04-25 18:06:23 +00:00
sanstats Fix broken links to the Itanium CXX ABI 2017-09-12 00:19:11 +00:00
verify-uselistorder Rename DEBUG macro to LLVM_DEBUG. 2018-05-14 12:53:11 +00:00
xcode-toolchain [cmake][xcode-toolchain] add support for major Xcode version >= 10 2018-06-28 00:39:09 +00:00
yaml2obj [yaml2obj] Add default sh_entsize for dynamic sections 2018-07-23 18:49:04 +00:00
CMakeLists.txt Fixup r271533, or check-clang didn't find llvm-lto as the target. 2016-06-02 20:39:24 +00:00
LLVMBuild.txt Add a Microsoft Demangler. 2018-07-20 17:27:48 +00:00