llvm-6502/lib/Support
Alp Toker 2559070422 Introduce a string_ostream string builder facilty
string_ostream is a safe and efficient string builder that combines opaque
stack storage with a built-in ostream interface.

small_string_ostream<bytes> additionally permits an explicit stack storage size
other than the default 128 bytes to be provided. Beyond that, storage is
transferred to the heap.

This convenient class can be used in most places an
std::string+raw_string_ostream pair or SmallString<>+raw_svector_ostream pair
would previously have been used, in order to guarantee consistent access
without byte truncation.

The patch also converts much of LLVM to use the new facility. These changes
include several probable bug fixes for truncated output, a programming error
that's no longer possible with the new interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211749 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-26 00:00:48 +00:00
..
Unix Revert: r211588 - [mips] Use __clear_cache builtin instead of cacheflush() in Unix Memory::InvalidateInstructionCache() 2014-06-24 13:53:56 +00:00
Windows Finishing touch for the std::error_code transition. 2014-06-13 17:20:48 +00:00
Allocator.cpp
APFloat.cpp APFloat: x - NaN needs to flip the signbit of NaN when x is a number. 2014-06-08 16:53:31 +00:00
APInt.cpp [Modules] Fix potential ODR violations by sinking the DEBUG_TYPE 2014-04-22 03:07:47 +00:00
APSInt.cpp
ARMBuildAttrs.cpp
ARMWinEH.cpp Support: add Windows ARM EH data structures 2014-06-02 01:17:49 +00:00
Atomic.cpp Fix .cpp files claiming to be header files 2014-06-20 01:36:00 +00:00
BlockFrequency.cpp blockfreq: Defer to BranchProbability::scale() (again) 2014-04-29 16:31:29 +00:00
BranchProbability.cpp BranchProb: Simplify printing code 2014-04-29 17:07:42 +00:00
circular_raw_ostream.cpp
CMakeLists.txt Random Number Generator (llvm) 2014-06-25 15:21:42 +00:00
CommandLine.cpp Introduce a string_ostream string builder facilty 2014-06-26 00:00:48 +00:00
Compression.cpp
ConvertUTF.c Support/ConvertUTF: restore compatibility with MSVC, which only implements C89 2014-06-16 11:22:33 +00:00
ConvertUTFWrapper.cpp
COPYRIGHT.regex
CrashRecoveryContext.cpp For CrashRecoveryContext::RunSafelyOnThread, propagate Darwin's PRIO_DARWIN_BG to the new thread if it is 2014-06-25 23:54:50 +00:00
DAGDeltaAlgorithm.cpp
DataExtractor.cpp Using llvm::sys::swapByteOrder() for the common case of byte-swapping a value in place 2014-06-14 13:18:07 +00:00
DataStream.cpp Remove 'using std::errro_code' from lib. 2014-06-13 02:24:39 +00:00
Debug.cpp
DeltaAlgorithm.cpp
Disassembler.cpp
Dwarf.cpp
DynamicLibrary.cpp Fix .cpp files claiming to be header files 2014-06-20 01:36:00 +00:00
Errno.cpp
ErrorHandling.cpp Merge lib/Support/WindowsError.cpp into ib/Support/ErrorHandling.cpp. 2014-06-17 18:06:45 +00:00
FileOutputBuffer.cpp Finishing touch for the std::error_code transition. 2014-06-13 17:20:48 +00:00
FileUtilities.cpp Remove 'using std::errro_code' from lib. 2014-06-13 02:24:39 +00:00
FoldingSet.cpp
FormattedStream.cpp
GraphWriter.cpp Don't use 'using std::error_code' in include/llvm. 2014-06-12 21:46:39 +00:00
Hashing.cpp
Host.cpp Fix .cpp files claiming to be header files 2014-06-20 01:36:00 +00:00
IncludeFile.cpp
IntEqClasses.cpp
IntervalMap.cpp
IntrusiveRefCntPtr.cpp
IsInf.cpp
IsNAN.cpp
LEB128.cpp
LineIterator.cpp
LLVMBuild.txt
Locale.cpp
LockFileManager.cpp Finishing touch for the std::error_code transition. 2014-06-13 17:20:48 +00:00
Makefile Support: Inject LLVM_VERSION_INFO into the Support library 2014-06-17 06:52:47 +00:00
ManagedStatic.cpp Fix the MinGW builder. Apparently std::call_once and 2014-06-21 00:24:51 +00:00
MD5.cpp
Memory.cpp
MemoryBuffer.cpp Finishing touch for the std::error_code transition. 2014-06-13 17:20:48 +00:00
MemoryObject.cpp
Mutex.cpp
Path.cpp Don't leak a file descriptor. 2014-06-25 14:35:59 +00:00
PluginLoader.cpp
PrettyStackTrace.cpp
Process.cpp Fix .cpp files claiming to be header files 2014-06-20 01:36:00 +00:00
Program.cpp Fix .cpp files claiming to be header files 2014-06-20 01:36:00 +00:00
RandomNumberGenerator.cpp Random Number Generator (llvm) 2014-06-25 15:21:42 +00:00
raw_os_ostream.cpp
raw_ostream.cpp Introduce a string_ostream string builder facilty 2014-06-26 00:00:48 +00:00
README.txt.system
regcclass.h adding re-include guards into lib/Support/reg*.h 2014-06-12 16:07:56 +00:00
regcname.h adding re-include guards into lib/Support/reg*.h 2014-06-12 16:07:56 +00:00
regcomp.c
regengine.inc Clean up language and grammar. 2014-05-20 17:11:11 +00:00
regerror.c
regex2.h adding re-include guards into lib/Support/reg*.h 2014-06-12 16:07:56 +00:00
regex_impl.h
Regex.cpp
regexec.c
regfree.c
regstrlcpy.c
regutils.h adding re-include guards into lib/Support/reg*.h 2014-06-12 16:07:56 +00:00
RWMutex.cpp
ScaledNumber.cpp Support: Move class ScaledNumber 2014-06-24 00:38:09 +00:00
SearchForAddressOfSpecialSymbol.cpp
Signals.cpp
SmallPtrSet.cpp
SmallVector.cpp
SourceMgr.cpp Use SourceMgr::getMemoryBuffer() in a couple of places 2014-06-25 00:41:15 +00:00
Statistic.cpp
StreamableMemoryObject.cpp
StringExtras.cpp
StringMap.cpp Recommit 211309 (StringMap::insert), reverted in 211328 due to issues with private, but non-deleted, move members. 2014-06-23 18:28:53 +00:00
StringPool.cpp Convert StringMapEntry::Create to use StringRef instead of start/end pointers. Simpliies all in tree call sites. No functional change. 2014-06-11 05:35:56 +00:00
StringRef.cpp
StringRefMemoryObject.cpp
SystemUtils.cpp
TargetRegistry.cpp
Threading.cpp Revert r211287, "Remove support for LLVM runtime multi-threading." 2014-06-24 13:36:31 +00:00
ThreadLocal.cpp
Timer.cpp Kill the LLVM global lock. 2014-06-19 16:17:42 +00:00
TimeValue.cpp
ToolOutputFile.cpp
Triple.cpp
Twine.cpp
Unicode.cpp
Valgrind.cpp
Watchdog.cpp
YAMLParser.cpp
YAMLTraits.cpp Finishing touch for the std::error_code transition. 2014-06-13 17:20:48 +00:00

