1155 Commits

Author SHA1 Message Date
Pengxuan Zheng
c932a25d56 [cmake] Fix dependency issue in TableGen
Summary:
There is a bug in add_tablegen which causes cmake to fail with the following
error message if LLVM_TABLEGEN is set.

CMake Error at cmake/modules/TableGen.cmake:147 (add_dependencies):
  The dependency target "LLVM-tablegen-host" of target "CLANG-tablegen-host"
  does not exist.
Call Stack (most recent call first):
  tools/clang/utils/TableGen/CMakeLists.txt:3 (add_tablegen)

The issue happens because setting LLVM_TABLEGEN causes cmake to skip generating
the LLVM-tablegen-host target. As a result, a non-existent target was added for
CLANG-tablegen-host causing cmake to fail.

In order to fix this issue, this patch adds a guard to check the validity of the
dependency target before adding it as a dependency.

Reviewers: aganea, smeenai

Reviewed By: aganea

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358226 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-11 21:05:15 +00:00
Martin Storsjo
9093551832 [CMake] Fix accidentally swapped input/output parameters of string(REPLACE) for mingw
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357979 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 08:31:25 +00:00
Justin Bogner
b935402f9a [CMake] Move configuration of LLVM_CXX_STD to HandleLLVMOptions.cmake
Standalone builds of projects other than llvm itself (lldb, libcxx,
etc) include HandleLLVMOptions but not the top level llvm CMakeLists,
so we need to set this variable here to ensure that it always has a
value.

This should fix the build issues some folks have been seeing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357976 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-09 08:14:32 +00:00
Justin Bogner
9736ffc02a [CMake] Replace LLVM_ENABLE_CXX1Y and friends with LLVM_CXX_STD
Simplify building with particular C++ standards by replacing the
specific "enable standard X" flags with a flag that allows specifying
the standard you want directly.

We preserve compatibility with the existing flags so that anyone with
those flags in existing caches won't break mysteriously.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357899 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-08 10:19:17 +00:00
Michal Gorny
e259a4d243 [llvm] [cmake] Add additional headers only if they exist
Modify the add_header_files_for_glob() function to only add files
that do exist, rather than all matches of the glob.  This fixes CMake
error when one of the include directories (which happen to include
/usr/include) contain broken symlinks.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357701 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-04 14:21:38 +00:00
Shoaib Meenai
f66e62013a [cmake] Add function for building native tool
Instead of duplicating functionality for building native versions of
tblgen and llvm-config, add a function to set up a native tool build.
This will also be used for llvm-nm in a follow-up.

This should be NFC for tblgen, besides the slightly different COMMENT
for the custom command (it'll display the tablegen target name instead
of always saying TableGen).  For the native llvm-config, it's a behavior
change in that we'll use llvm_ExternalProject_BuildCmd instead of
constructing the build command manually, always build in Release, and
reference the correct binary path for multi-config generators. I believe
all of these changes to be bug fixes.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357486 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-02 15:58:03 +00:00
Shoaib Meenai
bce08cb615 [cmake] Remove use of deprecated generator expression. NFC
Use $<CONFIG> instead of $<CONFIGURATION>, since the latter has been
deprecated since CMake 3.0, and the former is entirely equivalent.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357338 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-30 01:35:01 +00:00
Shoaib Meenai
285454654d [cmake] Reset variable before using it
A bunch of macros use the same variable name, and since CMake macros
don't get their own scope, the value persists across macro invocations,
and we can end up exporting targets which shouldn't be exported. Clear
the variable before each use to avoid this.

Converting these macros to functions would also help, since it would
avoid the variable leaking into its parent scope, and that's something I
plan to follow up with. It won't fully address the problem, however,
since functions still inherit variables from their parent scopes, so if
someone in the parent scope just happened to use the same variable name
we'd still have the same issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357036 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-26 22:16:53 +00:00
Mikhail R. Gadelha
987a6ac4c9 Moved everything SMT-related to LLVM and updated the cmake scripts.
Differential Revision: https://reviews.llvm.org/D54978

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356929 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-25 17:47:45 +00:00
Alex Langford
67b6109ba6 [CMake] Correct CMake message mode
Summary:
This wasn't actually printing out a CMake warning, it was prepending
"WARN" to the message.

