1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00
Commit Graph

737 Commits

Author SHA1 Message Date
Saleem Abdulrasool
11c3ff3b6b Revert "Temporarily revert "build: use find_package(Python3) if available""
This reverts commit 35edd704e0fda09e8e634515c0b451d4a8b6b914.

Revert the revert and extend the patch further to account for the use of
the `PYTHONINTERP_FOUND`.
2020-04-29 01:38:08 +00:00
Eric Christopher
360f35ba0b Temporarily revert "build: use find_package(Python3) if available"
as it seems to be causing multiple people problems with running tests
and building.

This reverts commit c4c3883b00d3a6aa657a5e3e515c90c9ea1f81c6.
2020-04-28 16:41:22 -07:00
Saleem Abdulrasool
7fdfe5b88f build: use find_package(Python3) if available
This is primarily motivated by the desire to move from Python2 to
Python3.  `PYTHON_EXECUTABLE` is ambiguous.  This explicitly identifies
the python interpreter in use.  Since the LLVM build seems to be able to
completed successfully with python3, use that across the build.  The old
path aliases `PYTHON_EXECUTABLE` to be treated as Python3.
2020-04-28 09:24:27 -07:00
Raphael Isemann
7f19ba4dfc [lldb][cmake] Also use local submodule visibility on Darwin
Summary:
Currently building LLVM on macOS and on other platforms with LLVM_ENABLE_MODULES is using different module flags,
which means that a passing modules build on macOS might fail on Linux and vice versa. -fmodules-local-submodule-visibility
is the mode that has clearer semantics and is closer to the actual C++ module standard, so let's make this the default everywhere.

We can still test building without local submodule visibility on an additional bot by just changing the respective CMake flag. However,
if building without local-submodule-visibility breaks we won't revert other commits and we won't loose LLDB's/Clang's test run
information.

Reviewers: aprantl, bruno, Bigcheese

Reviewed By: Bigcheese

Subscribers: abidh, dexonsmith, JDevlieghere, lldb-commits, mgorny, llvm-commits

Tags: #llvm, #lldb

Differential Revision: https://reviews.llvm.org/D74892
2020-04-28 15:06:21 +02:00
Saleem Abdulrasool
e3224a705b Revert "build: use find_package(Python3) if available"
This reverts commit cd84bfb8142bc7ff3a07a188ffb809f1d86d1fd7.  Although
this passed the CI in phabricator, some of the bots are missing python3
packages, revert it temporarily.
2020-04-27 20:03:32 -07:00
Saleem Abdulrasool
1e606319f4 build: use find_package(Python3) if available
This is primarily motivated by the desire to move from Python2 to
Python3.  `PYTHON_EXECUTABLE` is ambiguous.  This explicitly identifies
the python interpreter in use.  Since the LLVM build seems to be able to
completed successfully with python3, use that across the build.  The old
path aliases `PYTHON_EXECUTABLE` to be treated as Python3.
2020-04-28 01:33:10 +00:00
Christopher Tetreault
f55cc8b846 [SVE] Make VectorType::getNumElements() complain for scalable vectors
Summary:
Piggy-back off of TypeSize's STRICT_FIXED_SIZE_VECTORS flag and:
- if it is defined, assert that the vector is not scalable
- if it is not defined, complain if the vector is scalable

Reviewers: efriedma, sdesmalen, c-rhodes

Reviewed By: sdesmalen

Subscribers: hiraditya, mgorny, tschuett, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78576
2020-04-23 10:47:38 -07:00
Louis Dionne
69bd69a351 [CMake] Add a warning message to prepare the upcoming upgrade to CMake 3.13.4
As discussed in http://lists.llvm.org/pipermail/llvm-dev/2020-March/140349.html,
the minimum version of CMake required to build LLVM will be upgraded to
3.13.4 right after we create the release branch for LLVM 11.0.0.

As part of this effort, this commit adds a warning to give a heads up
to folks regarding the upcoming upgrade. This should allow users to
upgrade their CMake in advance so that the upgrade can sail right
through when the time comes.

Differential Revision: https://reviews.llvm.org/D77740
2020-04-22 11:07:43 -04:00
Eric Schweitz
9247ec34a6 [Flang] add flang as a new subproject in cmake
Summary: This patch is some minor prep work for merging the flang(f18) project into the monorepo.  This patch adds "flang" as a supported target for the LLVM_ENABLE_PROJECTS option.

Reviewers: fhahn, tstellar, jdoerfert, beanz, DavidTruby

Reviewed By: DavidTruby

Subscribers: hfinkel, DavidTruby, aartbik, mgorny, llvm-commits

Tags: #flang, #llvm

Differential Revision: https://reviews.llvm.org/D72416
2020-04-09 16:13:18 +01:00
Shoaib Meenai
fc7368c8ed [cmake] Fix -stripped for umbrella library install targets
Make the install-llvm-libraries-stripped and install-clang-libraries-stripped
targets depend on the individual library stripped install targets, so
that they actually install the libraries.
2020-03-20 18:46:48 -07:00
Cullen Rhodes
157d5e9a63 [ValueTypes] Add EVT::isFixedLengthVector
Summary:
Related to D75672, this patch adds EVT::isFixedLengthVector to determine
if the underlying vector type is of fixed length.

An assert is introduced in EVT::getVectorNumElements that triggers for
types that aren't fixed length. This is currently guarded by a flag
added D75297 that is off by default and has been renamed to the more
generic ENABLE_STRICT_FIXED_SIZE_VECTORS.

Ideally we want to get rid of getVectorNumElements but a quick grep
shows there are >350 uses in lib/CodeGen and 75 in lib/Target/AArch64
alone. All of these probably aren't EVT::getVectorNumElements (some may
be the MVT equivalent), but there are many places to fixup and having
the assert on by default would make the SVE upstreaming effort
difficult.

Reviewers: sdesmalen, efriedma, ctetreau, huntergr, rengolin

Reviewed By: efriedma

Subscribers: mgorny, kristof.beyls, hiraditya, danielkiss, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76376
2020-03-19 10:08:17 +00:00
Sander de Smalen
d3c6cbfe17 [TypeSize] Allow returning scalable size in implicit conversion to uint64_t
This patch removes compiler runtime assertions that ensure the implicit
conversion are only guaranteed to work for fixed-width vectors.

