llvm-6502/unittests/Support
Nick Kledzik e93da60ac4 [Support] Add type-safe alternative to llvm::format()
llvm::format() is somewhat unsafe. The compiler does not check that integer
parameter size matches the %x or %d size and it does not complain when a 
StringRef is passed for a %s.  And correctly using a StringRef with format() is  
ugly because you have to convert it to a std::string then call c_str().
 
The cases where llvm::format() is useful is controlling how numbers and
strings are printed, especially when you want fixed width output.  This
patch adds some new formatting functions to raw_streams to format numbers
and StringRefs in a type safe manner. Some examples:

   OS << format_hex(255, 6)        => "0x00ff"
   OS << format_hex(255, 4)        => "0xff"
   OS << format_decimal(0, 5)      => "    0"
   OS << format_decimal(255, 5)    => "  255"
   OS << right_justify(Str, 5)     => "  foo"
   OS << left_justify(Str, 5)      => "foo  "



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218463 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-25 20:30:58 +00:00
..
AlignOfTest.cpp
AllocatorTest.cpp Try to unflake AllocatorTest.TestAlignmentPastSlab 2014-09-07 05:14:29 +00:00
ArrayRecyclerTest.cpp
BlockFrequencyTest.cpp
BranchProbabilityTest.cpp
Casting.cpp
CMakeLists.txt Decouple llvm::SpecialCaseList text representation and its LLVM IR semantics. 2014-07-09 19:40:08 +00:00
CommandLineTest.cpp Fix PR17239 by changing the semantics of the RemainingArgsClass Option kind 2014-08-22 19:29:17 +00:00
CompressionTest.cpp
ConvertUTFTest.cpp Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created. 2014-08-27 05:25:25 +00:00
DataExtractorTest.cpp
EndianTest.cpp
ErrorOrTest.cpp Ensure ErrorOr cannot implicitly invoke explicit ctors of the underlying type. 2014-09-03 17:31:25 +00:00
FileOutputBufferTest.cpp Misc cleanups to the FileSytem api. 2014-09-11 20:30:02 +00:00
formatted_raw_ostream_test.cpp
IteratorTest.cpp
LEB128Test.cpp [Support] add decodeSLEB128() 2014-09-15 21:51:49 +00:00
LineIteratorTest.cpp LineIterator: Provide a variant that keeps blank lines 2014-09-17 15:43:01 +00:00
LockFileManagerTest.cpp Asserting that the call to chdir succeeds in this test. Fixes some -Wunused-result warnings. 2014-08-13 11:17:41 +00:00
Makefile
ManagedStatic.cpp
MathExtrasTest.cpp
MD5Test.cpp Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or just letting them be implicitly created. 2014-08-27 05:25:25 +00:00
MemoryBufferTest.cpp
MemoryTest.cpp
Path.cpp Fix identify_magic() with mach-o stub dylibs. 2014-09-17 00:53:44 +00:00
ProcessTest.cpp Cleaning up static initializers in TimeValue. 2014-08-29 01:05:12 +00:00
ProgramTest.cpp Add writeFileWithSystemEncoding to LibLLVMSuppor. 2014-09-03 20:02:00 +00:00
raw_ostream_test.cpp [Support] Add type-safe alternative to llvm::format() 2014-09-25 20:30:58 +00:00
RegexTest.cpp
ScaledNumberTest.cpp
SourceMgrTest.cpp Return a std::unique_ptr when creating a new MemoryBuffer. 2014-08-27 20:03:13 +00:00
SpecialCaseListTest.cpp unique_ptrify the result of SpecialCaseList::create 2014-09-02 18:13:54 +00:00
StringPool.cpp
SwapByteOrderTest.cpp
ThreadLocalTest.cpp
TimeValueTest.cpp
UnicodeTest.cpp
YAMLIOTest.cpp Fix bug 20125 - clang-format segfaults on bad config. 2014-08-08 13:58:00 +00:00
YAMLParserTest.cpp Return a std::unique_ptr when creating a new MemoryBuffer. 2014-08-27 20:03:13 +00:00