2014-11-07 16:08:19 +00:00
|
|
|
set(system_libs)
|
Re-commit "[cmake] Enable zlib support on windows"
This recommits r319533 which was broken llvm-config --system-libs
output. The reason was that I used find_libraries for searching for the
z library. This returns absolute paths, and when these paths made it
into llvm-config, it made it produce nonsensical flags. To fix this, I
hand-roll a search for the library in the same way that we search for
the terminfo library a couple of lines below.
This is a bit less flexible than the find_library option, as it does not
allow the user to specify the path to the library at configure time
(which is important on windows, as zlib is unlikely to be found in any
of the standard places cmake searches), but I was able to guide the
build to find it with appropriate values of LIB and INCLUDE environment
variables.
Reviewers: compnerd, rnk, beanz, rafael
Subscribers: llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D40779
llvm-svn: 319751
2017-12-05 10:24:15 +00:00
|
|
|
if ( LLVM_ENABLE_ZLIB AND HAVE_LIBZ )
|
|
|
|
set(system_libs ${system_libs} ${ZLIB_LIBRARIES})
|
|
|
|
endif()
|
2016-02-09 19:41:14 +00:00
|
|
|
if( MSVC OR MINGW )
|
|
|
|
# libuuid required for FOLDERID_Profile usage in lib/Support/Windows/Path.inc.
|
2018-02-23 12:20:26 +00:00
|
|
|
# advapi32 required for CryptAcquireContextW in lib/Support/Windows/Path.inc.
|
|
|
|
set(system_libs ${system_libs} psapi shell32 ole32 uuid advapi32)
|
2016-02-09 19:41:14 +00:00
|
|
|
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()
|
Fix llvm-config --system-libs output on FreeBSD and NetBSD
Summary:
For various reasons, CMake's detection mechanism for `backtrace()`
returns an absolute path `/usr/lib/libexecinfo.so` on FreeBSD and
NetBSD.
Since `tools/llvm-config/CMakeLists.txt` only checks if system
libraries start with `-`, this causes `llvm-config --system-libs` to
produce the following incorrect output:
```
-lrt -l/usr/lib/libexecinfo.so -ltinfo -lpthread -lz -lm
```
Fix it by removing the path and the `lib` prefix, to make it look like a
regular short library name, suitable for appending to a `-l` link flag.
This also fixes the `Bindings/Go/go.test` test case, since that always
died with "unable to find library -l/usr/lib/libexecinfo.so".
Reviewers: chandlerc, emaste, joerg, krytarowski
Reviewed By: krytarowski
Subscribers: hans, bdrewery, mgorny, hintonda, llvm-commits
Differential Revision: https://reviews.llvm.org/D42702
llvm-svn: 326358
2018-02-28 20:04:21 +00:00
|
|
|
if( HAVE_BACKTRACE AND NOT "${Backtrace_LIBRARIES}" STREQUAL "" )
|
|
|
|
# On BSDs, CMake returns a fully qualified path to the backtrace library.
|
|
|
|
# We need to remove the path and the 'lib' prefix, to make it look like a
|
|
|
|
# regular short library name, suitable for appending to a -l link flag.
|
|
|
|
get_filename_component(Backtrace_LIBFILE ${Backtrace_LIBRARIES} NAME_WE)
|
|
|
|
STRING(REGEX REPLACE "^lib" "" Backtrace_LIBFILE ${Backtrace_LIBFILE})
|
|
|
|
set(system_libs ${system_libs} ${Backtrace_LIBFILE})
|
2017-04-12 13:51:00 +00:00
|
|
|
endif()
|
2016-02-09 19:41:14 +00:00
|
|
|
if(LLVM_ENABLE_TERMINFO)
|
|
|
|
if(HAVE_TERMINFO)
|
|
|
|
set(system_libs ${system_libs} ${TERMINFO_LIBS})
|
2014-11-07 16:08:19 +00:00
|
|
|
endif()
|
2016-02-09 19:41:14 +00:00
|
|
|
endif()
|
|
|
|
if( LLVM_ENABLE_THREADS AND HAVE_LIBATOMIC )
|
|
|
|
set(system_libs ${system_libs} atomic)
|
|
|
|
endif()
|
2017-02-10 01:59:20 +00:00
|
|
|
set(system_libs ${system_libs} ${LLVM_PTHREAD_LIB})
|
2016-02-26 17:01:45 +00:00
|
|
|
if( UNIX AND NOT (BEOS OR HAIKU) )
|
|
|
|
set(system_libs ${system_libs} m)
|
|
|
|
endif()
|
2016-02-09 19:41:14 +00:00
|
|
|
endif( MSVC OR MINGW )
|
2014-11-07 16:08:19 +00:00
|
|
|
|
2008-09-22 01:08:49 +00:00
|
|
|
add_llvm_library(LLVMSupport
|
2017-10-11 22:18:53 +00:00
|
|
|
AMDGPUMetadata.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
APFloat.cpp
|
|
|
|
APInt.cpp
|
|
|
|
APSInt.cpp
|
2014-01-19 08:25:27 +00:00
|
|
|
ARMBuildAttrs.cpp
|
2017-01-13 10:50:01 +00:00
|
|
|
ARMAttributeParser.cpp
|
2014-06-02 01:17:49 +00:00
|
|
|
ARMWinEH.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
Allocator.cpp
|
2017-03-02 20:52:51 +00:00
|
|
|
BinaryStreamError.cpp
|
|
|
|
BinaryStreamReader.cpp
|
[BinaryStream] Reduce the amount of boiler plate needed to use.
Often you have an array and you just want to use it. With the current
design, you have to first construct a `BinaryByteStream`, and then create
a `BinaryStreamRef` from it. Worse, the `BinaryStreamRef` holds a pointer
to the `BinaryByteStream`, so you can't just create a temporary one to
appease the compiler, you have to actually hold onto both the `ArrayRef`
as well as the `BinaryByteStream` *AND* the `BinaryStreamReader` on top of
that. This makes for very cumbersome code, often requiring one to store a
`BinaryByteStream` in a class just to circumvent this.
At the cost of some added complexity (not exposed to users, but internal
to the library), we can do better than this. This patch allows us to
construct `BinaryStreamReaders` and `BinaryStreamWriters` directly from
source data (e.g. `StringRef`, `MutableArrayRef<uint8_t>`, etc). Not only
does this reduce the amount of code you have to type and make it more
obvious how to use it, but it solves real lifetime issues when it's
inconvenient to hold onto a `BinaryByteStream` for a long time.
The additional complexity is in the form of an added layer of indirection.
Whereas before we simply stored a `BinaryStream*` in the ref, we now store
both a `BinaryStream*` **and** a `std::shared_ptr<BinaryStream>`. When
the user wants to construct a `BinaryStreamRef` directly from an
`ArrayRef` etc, we allocate an internal object that holds ownership over a
`BinaryByteStream` and forwards all calls, and store this in the
`shared_ptr<>`. This also maintains the ref semantics, as you can copy it
by value and references refer to the same underlying stream -- the one
being held in the object stored in the `shared_ptr`.
Differential Revision: https://reviews.llvm.org/D33293
llvm-svn: 303294
2017-05-17 20:23:31 +00:00
|
|
|
BinaryStreamRef.cpp
|
2017-03-02 20:52:51 +00:00
|
|
|
BinaryStreamWriter.cpp
|
2011-07-25 22:24:51 +00:00
|
|
|
BlockFrequency.cpp
|
2011-06-11 01:05:22 +00:00
|
|
|
BranchProbability.cpp
|
2016-04-02 03:28:26 +00:00
|
|
|
CachePruning.cpp
|
2009-12-23 17:03:46 +00:00
|
|
|
circular_raw_ostream.cpp
|
2016-10-20 12:05:50 +00:00
|
|
|
Chrono.cpp
|
2015-04-27 17:19:26 +00:00
|
|
|
COM.cpp
|
[globalisel][tablegen] Generate rule coverage and use it to identify untested rules
Summary:
This patch adds a LLVM_ENABLE_GISEL_COV which, like LLVM_ENABLE_DAGISEL_COV,
causes TableGen to instrument the generated table to collect rule coverage
information. However, LLVM_ENABLE_GISEL_COV goes a bit further than
LLVM_ENABLE_DAGISEL_COV. The information is written to files
(${CMAKE_BINARY_DIR}/gisel-coverage-* by default). These files can then be
concatenated into ${LLVM_GISEL_COV_PREFIX}-all after which TableGen will
read this information and use it to emit warnings about untested rules.
This technique could also be used by SelectionDAG and can be further
extended to detect hot rules and give them priority over colder rules.
Usage:
* Enable LLVM_ENABLE_GISEL_COV in CMake
* Build the compiler and run some tests
* cat gisel-coverage-[0-9]* > gisel-coverage-all
* Delete lib/Target/*/*GenGlobalISel.inc*
* Build the compiler
Known issues:
* ${LLVM_GISEL_COV_PREFIX}-all must be generated as a manual
step due to a lack of a portable 'cat' command. It should be the
concatenation of all ${LLVM_GISEL_COV_PREFIX}-[0-9]* files.
* There's no mechanism to discard coverage information when the ruleset
changes
Depends on D39742
Reviewers: ab, qcolombet, t.p.northover, aditya_nandakumar, rovka
Reviewed By: rovka
Subscribers: vsk, arsenm, nhaehnle, mgorny, kristof.beyls, javed.absar, igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D39747
llvm-svn: 318356
2017-11-16 00:46:35 +00:00
|
|
|
CodeGenCoverage.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
CommandLine.cpp
|
2013-04-23 08:28:39 +00:00
|
|
|
Compression.cpp
|
2016-09-30 00:38:45 +00:00
|
|
|
ConvertUTF.cpp
|
2013-01-30 12:05:05 +00:00
|
|
|
ConvertUTFWrapper.cpp
|
2010-07-28 17:17:46 +00:00
|
|
|
CrashRecoveryContext.cpp
|
2011-09-13 19:42:16 +00:00
|
|
|
DataExtractor.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
Debug.cpp
|
Add initial support for debug counting
Summary:
We have support for bisection, and bugpoint can reduce testcases
often to a single pass. But that doesn't help reduce it to a single
transform by a single pass. Which debug counting lets us do.
Debug counting lets you instrument a pass so that it only executes a
certain thing (rwhatever you want) after skipping it a certain time of
times, and then only does a certain number of executions before saying
"skip" again.
To make it concrete, for predicateinfo, if i instrument use renaming,
i can make it so it skips renaming the first N uses, renames the next
N, and then skips the rest.
This lets you narrow down a miscompilation to, often, a single
transformation, and then also debug it (by using the same command line
parameters).
Reviewers: chandlerc, davide, mehdi_amini
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D29998
llvm-svn: 295593
2017-02-19 04:28:56 +00:00
|
|
|
DebugCounter.cpp
|
2009-12-03 11:12:42 +00:00
|
|
|
DeltaAlgorithm.cpp
|
2010-06-08 16:21:22 +00:00
|
|
|
DAGDeltaAlgorithm.cpp
|
2018-01-28 11:05:10 +00:00
|
|
|
DJB.cpp
|
2016-03-23 23:57:28 +00:00
|
|
|
Error.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
|
2016-11-11 23:57:40 +00:00
|
|
|
FormatVariadic.cpp
|
2016-12-20 23:09:09 +00:00
|
|
|
GlobPattern.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.
llvm-svn: 151822
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
|
2015-09-01 21:23:58 +00:00
|
|
|
JamCRC.cpp
|
2017-08-08 16:29:35 +00:00
|
|
|
KnownBits.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
|
Recommit: [globalisel] Change LLT constructor string into an LLT-based object that knows how to generate it.
Summary:
This will allow future patches to inspect the details of the LLT. The implementation is now split between
the Support and CodeGen libraries to allow TableGen to use this class without introducing layering concerns.
Thanks to Ahmed Bougacha for finding a reasonable way to avoid the layering issue and providing the version of this patch without that problem.
The problem with the previous commit appears to have been that TableGen was including CodeGen/LowLevelType.h instead of Support/LowLevelTypeImpl.h.
Reviewers: t.p.northover, qcolombet, rovka, aditya_nandakumar, ab, javed.absar
Subscribers: arsenm, nhaehnle, mgorny, dberris, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D30046
llvm-svn: 297241
2017-03-07 23:20:35 +00:00
|
|
|
LowLevelType.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
|
2013-05-21 01:30:38 +00:00
|
|
|
MD5.cpp
|
2016-10-11 19:24:45 +00:00
|
|
|
NativeFormatting.cpp
|
2014-10-15 21:54:35 +00:00
|
|
|
Options.cpp
|
2017-05-11 00:03:52 +00:00
|
|
|
Parallel.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
|
2016-05-03 00:28:04 +00:00
|
|
|
ScopedPrinter.cpp
|
2016-04-01 04:30:16 +00:00
|
|
|
SHA1.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
|
|
|
|
StringExtras.cpp
|
|
|
|
StringMap.cpp
|
|
|
|
StringPool.cpp
|
2015-06-13 12:49:52 +00:00
|
|
|
StringSaver.cpp
|
2009-09-16 22:38:48 +00:00
|
|
|
StringRef.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
SystemUtils.cpp
|
2017-01-06 02:29:48 +00:00
|
|
|
TarWriter.cpp
|
TargetParser: FPU/ARCH/EXT parsing refactory - NFC
This new class in a global context contain arch-specific knowledge in order
to provide LLVM libraries, tools and projects with the ability to understand
the architectures. For now, only FPU, ARCH and ARCH extensions on ARM are
supported.
Current behaviour it to parse from free-text to enum values and back, so that
all users can share the same parser and codes. This simplifies a lot both the
ASM/Obj streamers in the back-end (where this came from), and the front-end
parsers for command line arguments (where this is going to be used next).
The previous implementation, using .def/.h includes is deprecated due to its
inflexibility to be built without the backend support and for being too
cumbersome. As more architectures join this scheme, and as more features of
such architectures are added (such as hardware features, type sizes, etc) into
a full blown TargetDescription class, having a set of classes is the most
sane implementation.
The ultimate goal of this refactor both LLVM's and Clang's target description
classes into one unique interface, so that we can de-duplicate and standardise
the descriptions, as well as make it available for other front-ends, tools,
etc.
The FPU parsing for command line options in Clang has been converted to use
this new library and a number of aliases were added for compatibility:
* A bogus neon-vfpv3 alias (neon defaults to vfp3)
* armv5/v6
* {fp4/fp5}-{sp/dp}-d16
Next steps:
* Port Clang's ARCH/EXT parsing to use this library.
* Create a TableGen back-end to generate this information.
* Run this TableGen process regardless of which back-ends are built.
* Expose more information and rename it to TargetDescription.
* Continue re-factoring Clang to use as much of it as possible.
llvm-svn: 236900
2015-05-08 21:04:27 +00:00
|
|
|
TargetParser.cpp
|
2015-12-15 00:59:19 +00:00
|
|
|
ThreadPool.cpp
|
2008-09-22 01:08:49 +00:00
|
|
|
Timer.cpp
|
2010-10-07 23:12:15 +00:00
|
|
|
ToolOutputFile.cpp
|
Use trigrams to speed up SpecialCaseList.
Summary:
it's often the case when the rules in the SpecialCaseList
are of the form hel.o*bar. That gives us a chance to build
trigram index to quickly discard 99% of inputs without
running a full regex. A similar idea was used in Google Code Search
as described in the blog post:
https://swtch.com/~rsc/regexp/regexp4.html
The check is defeated, if there's at least one regex
more complicated than that. In this case, all inputs
will go through the regex. That said, the real-world
rules are often simple or can be simplied. That considerably
speeds up compiling Chromium with CFI and UBSan.
As measured on Chromium's content_message_generator.cc:
before, CFI: 44 s
after, CFI: 23 s
after, CFI, no blacklist: 23 s (~1% slower, but 3 runs were unable to show the difference)
after, regular compilation to bitcode: 23 s
Reviewers: pcc
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D27188
llvm-svn: 288303
2016-12-01 02:54:54 +00:00
|
|
|
TrigramIndex.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
|
Resubmit r325107 (case folding DJB hash)
The issue was that the has function was generating different results depending
on the signedness of char on the host platform. This commit fixes the issue by
explicitly using an unsigned char type to prevent sign extension and
adds some extra tests.
The original commit message was:
This patch implements a variant of the DJB hash function which folds the
input according to the algorithm in the Dwarf 5 specification (Section
6.1.1.4.5), which in turn references the Unicode Standard (Section 5.18,
"Case Mappings").
To achieve this, I have added a llvm::sys::unicode::foldCharSimple
function, which performs this mapping. The implementation of this
function was generated from the CaseMatching.txt file from the Unicode
spec using a python script (which is also included in this patch). The
script tries to optimize the function by coalescing adjecant mappings
with the same shift and stride (terms I made up). Theoretically, it
could be made a bit smarter and merge adjecant blocks that were
interrupted by only one or two characters with exceptional mapping, but
this would save only a couple of branches, while it would greatly
complicate the implementation, so I deemed it was not worth it.
Since we assume that the vast majority of the input characters will be
US-ASCII, the folding hash function has a fast-path for handling these,
and only whips out the full decode+fold+encode logic if we encounter a
character outside of this range. It might be possible to implement the
folding directly on utf8 sequences, but this would also bring a lot of
complexity for the few cases where we will actually need to process
non-ascii characters.
Reviewers: JDevlieghere, aprantl, probinson, dblaikie
Subscribers: mgorny, hintonda, echristo, clayborg, vleschuk, llvm-commits
Differential Revision: https://reviews.llvm.org/D42740
llvm-svn: 325732
2018-02-21 22:36:31 +00:00
|
|
|
UnicodeCaseFold.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
|
2016-09-27 15:45:57 +00:00
|
|
|
xxhash.cpp
|
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
|
|
|
|
Signals.cpp
|
2011-08-24 18:08:43 +00:00
|
|
|
TargetRegistry.cpp
|
2010-11-29 18:16:10 +00:00
|
|
|
ThreadLocal.cpp
|
|
|
|
Threading.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
llvm-svn: 228670
2015-02-10 05:04:37 +00:00
|
|
|
ADDITIONAL_HEADER_DIRS
|
|
|
|
Unix
|
|
|
|
Windows
|
2016-08-22 20:38:53 +00:00
|
|
|
${LLVM_MAIN_INCLUDE_DIR}/llvm/ADT
|
2015-02-11 03:28:02 +00:00
|
|
|
${LLVM_MAIN_INCLUDE_DIR}/llvm/Support
|
2017-04-12 13:51:00 +00:00
|
|
|
${Backtrace_INCLUDE_DIRS}
|
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}")
|