With the assert it would be impossible to get _anything_ to build until
the
entire codebase has been upgraded, even when the indiscriminate uses of
the size as uint64_t would work fine for both scalable and fixed-width
types.

This issue will need to be addressed differently, with build-time errors
rather than assertion failures, but that effort falls beyond the scope
of this patch.

Returning the scalable size and avoiding the assert in getFixedSize()
is a temporary stop-gap in order to use LLVM for compiling and using
the SVE ACLE intrinsics.

Reviewers: efriedma, huntergr, rovka, ctetreau, rengolin

Reviewed By: efriedma

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75297
2020-03-15 13:48:49 +00:00
Amy Huang
24d4829906 CMake: Turn LLVM_ENABLE_ZLIB into a tri-state option
Summary:
Add FORCE_ON option to LLVM_ENABLE_ZLIB, which causes a configuration
error if zlib is not found.
Similar to https://reviews.llvm.org/D40050.

Reviewers: hans, thakis, rnk

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76110
2020-03-13 13:52:46 -07:00
Dylan McKay
475c6f503e [AVR] Include AVR by default in LLVM builds
This was initially committed and promptly reverted in 9059056e273ccc3a236751609e498b4c401eb6ff
after a MSan failure was found by the sanitizer bots.

These have since been fixed.

Summary:
This patch makes the AVR backend an official target of LLVM, serving
as a request for comments for moving the AVR backend out of
experimental.

A future patch will move the LLVM AVR buildbot (llvm-avr-linux) from the
staging buildmaster to the production buildmaster, so error emails will
start to go out.

Summary of the backend
----------------------

  - 16-bit little endian
  - AsmParser based assembly parser
  - uses the MC library for generating AVR ELFs
  - most logic driven from standard TableGen-erated tables like other
    backends
  - passes all of the test suite under `check-all`, including generic
    CodeGen and DebugInfo tests
  - Used in two frontends
  - Limited, but functional support for DebugInfo and LLVM DWARF dumping
  - Binary compatible with AVR-GCC and avr-{libc,libgcc} for the most part
  - Cannot lower 32-bit shifts due to a bug, can lower shifts larger or
    smaller
  - Supports assembly/MC for all the entire AVR ISA, generally generates poorly
    optimized machine instructions, with most focus thus far on correctness

I've added reviewers and subscribers from previous patches where backends were made official,
and those who participated in the recent thread on llvm-dev, please add anybody I've missed.

