llvmbuildectomy - compatibility with ocaml bindings

Use exact component name in add_ocaml_library.
Make expand_topologically compatible with new architecture.
Fix quoting in is_llvm_target_library.
Fix LLVMipo component name.
Write release note.
This commit is contained in:
serge-sans-paille 2020-11-13 14:04:19 +01:00
parent 8bb6347939
commit 95537f4508
14 changed files with 34 additions and 15 deletions

View File

@ -2,4 +2,4 @@ add_ocaml_library(llvm_analysis
OCAML llvm_analysis
OCAMLDEP llvm
C analysis_ocaml
LLVM analysis)
LLVM Analysis)

View File

@ -2,4 +2,4 @@ add_ocaml_library(llvm_bitreader
OCAML llvm_bitreader
OCAMLDEP llvm
C bitreader_ocaml
LLVM bitreader)
LLVM BitReader)

View File

@ -2,4 +2,4 @@ add_ocaml_library(llvm_bitwriter
OCAML llvm_bitwriter
OCAMLDEP llvm
C bitwriter_ocaml
LLVM bitwriter)
LLVM BitWriter)

View File

@ -2,5 +2,5 @@ add_ocaml_library(llvm_executionengine
OCAML llvm_executionengine
OCAMLDEP llvm llvm_target
C executionengine_ocaml
LLVM executionengine mcjit native
LLVM ExecutionEngine MCJIT native
PKG ctypes)

View File

@ -2,4 +2,4 @@ add_ocaml_library(llvm_irreader
OCAML llvm_irreader
OCAMLDEP llvm
C irreader_ocaml
LLVM irreader)
LLVM IRReader)

View File

@ -2,4 +2,4 @@ add_ocaml_library(llvm_linker
OCAML llvm_linker
OCAMLDEP llvm
C linker_ocaml
LLVM linker)
LLVM Linker)

View File

@ -1,7 +1,7 @@
add_ocaml_library(llvm
OCAML llvm
C llvm_ocaml
LLVM core support)
LLVM Core Support)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/META.llvm.in"

View File

@ -2,4 +2,4 @@ add_ocaml_library(llvm_target
OCAML llvm_target
OCAMLDEP llvm
C target_ocaml
LLVM target)
LLVM Target)

View File

@ -2,4 +2,4 @@ add_ocaml_library(llvm_scalar_opts
OCAML llvm_scalar_opts
OCAMLDEP llvm
C scalar_opts_ocaml
LLVM scalaropts)
LLVM Scalar)

View File

@ -2,4 +2,4 @@ add_ocaml_library(llvm_transform_utils
OCAML llvm_transform_utils
OCAMLDEP llvm
C transform_utils_ocaml
LLVM transformutils)
LLVM TransformUtils)

View File

@ -2,4 +2,4 @@ add_ocaml_library(llvm_vectorize
OCAML llvm_vectorize
OCAMLDEP llvm
C vectorize_ocaml
LLVM vectorize)
LLVM Vectorize)

View File

@ -28,7 +28,7 @@ function(is_llvm_target_library library return_var)
string(TOUPPER "${LLVM_TARGETS_TO_BUILD}" targets)
elseif(ARG_OMITTED_TARGETS)
set(omitted_targets ${LLVM_ALL_TARGETS})
list(REMOVE_ITEM omitted_targets "${LLVM_TARGETS_TO_BUILD}")
list(REMOVE_ITEM omitted_targets ${LLVM_TARGETS_TO_BUILD})
string(TOUPPER "${omitted_targets}" targets)
else()
string(TOUPPER "${LLVM_ALL_TARGETS}" targets)
@ -302,14 +302,26 @@ function(expand_topologically name required_libs visited_libs)
list(APPEND visited_libs ${name})
set(visited_libs ${visited_libs} PARENT_SCOPE)
get_property(lib_deps GLOBAL PROPERTY LLVMBUILD_LIB_DEPS_${name})
#
get_property(libname GLOBAL PROPERTY LLVM_COMPONENT_NAME_${name})
if(libname)
set(cname LLVM${libname})
elseif(TARGET ${name})
set(cname ${name})
elseif(TARGET LLVM${name})
set(cname LLVM${name})
else()
message(FATAL_ERROR "unknown component ${name}")
endif()
get_property(lib_deps TARGET ${cname} PROPERTY LLVM_LINK_COMPONENTS)
foreach( lib_dep ${lib_deps} )
expand_topologically(${lib_dep} "${required_libs}" "${visited_libs}")
set(required_libs ${required_libs} PARENT_SCOPE)
set(visited_libs ${visited_libs} PARENT_SCOPE)
endforeach()
list(APPEND required_libs ${name})
list(APPEND required_libs ${cname})
set(required_libs ${required_libs} PARENT_SCOPE)
endif()
endfunction()

View File

@ -74,6 +74,13 @@ Changes to the LLVM IR
Changes to building LLVM
------------------------
* The internal ``llvm-build`` Python script and the associated ``LLVMBuild.txt``
files used to describe the LLVM component structure have been removed and
replaced by a pure ``CMake`` approach, where each component stores extra
properties in the created targets. These properties are processed once all
components are defined to resolve library dependencies and produce the header
expected by llvm-config.
Changes to TableGen
-------------------

View File

@ -47,7 +47,7 @@ add_llvm_component_library(LLVMipo
omp_gen
COMPONENT_NAME
ipo
IPO
LINK_COMPONENTS
AggressiveInstCombine