2019-02-21 18:37:26 +00:00
|
|
|
find_first_existing_vc_file("${LLVM_MAIN_SRC_DIR}" llvm_vc)
|
|
|
|
find_first_existing_vc_file("${LLD_SOURCE_DIR}" lld_vc)
|
|
|
|
|
|
|
|
set(version_inc "${CMAKE_CURRENT_BINARY_DIR}/VCSVersion.inc")
|
2021-09-16 18:27:53 +02:00
|
|
|
set(generate_vcs_version_script "${LLVM_CMAKE_DIR}/GenerateVersionFromVCS.cmake")
|
2019-02-21 18:37:26 +00:00
|
|
|
|
2020-01-16 19:04:08 -05:00
|
|
|
if(lld_vc AND LLVM_APPEND_VC_REV)
|
2019-02-21 18:37:26 +00:00
|
|
|
set(lld_source_dir ${LLD_SOURCE_DIR})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_custom_command(OUTPUT "${version_inc}"
|
|
|
|
DEPENDS "${lld_vc}" "${generate_vcs_version_script}"
|
|
|
|
COMMAND ${CMAKE_COMMAND} "-DNAMES=LLD"
|
2020-01-16 19:04:08 -05:00
|
|
|
"-DLLD_SOURCE_DIR=${lld_source_dir}"
|
2019-02-21 18:37:26 +00:00
|
|
|
"-DHEADER_FILE=${version_inc}"
|
2023-09-25 14:32:52 +01:00
|
|
|
"-DLLVM_FORCE_VC_REVISION=${LLVM_FORCE_VC_REVISION}"
|
|
|
|
"-DLLVM_FORCE_VC_REPOSITORY=${LLVM_FORCE_VC_REPOSITORY}"
|
2019-02-21 18:37:26 +00:00
|
|
|
-P "${generate_vcs_version_script}")
|
|
|
|
|
|
|
|
# Mark the generated header as being generated.
|
|
|
|
set_source_files_properties("${version_inc}"
|
|
|
|
PROPERTIES GENERATED TRUE
|
|
|
|
HEADER_FILE_ONLY TRUE)
|
|
|
|
|
2017-10-02 21:00:41 +00:00
|
|
|
add_lld_library(lldCommon
|
2017-11-28 19:58:45 +00:00
|
|
|
Args.cpp
|
2022-01-20 14:53:18 -05:00
|
|
|
CommonLinkerContext.cpp
|
2023-06-19 07:32:34 -04:00
|
|
|
DriverDispatcher.cpp
|
2019-10-21 08:01:52 +00:00
|
|
|
DWARF.cpp
|
[lld] unified COFF and ELF error handling on new Common/ErrorHandler
Summary:
The COFF linker and the ELF linker have long had similar but separate
Error.h and Error.cpp files to implement error handling. This change
introduces new error handling code in Common/ErrorHandler.h, changes the
COFF and ELF linkers to use it, and removes the old, separate
implementations.
Reviewers: ruiu
Reviewed By: ruiu
Subscribers: smeenai, jyknight, emaste, sdardis, nemanjai, nhaehnle, mgorny, javed.absar, kbarton, fedor.sergeev, llvm-commits
Differential Revision: https://reviews.llvm.org/D39259
llvm-svn: 316624
2017-10-25 22:28:38 +00:00
|
|
|
ErrorHandler.cpp
|
2019-03-11 16:30:55 +00:00
|
|
|
Filesystem.cpp
|
2017-11-28 20:39:17 +00:00
|
|
|
Memory.cpp
|
2017-10-02 21:00:41 +00:00
|
|
|
Reproduce.cpp
|
2017-11-28 02:15:26 +00:00
|
|
|
Strings.cpp
|
2017-10-02 21:00:41 +00:00
|
|
|
TargetOptionsCommandFlags.cpp
|
2018-01-17 19:16:26 +00:00
|
|
|
Timer.cpp
|
2019-02-21 18:37:26 +00:00
|
|
|
VCSVersion.inc
|
2017-10-02 21:00:41 +00:00
|
|
|
Version.cpp
|
|
|
|
|
|
|
|
ADDITIONAL_HEADER_DIRS
|
|
|
|
${LLD_INCLUDE_DIR}/lld/Common
|
|
|
|
|
|
|
|
LINK_COMPONENTS
|
2017-10-02 21:21:36 +00:00
|
|
|
Codegen
|
2017-12-14 22:31:29 +00:00
|
|
|
Core
|
2019-10-21 08:01:52 +00:00
|
|
|
DebugInfoDWARF
|
2017-11-28 08:12:03 +00:00
|
|
|
Demangle
|
2017-10-02 21:32:51 +00:00
|
|
|
MC
|
2017-10-02 21:21:36 +00:00
|
|
|
Option
|
|
|
|
Support
|
|
|
|
Target
|
[Support] Move TargetParsers to new component
This is a fairly large changeset, but it can be broken into a few
pieces:
- `llvm/Support/*TargetParser*` are all moved from the LLVM Support
component into a new LLVM Component called "TargetParser". This
potentially enables using tablegen to maintain this information, as
is shown in https://reviews.llvm.org/D137517. This cannot currently
be done, as llvm-tblgen relies on LLVM's Support component.
- This also moves two files from Support which use and depend on
information in the TargetParser:
- `llvm/Support/Host.{h,cpp}` which contains functions for inspecting
the current Host machine for info about it, primarily to support
getting the host triple, but also for `-mcpu=native` support in e.g.
Clang. This is fairly tightly intertwined with the information in
`X86TargetParser.h`, so keeping them in the same component makes
sense.
- `llvm/ADT/Triple.h` and `llvm/Support/Triple.cpp`, which contains
the target triple parser and representation. This is very intertwined
with the Arm target parser, because the arm architecture version
appears in canonical triples on arm platforms.
- I moved the relevant unittests to their own directory.
And so, we end up with a single component that has all the information
about the following, which to me seems like a unified component:
- Triples that LLVM Knows about
- Architecture names and CPUs that LLVM knows about
- CPU detection logic for LLVM
Given this, I have also moved `RISCVISAInfo.h` into this component, as
it seems to me to be part of that same set of functionality.
If you get link errors in your components after this patch, you likely
need to add TargetParser into LLVM_LINK_COMPONENTS in CMake.
Differential Revision: https://reviews.llvm.org/D137838
2022-12-20 10:24:02 +00:00
|
|
|
TargetParser
|
2017-10-03 04:18:46 +00:00
|
|
|
|
2017-10-17 10:39:27 +00:00
|
|
|
LINK_LIBS
|
2022-10-19 20:09:34 +01:00
|
|
|
${LLVM_PTHREAD_LIB}
|
|
|
|
${LLVM_ATOMIC_LIB}
|
2017-10-17 10:39:27 +00:00
|
|
|
|
2017-10-03 04:18:46 +00:00
|
|
|
DEPENDS
|
2020-07-17 16:43:05 -07:00
|
|
|
intrinsics_gen
|
2017-10-02 21:00:41 +00:00
|
|
|
)
|