The most recent discussion on this topic can be found in the llvm-dev thread [Moving the AVR backend out of experimental](https://lists.llvm.org/pipermail/llvm-dev/2020-February/139158.html)

Reviewers: chandlerc, lattner, rengolin, tstellar, arsenm, thakis, simoll, asb

Reviewed By: rengolin, thakis

Subscribers: CryZe, wdng, mgorny, aprantl, Jim, hans, aykevl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75099
2020-03-13 17:40:30 +13:00
Dylan McKay
661d0f01ba Revert "[AVR] Include AVR by default in LLVM builds"
This reverts commit dfecec65e6796c075aebe50e88260a33aa2efd06.

Merging the change revealed that there is a failure on the memory
sanitizer bots.

    Command Output (stderr):
    --
    ==3569==WARNING: MemorySanitizer: use-of-uninitialized-value
        #0 0x1d71bff in
           llvm::AVRSubtarget::ParseSubtargetFeatures(llvm::StringRef,
    llvm::StringRef)
    /b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/lib/Target/AVR/AVRGenSubtargetInfo.inc:471:7
        #1 0x1d721f8 in initializeSubtargetDependencies
           /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Target/AVR/AVRSubtarget.cpp:50:3
        #2 0x1d721f8 in llvm::AVRSubtarget::AVRSubtarget(llvm::Triple
           const&, std::__1::basic_string<char, std::__1::char_traits<char>,
    std::__1::allocator<char> > const&, std::__1::basic_string<char,
    std::__1::char_traits<char>, std::__1::allocator<char> > const&,
    llvm::AVRTargetMachine const&)
    /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Target/AVR/AVRSubtarget.cpp:33:18
        #3 0x1d3077f in
           llvm::AVRTargetMachine::AVRTargetMachine(llvm::Target const&,
    llvm::Triple const&, llvm::StringRef, llvm::StringRef,
    llvm::TargetOptions const&, llvm::Optional<llvm::Reloc::Model>,
    llvm::Optional<llvm::CodeModel::Model>, llvm::CodeGenOpt::Level, bool)
    /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/lib/Target/AVR/AVRTargetMachine.cpp:52:7
        #4 0x1d3169d in
           llvm::RegisterTargetMachine<llvm::AVRTargetMachine>::Allocator(llvm::Target
    const&, llvm::Triple const&, llvm::StringRef, llvm::StringRef,
    llvm::TargetOptions const&, llvm::Optional<llvm::Reloc::Model>,
    llvm::Optional<llvm::CodeModel::Model>, llvm::CodeGenOpt::Level, bool)
    /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/TargetRegistry.h:1121:16
        #5 0x86662f in createTargetMachine
           /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/include/llvm/Support/TargetRegistry.h:402:12
        #6 0x86662f in compileModule(char**, llvm::LLVMContext&)
           /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:473:52
        #7 0x861f42 in main
           /b/sanitizer-x86_64-linux-fast/build/llvm-project/llvm/tools/llc/llc.cpp:356:22
        #8 0x7f76f7b072e0 in __libc_start_main
           (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
        #9 0x7ebbc9 in _start
           (/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/bin/llc+0x7ebbc9)

    SUMMARY: MemorySanitizer: use-of-uninitialized-value
    /b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/lib/Target/AVR/AVRGenSubtargetInfo.inc:471:7
    in llvm::AVRSubtarget::ParseSubtargetFeatures(llvm::StringRef,
    llvm::StringRef)
    Exiting
    FileCheck error: '<stdin>' is empty.
    --

The patch wiill be re-committed once fixed.
2020-03-12 19:53:46 +13:00
Dylan McKay
1719c58d99 [AVR] Include AVR by default in LLVM builds
Summary:
This patch makes the AVR backend an official target of LLVM, serving
as a request for comments for moving the AVR backend out of
experimental.

A future patch will move the LLVM AVR buildbot (llvm-avr-linux) from the
staging buildmaster to the production buildmaster, so error emails will
start to go out.

Summary of the backend
----------------------

  - 16-bit little endian
  - AsmParser based assembly parser
  - uses the MC library for generating AVR ELFs
  - most logic driven from standard TableGen-erated tables like other
    backends
  - passes all of the test suite under `check-all`, including generic
    CodeGen and DebugInfo tests
  - Used in two frontends
  - Limited, but functional support for DebugInfo and LLVM DWARF dumping
  - Binary compatible with AVR-GCC and avr-{libc,libgcc} for the most part
  - Cannot lower 32-bit shifts due to a bug, can lower shifts larger or
    smaller
  - Supports assembly/MC for all the entire AVR ISA, generally generates poorly
    optimized machine instructions, with most focus thus far on correctness

I've added reviewers and subscribers from previous patches where backends were made official,
and those who participated in the recent thread on llvm-dev, please add anybody I've missed.

The most recent discussion on this topic can be found in the llvm-dev thread [Moving the AVR backend out of experimental](https://lists.llvm.org/pipermail/llvm-dev/2020-February/139158.html)

Reviewers: chandlerc, lattner, rengolin, tstellar, arsenm, thakis, simoll, asb

Reviewed By: rengolin, thakis

Subscribers: CryZe, wdng, mgorny, aprantl, Jim, hans, aykevl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75099
2020-03-12 19:07:42 +13:00
Hans Wennborg
8f2b0ac07b Revert abb00753 "build: reduce CMake handling for zlib" (PR44780)
and follow-ups:
a2ca1c2d "build: disable zlib by default on Windows"
2181bf40 "[CMake] Link against ZLIB::ZLIB"
1079c68a "Attempt to fix ZLIB CMake logic on Windows"

This changed the output of llvm-config --system-libs, and more
importantly it broke stand-alone builds. Instead of piling on more fix
attempts, let's revert this to reduce the risk of more breakages.
2020-03-03 11:03:09 +01:00
David Tenty
94bdd8542e [AIX] Improve 32/64-bit build configuration
Summary:
AIX supports both 32-bit and 64-bit environments (with 32-bit being the default). This patch improves support for building LLVM on AIX in both 32-bit and 64-bit mode.

  - Change host detection to return correct 32/64-bit triple as config_guess does not return the correct version on 64-bit. This can confuse JIT tests and other things that care about what the host triple is.
  - Remove manual setting of 64-bit flags on AIX. AIX provides OBJECT_MODE environment variable to enable the user to obtain a 64-bit development environment. CMake will properly set these flags provided the user sets the correct OBJECT_MODE before configuring and setting them manually will interfere with 32-bit builds.
  - Don't present the LLVM_BUILD_32_BITS option on AIX, users should use OBJECT_MODE when running CMake instead.

Reviewers: hubert.reinterpretcast, DiggerLin, stevewan

Reviewed By: DiggerLin, stevewan

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74256
2020-02-20 15:41:00 -05:00
serge-sans-paille
cbe51c16a5 Fix compiler extension in standalone mode
Use a dedicated cmake file to store the extension configured within LLVM. That
way, a standalone build of clang can load this cmake file and get all the
configured standalone extensions.

This patch is related to https://reviews.llvm.org/D74602

Differential Revision: https://reviews.llvm.org/D74757
2020-02-20 07:19:04 +01:00
serge-sans-paille
dd5b542685 Fix integration of pass plugins with llvm dylib
Call llvm_process_pass_plugin from clang when in standalone mode.

Differential Revision: https://reviews.llvm.org/D74464
2020-02-13 14:18:08 +01:00
Eric Christopher
ee4be934c0 Continue removing llgo. 2020-02-10 10:33:58 -08:00
Hans Wennborg
54ef354524 Bump the trunk major version to 11
and clear the release notes.
2020-01-15 13:38:01 +01:00
Florian Hahn
909c049b0c Re-apply "[Examples] Add IRTransformations directory to examples."
This reverts commit 19fd8925a4afe6efd248688cce06aceff50efe0c.

Should include a fix for PR44197.
2020-01-04 15:47:23 +00:00
Saleem Abdulrasool
f0a4acd6fd build: disable zlib by default on Windows
zlib usage on Windows has caused issues in the past.  Furthermore, the
GNUWin32 library can be detected and used although the headers are not
available.  Require Windows to explicitly opt in.
2020-01-02 12:55:52 -08:00
Saleem Abdulrasool
ead085e3a4 build: reduce CMake handling for zlib
Rather than handling zlib handling manually, use `find_package` from CMake
to find zlib properly. Use this to normalize the `LLVM_ENABLE_ZLIB`,
`HAVE_ZLIB`, `HAVE_ZLIB_H`. Furthermore, require zlib if `LLVM_ENABLE_ZLIB` is
set to `YES`, which requires the distributor to explicitly select whether
zlib is enabled or not. This simplifies the CMake handling and usage in
the rest of the tooling.

This restores 68a235d07f9e7049c7eb0c8091f37e385327ac28,
e6c7ed6d2164a0659fd9f6ee44f1375d301e3cad.  The problem with the windows
bot is a need for clearing the cache.
2020-01-02 11:19:12 -08:00
James Henderson
880d4fcdcd Revert "build: make LLVM_ENABLE_ZLIB a tri-bool for users"
This reverts commit e6c7ed6d2164a0659fd9f6ee44f1375d301e3cad.

This commit was an attempt to fix the build bots, but it still left the
clang-x64-windows-msvc bot in a broken state.
2020-01-02 16:02:09 +00:00
serge_sans_paille
d4f51b5c4f Generalize the pass registration mechanism used by Polly to any third-party tool
There's quite a lot of references to Polly in the LLVM CMake codebase. However
the registration pattern used by Polly could be useful to other external
projects: thanks to that mechanism it would be possible to develop LLVM
extension without touching the LLVM code base.

This patch has two effects:

1. Remove all code specific to Polly in the llvm/clang codebase, replaicing it
   with a generic mechanism

2. Provide a generic mechanism to register compiler extensions.

A compiler extension is similar to a pass plugin, with the notable difference
that the compiler extension can be configured to be built dynamically (like
plugins) or statically (like regular passes).

As a result, people willing to add extra passes to clang/opt can do it using a
separate code repo, but still have their pass be linked in clang/opt as built-in
passes.

Differential Revision: https://reviews.llvm.org/D61446
2020-01-02 16:45:31 +01:00
Saleem Abdulrasool
d45a63d8ad build: make LLVM_ENABLE_ZLIB a tri-bool for users
Treat the flag `LLVM_ENABLE_ZLIB` as a tri-bool, `FORCE_ON` being `ON`,
and `ON` being an auto-detect.  This is needed as many of the builders
enable the flag without having zlib available.
2020-01-01 17:02:16 -08:00
Mehdi Amini
49a04ae84f Add mlir to -DLLVM_ALL_PROJECTS CMake option 2019-12-24 07:24:21 +00:00
Florian Hahn
975db73f36 Revert "[Examples] Add IRTransformations directory to examples."
This breaks LLVMExports.cmake in some build configurations.

PR44197

This reverts commits ceb72d07b004af9c428c4a3c73a98ea97d49a713
                     7d0b1d77b3d4d47df477519fd1bf099b3df6f899.
2019-12-01 22:20:20 +00:00
Tom Stellard
9c7e12f3ab [cmake] Emit an error for -DBUILD_SHARED_LIBS=ON on Windows
Summary:
The BUILD_SHARED_LIBS=ON build fails on Windows, so prevent users from
enabling it.

Reviewers: beanz, smeenai, compnerd, phosek

Reviewed By: beanz

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70161
2019-11-14 10:19:02 -08:00
Tom Stellard
a0be0e14e4 [cmake] Prevent building with BUILD_SHARED_LIBS and LLVM_LINK_LLVM_DYLIB
Summary: This doesn't work, so error early if someone tries it.

Reviewers: beanz, smeenai, compnerd, phosek

Reviewed By: beanz

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D70160
2019-11-13 21:29:31 -08:00
Florian Hahn
2d3ee56e42 [Examples] Add IRTransformations directory to examples.
This patch adds a new IRTransformations directory to llvm/examples/. This is
intended to serve as a new home for example transformations/analysis
code used by various tutorials.

If LLVM_BUILD_EXAMPLES is enabled, the ExamplesIRTransforms library is
linked into the opt binary and the example passes become available.

To start off with, it contains the CFG simplifications used in the IR
part of the 'Getting Started With LLVM: Basics' tutorial at the US LLVM
Developers Meeting 2019.

Reviewers: paquette, jfb, meikeb, lhames, kbarton

Reviewed By: paquette

Differential Revision: https://reviews.llvm.org/D69416
2019-11-12 14:14:48 +00:00
Nick Desaulniers
0bb73bce11 change LLVM_VERSION_SUFFIX default from svn to git
Summary:
Sayonara SVN!

Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

Reviewers: tstellar, jyknight, lebedev.ri, smeenai, mgorny, hans, mclow.lists

Reviewed By: mgorny, hans

Subscribers: christof, libcxx-commits, llvm-commits, srhines

Tags: #libc, #llvm

Differential Revision: https://reviews.llvm.org/D70019
2019-11-11 09:10:20 -08:00
Tom Stellard
fbd15449ff [cmake] Remove LLVM_{BUILD,LINK}_LLVM_DYLIB options on Windows
Summary: The options aren't supported so they can be removed.

Reviewers: beanz, smeenai, compnerd

Reviewed By: compnerd

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69877
2019-11-08 10:37:16 -08:00
Tom Stellard
88a51c3cc2 [cmake] Remove SVN support from VersionFromVCS.cmake
Reviewers: phosek

Subscribers: mgorny, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69682
2019-11-08 09:59:42 -08:00
Saleem Abdulrasool
f93757f9ac build: remove LLVM_CXX_STD extension point
This extension point is not needed. Provide the equivalent option
through `CMAKE_CXX_STANDARD` which mirrors the previous extension point. Rely on
CMake to provide the check for the compiler instead.
2019-10-25 11:51:47 -07:00
Saleem Abdulrasool
a7c91a3847 build: reindent text (NFC)
Replace some hard tabs with spaces.  NFC.
2019-10-25 08:54:39 -07:00
Siva Chandra
2163117495 Add few docs and implementation of strcpy and strcat.
Summary:
This patch illustrates some of the features like modularity we want
in the new libc. Few other ideas like different kinds of testing, redirectors
etc are not yet present.

Reviewers: dlj, hfinkel, theraven, jfb, alexshap, jdoerfert

Subscribers: mgorny, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 373764
2019-10-04 17:30:54 +00:00
Djordje Todorovic
20b221afa5 Reland "[utils] Implement the llvm-locstats tool"
The tool reports verbose output for the DWARF debug location coverage.
The llvm-locstats for each variable or formal parameter DIE computes what
percentage from the code section bytes, where it is in scope, it has
location description. The line 0 shows the number (and the percentage) of
DIEs with no location information, but the line 100 shows the number (and
the percentage) of DIEs where there is location information in all code
section bytes (where the variable or parameter is in the scope). The line
50..59 shows the number (and the percentage) of DIEs where the location
information is in between 50 and 59 percentage of its scope covered.

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

The cause of the test failure was resolved.

llvm-svn: 373427
2019-10-02 07:00:01 +00:00
Djordje Todorovic
3ef644a00f Revert "Reland "[utils] Implement the llvm-locstats tool""
This reverts commit rL373317 due to test failure on the
clang-s390x-linux build bot.

llvm-svn: 373336
2019-10-01 13:21:15 +00:00
Djordje Todorovic
cecb4ad7fc Reland "[utils] Implement the llvm-locstats tool"
The tool reports verbose output for the DWARF debug location coverage.
The llvm-locstats for each variable or formal parameter DIE computes what
percentage from the code section bytes, where it is in scope, it has
location description. The line 0 shows the number (and the percentage) of
DIEs with no location information, but the line 100 shows the number (and
the percentage) of DIEs where there is location information in all code
section bytes (where the variable or parameter is in the scope). The line
50..59 shows the number (and the percentage) of DIEs where the location
information is in between 50 and 59 percentage of its scope covered.

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

llvm-svn: 373317
2019-10-01 09:59:15 +00:00
Djordje Todorovic
daa23ce8ba Revert "Reland "[utils] Implement the llvm-locstats tool""
This reverts commit rL373183.

llvm-svn: 373200
2019-09-30 11:19:11 +00:00
Djordje Todorovic
faafb41cf2 Reland "[utils] Implement the llvm-locstats tool"
The tool reports verbose output for the DWARF debug location coverage.
The llvm-locstats for each variable or formal parameter DIE computes what
percentage from the code section bytes, where it is in scope, it has
location description. The line 0 shows the number (and the percentage) of
DIEs with no location information, but the line 100 shows the number (and
the percentage) of DIEs where there is location information in all code
section bytes (where the variable or parameter is in the scope). The line
50..59 shows the number (and the percentage) of DIEs where the location
information is in between 50 and 59 percentage of its scope covered.

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

llvm-svn: 373183
2019-09-30 07:35:17 +00:00
Djordje Todorovic
c4d5e78650 Revert "Reland "[utils] Implement the llvm-locstats tool""
This reverts commit rL372554.

llvm-svn: 372580
2019-09-23 11:04:11 +00:00
Djordje Todorovic
1249d7b040 Reland "[utils] Implement the llvm-locstats tool"
The tool reports verbose output for the DWARF debug location coverage.
The llvm-locstats for each variable or formal parameter DIE computes what
percentage from the code section bytes, where it is in scope, it has
location description. The line 0 shows the number (and the percentage) of
DIEs with no location information, but the line 100 shows the number (and
the percentage) of DIEs where there is location information in all code
section bytes (where the variable or parameter is in the scope). The line
50..59 shows the number (and the percentage) of DIEs where the location
information is in between 50 and 59 percentage of its scope covered.

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

llvm-svn: 372554
2019-09-23 07:57:53 +00:00
Russell Gallop
eddfe913c8 [cmake] Changes to get Windows self-host working with PGO
Fixes quoting of profile arguments to work on Windows
Suppresses adding profile arguments to linker flags when using lld-link
Avoids -fprofile-instr-use being added to rc.exe flags
Removes duplicated adding of -fprofile-instr-use to linker flags (since
r355541)
Move handling LLVM_PROFDATA_FILE to HandleLLVMOptions.cmake

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

llvm-svn: 372209
2019-09-18 09:43:13 +00:00
Djordje Todorovic
0dec37607c Revert "[utils] Implement the llvm-locstats tool"
This reverts commit rL371520.

llvm-svn: 371527
2019-09-10 14:48:52 +00:00
Djordje Todorovic
64810143df [utils] Implement the llvm-locstats tool
The tool reports verbose output for the DWARF debug location coverage.
The llvm-locstats for each variable or formal parameter DIE computes what
percentage from the code section bytes, where it is in scope, it has
location description. The line 0 shows the number (and the percentage) of
DIEs with no location information, but the line 100 shows the number (and
the percentage) of DIEs where there is location information in all code
section bytes (where the variable or parameter is in the scope). The line
50..59 shows the number (and the percentage) of DIEs where the location
information is in between 50 and 59 percentage of its scope covered.

The tool will be very useful for tracking improvements regarding the
"debugging optimized code" support with LLVM ecosystem.

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

llvm-svn: 371520
2019-09-10 13:47:03 +00:00
Reid Kleckner
fa08039609 Revert Autogenerate the shebang lines for tools/opt-viewer
This reverts r369486 (git commit 8d18384809957cc923752e10a86adab129e3df48)

The opt-viewer tests don't pass after this change, and fixing them isn't
trivial. opt-viewer.py imports optmap, which requires adjusting
pythonpath, which is more work than I'm willing to do to fix forward.

llvm-svn: 370095
2019-08-27 18:31:29 +00:00
Chris Bieneman
91c7b0fa0a Autogenerate the shebang lines for tools/opt-viewer
Summary:
Since these files depend on the built python modules, they need to use
the right python binary to run them. So use configure_file
to set the right shebang line.

Patch By: cbiesinger (Christian Biesinger)

Reviewers: chandlerc, beanz, anemet

Reviewed By: anemet

Subscribers: compnerd, JDevlieghere, mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 369486
2019-08-21 01:48:28 +00:00
Erich Keane
8d0fafd361 Add support in CMake to statically link the C++ standard library.
It is sometimes useful to have the C++ standard library linked into the
assembly when compiling clang, particularly when distributing a compiler
onto systems that don't have a copy of stdlibc++ or libc++ installed.

This functionality should work with either GCC or Clang as the host
compiler, though statically linking libc++ (as may be required for
licensing purposes) is only possible if the host compiler is Clang with
a copy of libc++ available.

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

llvm-svn: 368907
2019-08-14 19:55:59 +00:00
Taewook Oh
48f2a6060d Revert the test commit
llvm-svn: 368485
2019-08-09 20:52:39 +00:00
Taewook Oh
8bf02984b8 Test commit.
llvm-svn: 368483
2019-08-09 20:48:53 +00:00
Anusha Basana
cb472f88b8 [build] Add the ability to create a symlink for lipo
Add user enabled option to create lipo with symlink to llvm-lipo
Used rL326381 for reference.

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

llvm-svn: 367444
2019-07-31 16:46:57 +00:00
Reid Kleckner
cc02ce21c7 Remove cmake checks for MSVC 1900 / VS 2013
Our minimum Visual C++ version is 19.10 from Visual Studio 2017.

llvm-svn: 367362
2019-07-30 22:49:11 +00:00
Rainer Orth
add56503a4 [CMake] Define _FILE_OFFSET_BITS=64 on Solaris
This is the compantion patch to https://reviews.llvm.org/D64482, needed to ensure
that builds with host compilers that don't yet predefine _FILE_OFFSET_BITS=64 on
Solaris succeed by always making the host and freshly built clang consistent.

Tested on x86_64-pc-solaris2.11.

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

llvm-svn: 367304
2019-07-30 10:33:20 +00:00
Yuanfang Chen
2031d6473b [CMake] Allow LLVM_EXTERNAL_<proj>_SOURCE_DIR to be overridden if it is
empty.

This makes adding projects to LLVM_ENABLE_PROJECTS possible.
Also its type should be PATH.

https://bugs.llvm.org/show_bug.cgi?id=42698

Reviewers: beanz, greened, chapuni

Reviewed by: beanz

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

llvm-svn: 367144
2019-07-26 19:25:57 +00:00
Nathan Lanza
da00888661 [cmake] Convert the NATIVE llvm build process to be project agnostic
lldb recently added a tablegen tool. In order to properly cross compile
lldb standalone there needs to be a mechanism to generate the native
lldb build, analgous to what's done for the NATIVE llvm build. Thus,
we can simply modify this setup to allow for any project to be used.

llvm-svn: 366514
2019-07-19 00:10:06 +00:00
Jonas Devlieghere
261b5c3196 [CMake] Don't set Python_ADDITIONAL_VERSIONS
Until recently, Python_ADDITIONAL_VERSIONS was used to limit LLVM's
Python support to 2.7. Now that both LLVM and LLDB both support Python
3, there's no longer a need to put an arbitrary limit on this.

However, instead of removing the variable, r365692 expanded the list,
which has the (presumably unintentional) side-effect of expression
preference for Python 3.

Instead, as Michal proposed in the original code review, we should just
not set the list at all, and let CMake pick whatever Python interpreter
you have in your path.

This patch removes the Python_ADDITIONAL_VERSIONS variable in llvm,
clang and lld. I've also updated the docs with the default behavior and
how to force a different Python version to be used.

Differential revision: https://reviews.llvm.org/D64894

llvm-svn: 366447
2019-07-18 15:17:42 +00:00
Hans Wennborg
e94ea4cdc9 Bump the trunk version to 10.0.0svn
and clear the release notes.

llvm-svn: 366427
2019-07-18 11:51:05 +00:00
Alex Bradbury
8dc7041dd2 [RISCV] Re-land r366331 d RISCV to LLVM_ALL_TARGETS
*San flagged issues should be now be addressed.

llvm-svn: 366399
2019-07-18 04:05:18 +00:00
Alex Bradbury
b5b1a8e845 [RISCV] Revert r366331 as it exposed some sanitizer failures
See <http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/33612>.

llvm-svn: 366343
2019-07-17 16:14:52 +00:00
Alex Bradbury
f9dfb8c6a2 [RISCV] Add RISCV to LLVM_ALL_TARGETS so it s built by default
This follows the RFC <http://lists.llvm.org/pipermail/llvm-dev/2019-July/133724.html>.

Follow-on commits will add appropriate release notes changes etc.

Pushing this now and in a minimal form so there is reasonable time before 9.0
branches to resolve any issues arising from e.g. the backend being exposed on
different sanitizer setups.

The current builder for RISC-V is on the staging build-bot
<http://lab.llvm.org:8014/builders/llvm-riscv-linux>, however with the RISCV
backend being built by default it won't provide any real additional coverage.
We will shortly set up a builder that runs the test-suite in qemu-user.

llvm-svn: 366331
2019-07-17 14:32:25 +00:00
Nico Weber
95b0d08af1 Add support for building with Python 3
LLDB supports Python 3 now.

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

Patch from Christian Biesinger <cbiesinger@google.com>!

llvm-svn: 365692
2019-07-10 19:31:25 +00:00
Chris Bieneman
40e05dc8c2 Fix issues building libraries as more than one type with Xcode
Summary:
CMake+Xcode doesn't seem to handle targets that only have object
sources. This patch works around that limitation by adding a dummy
soruce file to any library target that is generated by llvm_add_library
when object libraries are generated.

Object libraries are generated whenever llvm_add_library is passed more
than one library type, which is now the default case for clang static
libraries (which generate STATIC and OBJECT libraries).

Reviewers: zturner, compnerd, joanlluch

Reviewed By: joanlluch

Subscribers: joanlluch, xbolva00, mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 365365
2019-07-08 18:29:29 +00:00
Saleem Abdulrasool
0d0cbbbdf4 build: extract LLVM distribution target handling
This extracts the LLVM distribution target handling into a support module.
Extraction will enable us to restructure the builds to support multiple
distribution configurations (e.g. developer and user) to permit us to build the
development package and the user package at once.

llvm-svn: 363440
2019-06-14 18:28:57 +00:00
David Tenty
d4999fa5bd Build with _XOPEN_SOURCE defined on AIX
Summary:
It is useful to build with _XOPEN_SOURCE defined on AIX, enabling X/Open
and POSIX compatibility mode, to work around stray macros and other
bugs in the headers provided by the system and build compiler.

This patch adds the config to cmake to build with _XOPEN_SOURCE defined
on AIX with a few exceptions. Google Test internals require access to
platform specific thread info constructs on AIX so in that case we build
with _ALL_SOURCE defined instead. Libclang also uses header which needs
_ALL_SOURCE on AIX so we leave that as is as well.

We also add building on AIX with the large file API and doing CMake
header checks with X/OPEN definitions so the results are consistent with
the environment that will be present in the build.

Reviewers: hubert.reinterpretcast, xingxue, andusy

Reviewed By: hubert.reinterpretcast

Subscribers: mgorny, jsji, cfe-commits, llvm-commits

Tags: #llvm, #clang

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

llvm-svn: 362808
2019-06-07 15:45:25 +00:00
David Zarzycki
90b5884fef Unbreak my hasty "unbreak" cmake fix
llvm-svn: 362492
2019-06-04 11:33:49 +00:00
David Zarzycki
4bdcfdd659 Unbreak non-PIC builds after r362390 / D62720
llvm-svn: 362399
2019-06-03 13:39:49 +00:00
Don Hinton
8b85cd846b [test] Fix plugin tests
Recommit of r361790 that was temporarily reverted in r361793 due to bot breakage.

Summary:
The following changes were required to fix these tests:

1) Change LLVM_ENABLE_PLUGINS to an option and move it to
   llvm/CMakeLists.txt with an appropriate default -- which matches
   the original default behavior.

2) Move the plugins directory from clang/test/Analysis
   clang/lib/Analysis.  It's not enough to add an exclude to the
   lit.local.cfg file because add_lit_testsuites recurses the tree and
   automatically adds the appropriate `check-` targets, which don't
   make sense for the plugins because they aren't tests and don't
   have `RUN` statements.

   Here's a list of the `clang-check-anlysis*` targets with this
   change:

