2014-11-07 16:08:19 +00:00
|
|
|
set(system_libs)
|
|
|
|
if( NOT MSVC )
|
|
|
|
if( MINGW )
|
|
|
|
set(system_libs ${system_libs} imagehlp psapi shell32)
|
|
|
|
elseif( CMAKE_HOST_UNIX )
|
|
|
|
if( HAVE_LIBRT )
|
|
|
|
set(system_libs ${system_libs} rt)
|
|
|
|
endif()
|
|
|
|
if( HAVE_LIBDL )
|
|
|
|
set(system_libs ${system_libs} ${CMAKE_DL_LIBS})
|
|
|
|
endif()
|
|
|
|
if(LLVM_ENABLE_TERMINFO)
|
|
|
|
if(HAVE_TERMINFO)
|
|
|
|
set(system_libs ${system_libs} ${TERMINFO_LIBS})
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
if( LLVM_ENABLE_THREADS AND HAVE_LIBATOMIC )
|
|
|
|
set(system_libs ${system_libs} atomic)
|
|
|
|
endif()
|
|
|
|
if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD )
|
|
|
|
set(system_libs ${system_libs} pthread)
|
|
|
|
endif()
|
|
|
|
if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ )
|
|
|
|
set(system_libs ${system_libs} z)
|
|
|
|
endif()
|
|
|
|
set(system_libs ${system_libs} m)
|
|
|
|
endif( MINGW )
|
|
|
|
endif( NOT MSVC )
|
|
|
|
|
2008-09-22 01:08:49 +00:00
|
|
|
add_llvm_library(LLVMSupport
|
|
|
|
APFloat.cpp
|
|
|
|
APInt.cpp
|
|
|
|
APSInt.cpp
|
2014-01-19 08:25:27 +00:00
|
|
|
ARMBuildAttrs.cpp
|
2014-06-02 01:17:49 +00:00
|
|
|
ARMWinEH.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
Allocator.cpp
|
2011-07-25 22:24:51 +00:00
|
|
|
BlockFrequency.cpp
|
2011-06-11 01:05:22 +00:00
|
|
|
BranchProbability.cpp
|
2009-12-23 17:03:46 +00:00
|
|
|
circular_raw_ostream.cpp
|
2015-04-27 17:19:26 +00:00
|
|
|
COM.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
CommandLine.cpp
|
2013-04-23 08:28:39 +00:00
|
|
|
Compression.cpp
|
2013-01-30 12:05:05 +00:00
|
|
|
ConvertUTF.c
|
|
|
|
ConvertUTFWrapper.cpp
|
2010-07-28 17:17:46 +00:00
|
|
|
CrashRecoveryContext.cpp
|
2011-09-13 19:42:16 +00:00
|
|
|
DataExtractor.cpp
|
2012-02-06 22:30:29 +00:00
|
|
|
DataStream.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
Debug.cpp
|
2009-12-03 11:12:42 +00:00
|
|
|
DeltaAlgorithm.cpp
|
2010-06-08 16:21:22 +00:00
|
|
|
DAGDeltaAlgorithm.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
Dwarf.cpp
|
2009-07-07 18:52:14 +00:00
|
|
|
ErrorHandling.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
FileUtilities.cpp
|
2012-08-01 02:29:50 +00:00
|
|
|
FileOutputBuffer.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
FoldingSet.cpp
|
2009-07-14 20:44:17 +00:00
|
|
|
FormattedStream.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
GraphWriter.cpp
|
Rewrite LLVM's generalized support library for hashing to follow the API
of the proposed standard hashing interfaces (N3333), and to use
a modified and tuned version of the CityHash algorithm.
Some of the highlights of this change:
-- Significantly higher quality hashing algorithm with very well
distributed results, and extremely few collisions. Should be close to
a checksum for up to 64-bit keys. Very little clustering or clumping of
hash codes, to better distribute load on probed hash tables.
-- Built-in support for reserved values.
-- Simplified API that composes cleanly with other C++ idioms and APIs.
-- Better scaling performance as keys grow. This is the fastest
algorithm I've found and measured for moderately sized keys (such as
show up in some of the uniquing and folding use cases)
-- Support for enabling per-execution seeds to prevent table ordering
or other artifacts of hashing algorithms to impact the output of
LLVM. The seeding would make each run different and highlight these
problems during bootstrap.
This implementation was tested extensively using the SMHasher test
suite, and pased with flying colors, doing better than the original
CityHash algorithm even.
I've included a unittest, although it is somewhat minimal at the moment.
I've also added (or refactored into the proper location) type traits
necessary to implement this, and converted users of GeneralHash over.
My only immediate concerns with this implementation is the performance
of hashing small keys. I've already started working to improve this, and
will continue to do so. Currently, the only algorithms faster produce
lower quality results, but it is likely there is a better compromise
than the current one.
Many thanks to Jeffrey Yasskin who did most of the work on the N3333
paper, pair-programmed some of this code, and reviewed much of it. Many
thanks also go to Geoff Pike Pike and Jyrki Alakuijala, the original
authors of CityHash on which this is heavily based, and Austin Appleby
who created MurmurHash and the SMHasher test suite.
Also thanks to Nadav, Tobias, Howard, Jay, Nick, Ahmed, and Duncan for
all of the review comments! If there are further comments or concerns,
please let me know and I'll jump on 'em.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151822 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-01 18:55:25 +00:00
|
|
|
Hashing.cpp
|
2010-12-21 00:04:46 +00:00
|
|
|
IntEqClasses.cpp
|
2010-11-19 04:47:19 +00:00
|
|
|
IntervalMap.cpp
|
2011-12-20 08:42:11 +00:00
|
|
|
IntrusiveRefCntPtr.cpp
|
2014-02-22 15:39:39 +00:00
|
|
|
LEB128.cpp
|
2013-12-27 04:28:57 +00:00
|
|
|
LineIterator.cpp
|
2012-04-17 20:03:03 +00:00
|
|
|
Locale.cpp
|
2012-01-29 20:15:10 +00:00
|
|
|
LockFileManager.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
ManagedStatic.cpp
|
2014-09-27 14:41:29 +00:00
|
|
|
MathExtras.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
MemoryBuffer.cpp
|
2009-09-11 21:49:45 +00:00
|
|
|
MemoryObject.cpp
|
2013-05-21 01:30:38 +00:00
|
|
|
MD5.cpp
|
2014-10-15 21:54:35 +00:00
|
|
|
Options.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
PluginLoader.cpp
|
2009-03-05 09:19:13 +00:00
|
|
|
PrettyStackTrace.cpp
|
2014-06-25 15:21:42 +00:00
|
|
|
RandomNumberGenerator.cpp
|
2009-09-01 17:01:02 +00:00
|
|
|
Regex.cpp
|
2014-06-20 21:47:47 +00:00
|
|
|
ScaledNumber.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
SmallPtrSet.cpp
|
2009-12-16 08:44:24 +00:00
|
|
|
SmallVector.cpp
|
2009-06-21 03:41:50 +00:00
|
|
|
SourceMgr.cpp
|
2014-07-09 19:40:08 +00:00
|
|
|
SpecialCaseList.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
Statistic.cpp
|
2014-11-12 03:55:46 +00:00
|
|
|
StreamingMemoryObject.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
StringExtras.cpp
|
|
|
|
StringMap.cpp
|
|
|
|
StringPool.cpp
|
2009-09-16 22:38:48 +00:00
|
|
|
StringRef.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
SystemUtils.cpp
|
|
|
|
Timer.cpp
|
2010-10-07 23:12:15 +00:00
|
|
|
ToolOutputFile.cpp
|
2009-05-27 16:52:17 +00:00
|
|
|
Triple.cpp
|
2009-07-24 07:04:49 +00:00
|
|
|
Twine.cpp
|
2013-09-04 16:00:12 +00:00
|
|
|
Unicode.cpp
|
2012-04-03 23:09:22 +00:00
|
|
|
YAMLParser.cpp
|
2012-12-12 20:46:15 +00:00
|
|
|
YAMLTraits.cpp
|
2009-08-25 00:02:29 +00:00
|
|
|
raw_os_ostream.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
raw_ostream.cpp
|
2009-08-30 08:24:09 +00:00
|
|
|
regcomp.c
|
|
|
|
regerror.c
|
|
|
|
regexec.c
|
|
|
|
regfree.c
|
|
|
|
regstrlcpy.c
|
2010-11-29 18:16:10 +00:00
|
|
|
|
|
|
|
# System
|
|
|
|
Atomic.cpp
|
|
|
|
DynamicLibrary.cpp
|
|
|
|
Errno.cpp
|
|
|
|
Host.cpp
|
|
|
|
Memory.cpp
|
|
|
|
Mutex.cpp
|
2013-06-26 19:33:03 +00:00
|
|
|
Path.cpp
|
2010-11-29 18:16:10 +00:00
|
|
|
Process.cpp
|
|
|
|
Program.cpp
|
|
|
|
RWMutex.cpp
|
|
|
|
SearchForAddressOfSpecialSymbol.cpp
|
|
|
|
Signals.cpp
|
2011-08-24 18:08:43 +00:00
|
|
|
TargetRegistry.cpp
|
2010-11-29 18:16:10 +00:00
|
|
|
ThreadLocal.cpp
|
|
|
|
Threading.cpp
|
|
|
|
TimeValue.cpp
|
|
|
|
Valgrind.cpp
|
2013-03-26 01:29:15 +00:00
|
|
|
Watchdog.cpp
|
2014-01-20 10:20:23 +00:00
|
|
|
|
Teach llvm_add_library() to find include dirs.
Since header files are not compilation units, CMake does not require
you to specify them in the CMakeLists.txt file. As a result, unless a
header file is explicitly added, CMake won't know about it, and when
generating IDE-based projects, CMake won't put the header files into
the IDE project. LLVM currently tries to deal with this in two ways:
1) It looks for all .h files that are in the project directory, and
adds those.
2) llvm_add_library() understands the ADDITIONAL_HEADERS argument,
which allows one to list an arbitrary list of headers.
This patch takes things one step further. It adds the ability for
llvm_add_library() to take an ADDITIONAL_HEADER_DIRS argument, which
will specify a list of folders which CMake will glob for header files.
Furthermore, it will glob not only for .h files, but also for .inc
files.
Included in this CL is an update to one of the existing users of
ADDITIONAL_HEADERS to use this new argument instead, to serve as an
illustration of how this cleans up the CMake.
The big advantage of this new approach is that until now, there was no
way for the IDE projects to locate the header files that are in the
include tree. In other words, if you are in, for example,
lib/DebugInfo/DWARF, the corresponding includes for this project will
be located under include/llvm/DebugInfo/DWARF. Now, in the
CMakeLists.txt for lib/DebugInfo/DWARF, you can simply write:
ADDITIONAL_HEADER_DIRS
../../include/llvm/DebugInfo/DWARF
as an argument to llvm_add_library(), and all header files will get
added to the IDE project.
Differential Revision: http://reviews.llvm.org/D7460
Reviewed By: Chris Bieneman
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228670 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-10 05:04:37 +00:00
|
|
|
ADDITIONAL_HEADER_DIRS
|
|
|
|
Unix
|
|
|
|
Windows
|
2015-02-11 03:28:02 +00:00
|
|
|
${LLVM_MAIN_INCLUDE_DIR}/llvm/Support
|
2014-02-26 12:18:55 +00:00
|
|
|
|
2014-11-07 16:08:19 +00:00
|
|
|
LINK_LIBS ${system_libs}
|
|
|
|
)
|
2014-02-26 12:18:55 +00:00
|
|
|
|
2014-02-23 06:27:04 +00:00
|
|
|
set_property(TARGET LLVMSupport PROPERTY LLVM_SYSTEM_LIBS "${system_libs}")
|