Design Of lib/System
====================

The software in this directory is designed to completely shield LLVM from any
and all operating system specific functionality. It is not intended to be a
complete operating system wrapper (such as ACE), but only to provide the
functionality necessary to support LLVM.

The software located here, of necessity, has very specific and stringent design
rules. Violation of these rules means that cracks in the shield could form and
the primary goal of the library is defeated. By consistently using this library,
LLVM becomes more easily ported to new platforms since the only thing requiring
porting is this library.

Complete documentation for the library can be found in the file:
  llvm/docs/SystemLibrary.html
or at this URL:
  http://llvm.org/docs/SystemLibrary.html

While we recommend that you read the more detailed documentation, for the
impatient, here's a high level summary of the library's requirements.

 1. No system header files are to be exposed through the interface.
 2. Std C++ and Std C header files are okay to be exposed through the interface.
 3. No exposed system-specific functions.
 4. No exposed system-specific data.
 5. Data in lib/System classes must use only simple C++ intrinsic types.
 6. Errors are handled by returning "true" and setting an optional std::string
 7. Library must not throw any exceptions, period.
 8. Interface functions must not have throw() specifications.
 9. No duplicate function impementations are permitted within an operating
    system class.

To accomplish these requirements, the library has numerous design criteria that
must be satisfied. Here's a high level summary of the library's design criteria:

 1. No unused functionality (only what LLVM needs)
 2. High-Level Interfaces
 3. Use Opaque Classes
 4. Common Implementations
 5. Multiple Implementations
 6. Minimize Memory Allocation
 7. No Virtual Methods