```
  $ ninja -t targets all| sed -n "s/.*\/\(check[^:]*\):.*/\1/p" | sort -u | grep clang-analysis
  check-clang-analysis
  check-clang-analysis-checkers
  check-clang-analysis-copypaste
  check-clang-analysis-diagnostics
  check-clang-analysis-engine
  check-clang-analysis-exploration_order
  check-clang-analysis-html_diagnostics
  check-clang-analysis-html_diagnostics-relevant_lines
  check-clang-analysis-inlining
  check-clang-analysis-objc
  check-clang-analysis-unified-sources
  check-clang-analysis-z3
```

3) Simplify the logic and only include the subdirectories under
   clang/lib/Analysis/plugins if LLVM_ENABLE_PLUGINS is set.

Reviewed By: NoQ

Tags: #clang, #llvm

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

llvm-svn: 362328
2019-06-02 15:53:43 +00:00
Petr Hosek
ddcad306ab [CMake] Use libtool for runtimes when building for Apple platform
LLVM CMake build already uses libtool instead of ar when building
for Apple platform and we should be using the same when building
runtimes. To do so, this change extracts the logic for finding
libtool into a separate file and then uses it from both the LLVM
build as well as the LLVM runtimes build.

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

llvm-svn: 362313
2019-06-02 02:05:01 +00:00
Alexandre Ganea
04498a83a8 Revert r361826, as it still breaks LLDB.
llvm-svn: 361837
2019-05-28 15:04:39 +00:00
Alexandre Ganea
023ca6322c [CMake] Default options for faster executables on MSVC
Differential Revision: https://reviews.llvm.org/D55056

