llvm/lib/Support
Simon Pilgrim 95d021ba68 [APInt] Add APInt::extractBits() method to extract APInt subrange (reapplied)
The current pattern for extract bits in range is typically:

Mask.lshr(BitOffset).trunc(SubSizeInBits);

Which can be particularly slow for large APInts (MaskSizeInBits > 64) as they require the allocation of memory for the temporary variable.

This is another of the compile time issues identified in PR32037 (see also D30265).

This patch adds the APInt::extractBits() helper method which avoids the temporary memory allocation.

Differential Revision: https://reviews.llvm.org/D30336

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296272 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 20:01:58 +00:00
..
Unix [Support] Re-add the special OSX flags on mmap. 2017-02-22 21:24:06 +00:00
Windows [Support] Add a function to check if a file resides locally. 2017-02-21 20:55:47 +00:00
Allocator.cpp
APFloat.cpp Cleanup dump() functions. 2017-01-28 02:02:38 +00:00
APInt.cpp [APInt] Add APInt::extractBits() method to extract APInt subrange (reapplied) 2017-02-25 20:01:58 +00:00
APSInt.cpp
ARMAttributeParser.cpp
ARMBuildAttrs.cpp
ARMWinEH.cpp
Atomic.cpp
BlockFrequency.cpp
BranchProbability.cpp Cleanup dump() functions. 2017-01-28 02:02:38 +00:00
CachePruning.cpp
Chrono.cpp Attempt to fix MSVC build broken by r294326 2017-02-07 18:35:36 +00:00
circular_raw_ostream.cpp
CMakeLists.txt Add initial support for debug counting 2017-02-19 04:28:56 +00:00
COM.cpp
CommandLine.cpp Add initial support for debug counting 2017-02-19 04:28:56 +00:00
Compression.cpp
ConvertUTF.cpp
ConvertUTFWrapper.cpp
COPYRIGHT.regex
CrashRecoveryContext.cpp
DAGDeltaAlgorithm.cpp
DataExtractor.cpp
Debug.cpp
DebugCounter.cpp Add two files lost in rebase, causing build break 2017-02-19 04:29:50 +00:00
DeltaAlgorithm.cpp
Dwarf.cpp
DynamicLibrary.cpp Do not leak OpenedHandles. 2017-02-21 17:30:43 +00:00
Errno.cpp
Error.cpp
ErrorHandling.cpp
FileOutputBuffer.cpp
FileUtilities.cpp
FoldingSet.cpp
FormattedStream.cpp
FormatVariadic.cpp
GlobPattern.cpp
GraphWriter.cpp
Hashing.cpp
Host.cpp [X86] Remove the HLE feature flag. 2017-02-09 06:51:02 +00:00
IntEqClasses.cpp
IntervalMap.cpp
JamCRC.cpp
LEB128.cpp
LineIterator.cpp
LLVMBuild.txt
Locale.cpp
LockFileManager.cpp
ManagedStatic.cpp Revamp llvm::once_flag to be closer to std::once_flag 2017-02-05 21:13:06 +00:00
MathExtras.cpp
MD5.cpp [Support] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-15 22:17:02 +00:00
Memory.cpp
MemoryBuffer.cpp [Support] Add a function to check if a file resides locally. 2017-02-21 20:55:47 +00:00
Mutex.cpp
NativeFormatting.cpp
Options.cpp
Path.cpp
PluginLoader.cpp
PrettyStackTrace.cpp
Process.cpp
Program.cpp
RandomNumberGenerator.cpp
raw_os_ostream.cpp
raw_ostream.cpp
README.txt.system
regcclass.h
regcname.h
regcomp.c
regengine.inc
regerror.c
regex2.h
regex_impl.h
Regex.cpp
regexec.c
regfree.c
regstrlcpy.c
regutils.h
RWMutex.cpp [Support] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-15 22:17:02 +00:00
ScaledNumber.cpp
ScopedPrinter.cpp
SearchForAddressOfSpecialSymbol.cpp
SHA1.cpp
Signals.cpp
SmallPtrSet.cpp
SmallVector.cpp
SourceMgr.cpp [Support] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-02-15 22:17:02 +00:00
SpecialCaseList.cpp
Statistic.cpp
StringExtras.cpp
StringMap.cpp
StringPool.cpp
StringRef.cpp [Support] Add StringRef::getAsDouble. 2017-02-14 19:06:37 +00:00
StringSaver.cpp
SystemUtils.cpp
TargetParser.cpp [AArch64] Add Cavium ThunderX support 2017-02-17 18:34:24 +00:00
TargetRegistry.cpp
TarWriter.cpp
Threading.cpp
ThreadLocal.cpp
ThreadPool.cpp
Timer.cpp Change default TimerGroup singleton to use magic statics 2017-02-16 20:19:49 +00:00
ToolOutputFile.cpp
TrigramIndex.cpp
Triple.cpp [ARM] Add support for armv7ve triple in llvm (PR31358). 2017-02-09 23:29:14 +00:00
Twine.cpp Cleanup dump() functions. 2017-01-28 02:02:38 +00:00
Unicode.cpp
Valgrind.cpp
Watchdog.cpp
xxhash.cpp
YAMLParser.cpp
YAMLTraits.cpp

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