Reviewers: zturner

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356297 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-15 20:43:53 +00:00
Jason Liu
b7dc7b58c4 [AIX][CMake] Changes for building on AIX with XL and GCC
Summary:
In support of IBM's efforts to produce a viable C and C++ LLVM compiler for AIX
(ref: RFC at http://lists.llvm.org/pipermail/llvm-dev/2019-February/130175.html),
this patch adds customizations to the CMake files in order to properly
invoke the host toolchain for the build on AIX.
Additional changes to enable a successful build will follow.

Patch by Xing Xue

Reviewers: hubert.reinterpretcast, jasonliu, sfertile

Reviewed by: hubert.reinterpretcast

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@356104 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-13 21:50:25 +00:00
Hubert Tong
d929ec6038 Use AIX version detection at LLVM run-time
Summary:
AIX compilers define macros based on the version of the operating
system.

This patch implements updating of versionless AIX triples to include the
host AIX version. Also, the host triple detection in the build system is
adjusted to strip the AIX version information so that the run-time
detection is preferred.

Reviewers: xingxue, stefanp, nemanjai, jasonliu

Reviewed By: xingxue

Subscribers: mgorny, kristina, jdoerfert, llvm-commits

Tags: #llvm

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355995 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-13 00:12:43 +00:00
Petr Hosek
308caddf91 [CMake] Support stripping and linking output to .build-id directory
When installing runtimes with install-runtimes-stripped, we don't want
to just strip them, we also want to preserve the debugging information
for potential debugging. To make it possible to later find the stripped
debugging information, we want to use the .build-id layout:

https://fedoraproject.org/wiki/RolandMcGrath/BuildID#Find_files_by_build_ID

That is, for libfoo.so with build ID abcdef1234, the debugging information
will be installed into lib/debug/.build-id/ab/cdef1234. llvm-objcopy
already has support for stripping files and linking the debugging
stripped output into the right location. However, CMake doesn't support
customizing strip invocation for the *-stripped targets. So instead, we
replace CMAKE_STRIP with a custom script that invokes llvm-objcopy with
the right command line flags.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355765 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-09 01:26:55 +00:00
Hubert Tong
60af31346f Add secondary libstdc++ 4.8 and 5.1 detection mechanisms
Summary:
The date-based approach to detecting unsupported versions of libstdc++
does not handle bug fix releases of older versions. As an example, the
`__GLIBCXX__` value associated with version 5.1, `20150422`, is less
than the values associated with versions 4.8.5 and 4.9.3.

This patch adds secondary checks based on certain properties in
sufficiently new versions of libstdc++.

Reviewers: jfb, tstellar, rnk, sfertile, nemanjai

Reviewed By: jfb

Subscribers: mgorny, llvm-commits

Tags: #llvm

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355638 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-07 21:28:33 +00:00
Rong Xu
0646a823c0 [PGO] Context sensitive PGO (part 4)
Part 4 of CSPGO changes:
(1) add support in cmake for cspgo build.
(2) fix an issue in big endian.
(3) test cases.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355541 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-06 19:31:37 +00:00
Francis Visoiu Mistrih
f43cce5263 [OptRemarks] Make OptRemarks more generic: rename OptRemarks to Remarks
Getting rid of the name "optimization remarks" for anything that
involves handling remarks on the client side.

It's safer to do this now, before we get stuck with that name in all the
APIs and public interfaces we decide to export to users in the future.

This renames llvm/tools/opt-remarks to llvm/tools/remarks-shlib, and now
generates `libRemarks.dylib` instead of `libOptRemarks.dylib`.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355439 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 20:45:17 +00:00
Shoaib Meenai
935d140874 [cmake] Create exports for umbrella library targets
When using the umbrella llvm-libraries and clang-libraries targets, we
should export all library targets, otherwise they'll be part of our
distribution but not usable from the CMake package.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355354 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-05 00:38:32 +00:00
Kamil Rytarowski
a83437e37e Revert duplicate check for DragonFly BSD
Summary: Revert duplicate check for DragonFly BSD

Submitted by tuxillo.

Reviewers: krytarowski

Reviewed By: krytarowski

Subscribers: mgorny, llvm-commits

Tags: #llvm

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355319 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 15:51:02 +00:00
Kamil Rytarowski
3e08ec3144 Unbreak shared library linkage on DragonFlyBSD.
Patch submitted by rimvydas.

Reviewers: llvm-commits, krytarowski, mgorny

Reviewed By: krytarowski, mgorny

Subscribers: mgorny

Tags: #llvm

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355315 91177308-0d34-0410-b5e6-96231b3b80d8
2019-03-04 14:36:43 +00:00
Tom Stellard
7112182b13 CMake: Fix stand-alone clang builds since r353268
Summary:
Handle the case where LLVM_MAIN_SRC_DIR is not set and also use
LLVM_CMAKE_DIR for locating installed cmake files rather than
LLVM_CMAKE_PATH.

Reviewers: phosek, andrewrk, smeenai

Reviewed By: phosek, andrewrk, smeenai

Subscribers: mgorny, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354417 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-20 01:11:05 +00:00
Daniel Sanders
d544d0c585 Fix builds with llvm/runtimes/compiler-rt after r354365
Compiler-rt doesn't include config-ix which was providing CheckSymbolExists to
the LLVM build. Add it to HandleLLVMOptions to fix this


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354389 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-19 22:02:38 +00:00
Daniel Sanders
660bc13d97 Fix builds for older macOS deployment targets after r354365
Surprisingly, check_symbol_exists is not sufficient. The macOS linker checks the
called functions against a compatibility list for the given deployment target
and check_symbol_exists doesn't trigger this check as it never calls the
function.

This fixes the GreenDragon bots where the deployment target is 10.9


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354374 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-19 19:45:03 +00:00
Daniel Sanders
20cf903d60 Annotate timeline in Instruments with passes and other timed regions.
Summary:
Instruments is a useful tool for finding performance issues in LLVM but it can
be difficult to identify regions of interest on the timeline that we can use
to filter the profiler or allocations instrument. Xcode 10 and the latest
macOS/iOS/etc. added support for the os_signpost() API which allows us to
annotate the timeline with information that's meaningful to LLVM.

This patch causes timer start and end events to emit signposts. When used with
-time-passes, this causes the passes to be annotated on the Instruments timeline.
In addition to visually showing the duration of passes on the timeline, it also
allows us to filter the profile and allocations instrument down to an individual
pass allowing us to find the issues within that pass without being drowned out
by the noise from other parts of the compiler.

Using this in conjunction with the Time Profiler (in high frequency mode) and
the Allocations instrument is how I found the SparseBitVector that should have
been a BitVector and the DenseMap that could be replaced by a sorted vector a
couple months ago. I added NamedRegionTimers to TableGen and used the resulting
annotations to identify the slow portions of the Register Info Emitter. Some of
these were placed according to educated guesses while others were placed
according to hot functions from a previous profile. From there I filtered the
profile to a slow portion and the aforementioned issues stood out in the
profile.

To use this feature enable LLVM_SUPPORT_XCODE_SIGNPOSTS in CMake and run the
compiler under Instruments with -time-passes like so:
  instruments -t 'Time Profiler' bin/llc -time-passes -o - input.ll'
Then open the resulting trace in Instruments.

There was a talk at WWDC 2018 that explained the feature which can be found at
https://developer.apple.com/videos/play/wwdc2018/405/ if you'd like to know
more about it.

Reviewers: bogner

Reviewed By: bogner

Subscribers: jdoerfert, mgorny, kristina, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354365 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-19 18:18:31 +00:00
Michal Gorny
95decc39b5 [llvm] [cmake] Provide split include paths in LLVMConfig
Modify LLVMConfig to provide split variables for in-source and generated
include paths.  Currently, it uses a single value for both
LLVM_INCLUDE_DIRS and LLVM_INCLUDE_DIR which works for install tree but
fails hard at build tree (where LLVM_INCLUDE_DIR incorrectly contains
multiple values).

Instead, put the generated directory in LLVM_INCLUDE_DIR, and the source
tree in LLVM_MAIN_INCLUDE_DIR which is consistent with in-LLVM builds.
For install tree, both variables will have the same value.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353924 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-13 08:34:40 +00:00
Michal Gorny
b041a3628d [llvm] [cmake] Use current directory in GenerateVersionFromVCS
Find dependent scripts of GenerateVersionFromVCS in current directory
rather than ../../cmake/modules.  I do not see any reason why the former
would not work and The latter is incorrect when GenerateVersionFromVCS
is used from install directory (i.e. in stand-alone builds).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353674 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11 09:07:07 +00:00
Mikhail R. Gadelha
838fcc69d6 This reverts commit 1440a848a635849b97f7a5cfa0ecc40d37451f5b.
and commit a1853e834c65751f92521f7481b15cf0365e796b.

They broke arm and aarch64

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353590 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-09 00:46:12 +00:00
Rong Xu
52585b5d4c [Cmake] Add an option to build LLVM using the experimental new pass manager
Add LLVM_USE_NEWPM to build LLVM using the experimental new pass manager.

Differential Revision: http://reviews.llvm.org/D57068


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353550 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-08 19:31:03 +00:00
Shoaib Meenai
e035747475 [cmake] Pass LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN to NATIVE configure
We should propagate this down to host builds so that e.g. people using
an optimized tablegen can do the sub-configure successfully.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353463 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-07 20:58:04 +00:00
JF Bastien
33c30c0b09 Bump minimum toolchain version
Summary:
The RFC on moving past C++11 got good traction:
  http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html

This patch therefore bumps the toolchain versions according to our policy:
  llvm.org/docs/DeveloperPolicy.html#toolchain

Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, mehdi_amini, jyknight, rsmith, chandlerc, smeenai, hans, reames, lattner, lhames, erichkeane

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353374 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-07 05:20:00 +00:00
Mikhail R. Gadelha
86ab198b4f Move the SMT API to LLVM
Moved everything SMT-related to LLVM and updated the cmake scripts.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353373 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-07 03:19:45 +00:00
Petr Hosek
b9adaa5e04 [CMake] Unify scripts for generating VCS headers
Previously, there were two different scripts for generating VCS headers:
one used by LLVM and one used by Clang and lldb. They were both similar,
but different. They were both broken in their own ways, for example the
one used by Clang didn't properly handle monorepo resulting in an
incorrect version information reported by Clang.

This change unifies two the scripts by introducing a new script that's
used from both LLVM, Clang and lldb, ensures that the new script
supports both monorepo and standalone SVN and Git setups, and removes
the old scripts.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353268 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-06 03:51:00 +00:00
JF Bastien
7ab3c4f085 Revert "Bump minimum toolchain version"
Reverting D57264 again, it looks like we're down to two bots that need fixing:

polly-amd64-linux
polly-arm-linux

They both have old versions of libstdc++ and recent clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352954 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-02 06:01:12 +00:00
JF Bastien
d9a8f328e9 Bump minimum toolchain version
Summary:
The RFC on moving past C++11 got good traction:
  http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html

This patch therefore bumps the toolchain versions according to our policy:
  llvm.org/docs/DeveloperPolicy.html#toolchain

Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, mehdi_amini, jyknight, rsmith, chandlerc, smeenai, hans, reames, lattner, lhames, erichkeane

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352951 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-02 05:15:34 +00:00
Stefan Granitz
4ce5f86edd [CMake] Add install targets for utilities to LLVM exports if LLVM_INSTALL_UTILS=ON
Summary: D56606 was only appending target names to the `LLVM_EXPORTS`/`LLVM_EXPORTS_BUILDTREE_ONLY` properties. Targets showed up correctly in the build-tree `LLVMExports.cmake`, but they were missing in the installed one (as we found in https://bugs.llvm.org/show_bug.cgi?id=40443), because install did not register them explicitly.

Reviewers: mgorny, smeenai, beanz, gottesmm, dschuff, tstellar, serge-sans-paille

Reviewed By: smeenai

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352869 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-01 13:08:09 +00:00
JF Bastien
75542197bc Revert "Bump minimum toolchain version"
Looks like we still have a few bots that are sad. Let try to get them fixed!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352835 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-01 04:44:39 +00:00
JF Bastien
67afd3256e Bump minimum toolchain version
Summary:
The RFC on moving past C++11 got good traction:
  http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html

This patch therefore bumps the toolchain versions according to our policy:
  llvm.org/docs/DeveloperPolicy.html#toolchain

Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, mehdi_amini, jyknight, rsmith, chandlerc, smeenai, hans, reames, lattner, lhames, erichkeane

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352834 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-01 04:33:21 +00:00
JF Bastien
d217469872 Revert "Bump minimum toolchain version"
A handful of bots are still breaking, either because I missed them in my audit,
they were offline, or something else. I'm contacting their authors, but I'll
revert for now and re-commit later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352814 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31 23:29:39 +00:00
JF Bastien
ba55936f14 Bump minimum toolchain version
Summary:
The RFC on moving past C++11 got good traction:
  http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html

This patch therefore bumps the toolchain versions according to our policy:
  llvm.org/docs/DeveloperPolicy.html#toolchain

Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, mehdi_amini, jyknight, rsmith, chandlerc, smeenai, hans, reames, lattner, lhames, erichkeane

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352811 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31 23:13:10 +00:00
Petr Hosek
ef0c5f5d9a Revert "[CMake] Unify scripts for generating VCS headers"
This reverts commits r352729 and r352731: this broke Sanitizer Windows bots

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352733 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31 07:12:43 +00:00
Petr Hosek
963f6097b6 [CMake] Unify scripts for generating VCS headers
Previously, there were two different scripts for generating VCS headers:
one used by LLVM and one used by Clang. They were both similar, but
different. They were both broken in their own ways, for example the one
used by Clang didn't properly handle monorepo resulting in an incorrect
version information reported by Clang.

This change unifies two the scripts by introducing a new script that's
used from both LLVM and Clang, ensures that the new script supports both
monorepo and standalone SVN and Git setups, and removes the old scripts.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352729 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31 06:21:01 +00:00
Stefan Granitz
a47be0e7cd [CMake] Accept ENTITLEMENTS in llvm_add_library()
Summary: We added support for code signing entitlements in add_llvm_executable() with D54443. In the future it would be useful to have this functionality available also for libraries.

Reviewers: beanz, bogner

Reviewed By: bogner

Subscribers: mgorny, llvm-commits, lldb-commits, #lldb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352628 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-30 15:10:08 +00:00
Michal Gorny
33a23da87f [cmake] Fix get_llvm_lit_path() to respect LLVM_EXTERNAL_LIT always
Refactor the get_llvm_lit_path() logic to respect LLVM_EXTERNAL_LIT,
and require the fallback to be defined explicitly
as LLVM_DEFAULT_EXTERNAL_LIT. This fixes building libcxx standalone
after r346888.

The old logic was using LLVM_EXTERNAL_LIT both as user-defined cache
variable and an optional pre-definition of default value from caller
(e.g. libcxx). It included a hack to make this work by assigning
the value back and forth but it was fragile and stopped working
in libcxx.

The new logic is simpler and more transparent. Default value is
provided in a separate variable, and used only when user-specified
variable is empty (i.e. not overriden).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352374 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-28 15:16:03 +00:00
JF Bastien
d1086040f5 Document toolchain update policy
Summary:
Capture the current agreed-upon toolchain update policy based on the following
discussions:

  - LLVM dev meeting 2018 BoF "Migrating to C++14, and beyond!"
    llvm.org/devmtg/2018-10/talk-abstracts.html#bof3
  - A Short Policy Proposal Regarding Host Compilers
    lists.llvm.org/pipermail/llvm-dev/2018-May/123238.html
  - Using C++14 code in LLVM (2018)
    lists.llvm.org/pipermail/llvm-dev/2018-May/123182.html
  - Using C++14 code in LLVM (2017)
    lists.llvm.org/pipermail/llvm-dev/2017-October/118673.html
  - Using C++14 code in LLVM (2016)
    lists.llvm.org/pipermail/llvm-dev/2016-October/105483.html
  - Document and Enforce new Host Compiler Policy
    llvm.org/D47073
  - Require GCC 5.1 and LLVM 3.5 at a minimum
    llvm.org/D46723

Subscribers: jkorous, dexonsmith, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351765 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-21 23:53:52 +00:00
JF Bastien
0a9f6969d5 [NFC] Factor out + document build requirements
Summary: This change factors out compiler checking / warning, and documents LLVM_FORCE_USE_OLD_TOOLCHAIN. It doesn't introduce any functional changes nor policy changes, these will come late.

Subscribers: mgorny, jkorous, dexonsmith, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351387 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-16 22:22:38 +00:00
Stefan Granitz
3436463bf7 [CMake] Export utility targets to the build/install tree depending on LLVM_BUILD/INSTALL_UTILS
Summary:
Allow external projects to import test-related targets like FileCheck, count, not etc. and query binary paths, properties, etc.
This would be useful for LLDB, because it reduces the difference between in-tree vs. standalone builds and simplifies CMake logic.

Reviewers: chapuni, gottesmm, beanz

Reviewed By: beanz

Subscribers: mgorny, lldb-commits, llvm-commits, #lldb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350959 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-11 19:34:34 +00:00
Stefan Granitz
9128e2a74d [CMake] Use XCODE_ATTRIBUTE properties for code signing and entitlements in Xcode
Summary: A post-commit comment to D55116 amended that this was the correct way for code signing in Xcode.

Reviewers: beanz

Reviewed By: beanz

Subscribers: mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350383 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-04 09:22:32 +00:00
Tom Stellard
0e521aca45 Fix mingw build failures caused by r349839
Reviewers: mstorsjo

Subscribers: mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349990 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-22 03:43:08 +00:00
Tom Stellard
61d8223a43 Fix Windows build failures caused by r349839
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349846 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-20 22:36:02 +00:00
Tom Stellard
69e8318af3 cmake: Remove add_llvm_loadable_module()
Summary:
This function is very similar to add_llvm_library(),  so this patch merges it
into add_llvm_library() and replaces all calls to add_llvm_loadable_module(lib ...)
with add_llvm_library(lib MODULE ...)

Reviewers: philip.pfaffe, beanz, chandlerc

Reviewed By: philip.pfaffe

Subscribers: chapuni, mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349839 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-20 22:04:08 +00:00
Alexandre Ganea
97a44c8311 Re-land "Fix MSVC dependency issue between Clang-tablegen and LLVM-tablegen"
(was reverted by mistake)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@349672 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-19 19:42:21 +00:00