llvm-svn: 361826
2019-05-28 14:14:48 +00:00
Don Hinton
80dfad1fb5 Revert [test] Fix plugin tests
This reverts r361790 (git commit fe5eaab2b5b4523886bd63aebcfea8cfce586fa1)

It's causing buildbot breakage, so reverting while I investigate.

llvm-svn: 361793
2019-05-28 06:38:16 +00:00
Don Hinton
ad324f4b75 [test] Fix plugin tests
Summary:
The following changes were required to fix these tests:

1) Change LLVM_ENABLE_PLUGINS to an option and move it to
   llvm/CMakeLists.txt with an appropriate default -- which matches
   the original default behavior.

2) Move the plugins directory from clang/test/Analysis
   clang/lib/Analysis.  It's not enough to add an exclude to the
   lit.local.cfg file because add_lit_testsuites recurses the tree and
   automatically adds the appropriate `check-` targets, which don't
   make sense for the plugins because they aren't tests and don't
   have `RUN` statements.

   Here's a list of the `clang-check-anlysis*` targets with this
   change:

```
  $ ninja -t targets all| sed -n "s/.*\/\(check[^:]*\):.*/\1/p" | sort -u | grep clang-analysis
  check-clang-analysis
  check-clang-analysis-checkers
  check-clang-analysis-copypaste
  check-clang-analysis-diagnostics
  check-clang-analysis-engine
  check-clang-analysis-exploration_order
  check-clang-analysis-html_diagnostics
  check-clang-analysis-html_diagnostics-relevant_lines
  check-clang-analysis-inlining
  check-clang-analysis-objc
  check-clang-analysis-unified-sources
  check-clang-analysis-z3
```

3) Simplify the logic and only include the subdirectories under
   clang/lib/Analysis/plugins if LLVM_ENABLE_PLUGINS is set.

Reviewed By: NoQ

Tags: #clang, #llvm

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

llvm-svn: 361790
2019-05-28 06:26:58 +00:00
Hans Wennborg
035eb0e33a Cmake: allow using LLVM_EXTERNAL_PROJECTS with LLVM_ENABLE_PROJECTS
The current code iterates over the combination of LLVM_EXTERNAL_PROJECTS
and LLVM_ENABLE_PROJECTS, but then disables projects that are only in
the former. If a project is in LLVM_EXTERNAL_PROJECTS, it should be
enabled.

See also llvm-commits thread on r354060.

Differential revision: https://reviews.llvm.org/D62289

llvm-svn: 361751
2019-05-27 09:03:00 +00:00
Saleem Abdulrasool
194593f243 build: enable CMake policy 0077
Enable CMake policy 77. This alters the behavior of option. The old behavior
would remove the value of the option from the cache and create a new one. The
new behavior does not create the variable if it is defined already. This ensures
that subsequent reconfigures will behave identically. This seems better than the
setting of OLD - the desire is to ensure that it is set to OLD or NEW.

llvm-svn: 361307
2019-05-21 20:28:32 +00:00
Saleem Abdulrasool
3c0a69a728 build: add option to disable unwind tables
The unwind tables (`.eh_frame`, `.arm.extab`) add a significant chunk of data to
the final binaries.  These should not be needed normally, particularly when
exceptions are disabled.  This enables shrinking `lldb-server` by ~18% (3 MiB)
when built with gold.

llvm-svn: 359819
2019-05-02 19:37:26 +00:00
Justin Bogner
7c89ab3542 [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.

llvm-svn: 357976
2019-04-09 08:14:32 +00:00
Justin Bogner
dda7e6e86e [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

llvm-svn: 357899
2019-04-08 10:19:17 +00:00
Mikhail R. Gadelha
81dc3f1c2d Moved everything SMT-related to LLVM and updated the cmake scripts.
Differential Revision: https://reviews.llvm.org/D54978

llvm-svn: 356929
2019-03-25 17:47:45 +00:00
Serge Guelton
ff8e1cddfe Use response file when generating LLVM-C.dll
As discovered in D56774 the command line gets to long, so use a response file
to give the script the libs. This change has been tested and is confirmed
working for me.

Commited on behalf of Jakob Bornecrantz.
Differential Revision: https://reviews.llvm.org/D56781

llvm-svn: 356443
2019-03-19 09:14:09 +00:00
Shoaib Meenai
5553db103b [cmake] Remove llvm from LLVM_ALL_PROJECTS
LLVM is always built; including it in LLVM_ENABLE_PROJECTS has no
effect, but since it's in LLVM_ALL_PROJECTS, we produce a confusing
message about it being disabled. Drop it from LLVM_ALL_PROJECTS to avoid
this. Pointed out by David Greene on the mailing list [1].

[1] http://lists.llvm.org/pipermail/llvm-dev/2019-March/130854.html

llvm-svn: 355735
2019-03-08 21:10:22 +00:00
Rong Xu
36a2adc1b6 [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

llvm-svn: 355541
2019-03-06 19:31:37 +00:00
David Greene
c8d9305d8b [CMake] Honor LLVM_EXTERNAL_<proj>_SOURCE_DIR
When LLVM_ENABLE_PROJECTS is set, CMake assumes the project
directories are all side-by-side. This is not always the case and
there's no reason to expect it if LLVM_EXTERNAL_<proj>_SOURCE_DIR is
set. Honor that setting if it exists and allow the build configuration
to continue.

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

llvm-svn: 354693
2019-02-22 21:19:48 +00:00
Chris Bieneman
1e565cb741 [CMake] Fix ability to use LLVM_ENABLE_PROJECTS with LLVM_EXTERNAL_PROJECTS
LLVM r353148, changed the circumstances in which the project source directory variables are created to only create them for LLVM projects. This patch initializes the directory variables for projects specified in `LLVM_EXTERNAL_PROJECTS` as well.

llvm-svn: 354060
2019-02-14 20:57:17 +00:00
Nico Weber
c0ea1c7758 Stop enabling clang-tools-extra automatically when clang is in LLVM_ENABLE_PROJECTS
If you want to build clang-tools-extra with monorepo, just add it to
LLVM_ENABLE_PROJECTS like with other projects.

See also "Separating clang-tools-extra from clang in LLVM_ENABLE_PROJECTS"
on cfe-dev.

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

llvm-svn: 354057
2019-02-14 20:26:35 +00:00
Mikhail R. Gadelha
7db7f7f32f This reverts commit 1440a848a635849b97f7a5cfa0ecc40d37451f5b.
and commit a1853e834c65751f92521f7481b15cf0365e796b.

They broke arm and aarch64

llvm-svn: 353590
2019-02-09 00:46:12 +00:00
JF Bastien
406b84702a 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

llvm-svn: 353374
2019-02-07 05:20:00 +00:00
Mikhail R. Gadelha
dd981b7599 Move the SMT API to LLVM
Moved everything SMT-related to LLVM and updated the cmake scripts.

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

llvm-svn: 353373
2019-02-07 03:19:45 +00:00
Shoaib Meenai
3b39a97613 [cmake] Drop clang-tools-extra from LLVM_ALL_PROJECTS
We iterate over the list and only enable projects from that list that
are present in LLVM_ENABLE_PROJECTS and disable all other projects. Most
users will only specify clang in LLVM_ENABLE_PROJECTS and expect
clang-tools-extra to be implicitly enabled, so remove clang-tools-extra
from LLVM_ALL_PROJECTS so that it doesn't get disabled instead.

llvm-svn: 353354
2019-02-07 01:12:56 +00:00
Shoaib Meenai
68e88cc389 [cmake] Add all subprojects to LLVM_ALL_PROJECTS
Make LLVM_ALL_PROJECTS reflect all top-level directories in the monorepo
rather than an arbitrary subset. clang-tools-extra is technically
unnecessary since it gets enabled by clang, but having it there for
consistency shouldn't hurt either.

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

llvm-svn: 353346
2019-02-06 21:49:47 +00:00
Shoaib Meenai
aa63f32415 [cmake] Add openmp to LLVM_ALL_PROJECTS
It'll get ignored in LLVM_ENABLE_PROJECTS after r353148 otherwise.

llvm-svn: 353343
2019-02-06 21:08:17 +00:00
Petr Hosek
ec05af2652 [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

llvm-svn: 353268
2019-02-06 03:51:00 +00:00
Dan Liew
8939afb9f3 Previously if the user configured their build but then changed
LLVM_ENABLED_PROJECT and reconfigured it had no effect on what
projects were actually built. This was very confusing behaviour. The
reason for this is that the value of the `LLVM_TOOL_<PROJECT>_BUILD`
variables are already set.

The problem here is that we have two sources of truth:

* The projects listed in LLVM_ENABLE_PROJECTS.
* The projects enabled/disabled with LLVM_TOOL_<PROJECT>_BUILD.

At configure time we have no real way of knowing which source of truth
the user wants so we apply the following heuristic:

If the user ever sets `LLVM_ENABLE_PROJECTS` in the CMakeCache then that
is used as the single source of truth and we force the
`LLVM_TOOL_<PROJECT>_BUILD` CMake cache variables to have the
appropriate values that match the contents of the
`LLVM_ENABLE_PROJECTS`. If the user never sets `LLVM_ENABLE_PROJECTS`
then they can continue to use and set the `LLVM_TOOL_<PROJECT>_BUILD`
variables as the "source of truth".

The problem with this approach is that if the user ever tries to use
both `LLVM_ENABLE_PROJECTS` and `LLVM_TOOL_<PROJECT>_BUILD` for the same
build directory then any user set value for `LLVM_TOOL_<PROJECT>_BUILD`
variables will get overwriten, likely without the user noticing.

Hopefully the above shouldn't matter in practice because the
LLVM_TOOL_<PROJECT>_BUILD variables are not documented, but
LLVM_ENABLE_PROJECTS is.

We should probably deprecate the `LLVM_TOOL_<PROJECT>_BUILD`
variables at some point by turning them into to regular CMake
variables that don't live in the CMake cache.

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

llvm-svn: 353148
2019-02-05 08:47:28 +00:00
JF Bastien
495652a992 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.

llvm-svn: 352954
2019-02-02 06:01:12 +00:00
JF Bastien
5b2eb5b50c 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

llvm-svn: 352951
2019-02-02 05:15:34 +00:00
JF Bastien
d34b028451 Revert "Bump minimum toolchain version"
Looks like we still have a few bots that are sad. Let try to get them fixed!

llvm-svn: 352835
2019-02-01 04:44:39 +00:00
JF Bastien
0621177282 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

llvm-svn: 352834
2019-02-01 04:33:21 +00:00