From fa3f0b9bc2a0dff0a71a8d6f666bfab35e7decb4 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Wed, 25 Nov 2009 04:30:13 +0000 Subject: [PATCH] Add CMake and configure logic to create llvm/Config/Disassemblers.defs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89839 91177308-0d34-0410-b5e6-96231b3b80d8 --- CMakeLists.txt | 12 ++++++++++++ autoconf/configure.ac | 10 ++++++++-- include/llvm/Config/Disassemblers.def.in | 29 +++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 include/llvm/Config/Disassemblers.def.in diff --git a/CMakeLists.txt b/CMakeLists.txt index a7a595a8eb2..39ccfbb1082 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -280,6 +280,7 @@ add_subdirectory(utils/not) set(LLVM_ENUM_ASM_PRINTERS "") set(LLVM_ENUM_ASM_PARSERS "") +set(LLVM_ENUM_DISASSEMBLERS "") foreach(t ${LLVM_TARGETS_TO_BUILD}) message(STATUS "Targeting ${t}") add_subdirectory(lib/Target/${t}) @@ -294,6 +295,11 @@ foreach(t ${LLVM_TARGETS_TO_BUILD}) set(LLVM_ENUM_ASM_PARSERS "${LLVM_ENUM_ASM_PARSERS}LLVM_ASM_PARSER(${t})\n") endif( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/AsmParser/CMakeLists.txt ) + if( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/Disassembler/CMakeLists.txt ) + add_subdirectory(lib/Target/${t}/Disassembler) + set(LLVM_ENUM_DISASSEMBLERS + "${LLVM_ENUM_DISASSEMBLERS}LLVM_DISASSEMBLER(${t})\n") + endif( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/Disassembler/CMakeLists.txt ) set(CURRENT_LLVM_TARGET) endforeach(t) @@ -309,6 +315,12 @@ configure_file( ${LLVM_BINARY_DIR}/include/llvm/Config/AsmParsers.def ) +# Produce llvm/Config/Disassemblers.def +configure_file( + ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/Disassemblers.def.in + ${LLVM_BINARY_DIR}/include/llvm/Config/Disassemblers.def + ) + add_subdirectory(lib/ExecutionEngine) add_subdirectory(lib/ExecutionEngine/Interpreter) add_subdirectory(lib/ExecutionEngine/JIT) diff --git a/autoconf/configure.ac b/autoconf/configure.ac index e1251122531..951969846e5 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -533,11 +533,12 @@ for a_target in $TARGETS_TO_BUILD; do fi done -# Build the LLVM_TARGET and LLVM_ASM_PRINTER macro uses for -# Targets.def, AsmPrinters.def, and AsmParsers.def. +# Build the LLVM_TARGET and LLVM_... macros for Targets.def and the individual +# target feature def files. LLVM_ENUM_TARGETS="" LLVM_ENUM_ASM_PRINTERS="" LLVM_ENUM_ASM_PARSERS="" +LLVM_ENUM_DISASSEMBLERS="" for target_to_build in $TARGETS_TO_BUILD; do LLVM_ENUM_TARGETS="LLVM_TARGET($target_to_build) $LLVM_ENUM_TARGETS" if test -f ${srcdir}/lib/Target/${target_to_build}/AsmPrinter/Makefile ; then @@ -546,10 +547,14 @@ for target_to_build in $TARGETS_TO_BUILD; do if test -f ${srcdir}/lib/Target/${target_to_build}/AsmParser/Makefile ; then LLVM_ENUM_ASM_PARSERS="LLVM_ASM_PARSER($target_to_build) $LLVM_ENUM_ASM_PARSERS"; fi + if test -f ${srcdir}/lib/Target/${target_to_build}/Disassembler/Makefile ; then + LLVM_ENUM_DISASSEMBLERS="LLVM_DISASSEMBLER($target_to_build) $LLVM_ENUM_DISASSEMBLERS"; + fi done AC_SUBST(LLVM_ENUM_TARGETS) AC_SUBST(LLVM_ENUM_ASM_PRINTERS) AC_SUBST(LLVM_ENUM_ASM_PARSERS) +AC_SUBST(LLVM_ENUM_DISASSEMBLERS) dnl Prevent the CBackend from using printf("%a") for floating point so older dnl C compilers that cannot deal with the 0x0p+0 hex floating point format @@ -1407,6 +1412,7 @@ AC_CONFIG_HEADERS([include/llvm/Config/config.h]) AC_CONFIG_FILES([include/llvm/Config/Targets.def]) AC_CONFIG_FILES([include/llvm/Config/AsmPrinters.def]) AC_CONFIG_FILES([include/llvm/Config/AsmParsers.def]) +AC_CONFIG_FILES([include/llvm/Config/Disassemblers.def]) AC_CONFIG_HEADERS([include/llvm/System/DataTypes.h]) dnl Configure the makefile's configuration data diff --git a/include/llvm/Config/Disassemblers.def.in b/include/llvm/Config/Disassemblers.def.in new file mode 100644 index 00000000000..1b136570933 --- /dev/null +++ b/include/llvm/Config/Disassemblers.def.in @@ -0,0 +1,29 @@ +//===- llvm/Config/Disassemblers.def - LLVM Assembly Parsers ----*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file enumerates all of the assembly-language parsers +// supported by this build of LLVM. Clients of this file should define +// the LLVM_ASM_PARSER macro to be a function-like macro with a +// single parameter (the name of the target whose assembly can be +// generated); including this file will then enumerate all of the +// targets with assembly parsers. +// +// The set of targets supported by LLVM is generated at configuration +// time, at which point this header is generated. Do not modify this +// header directly. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_DISASSEMBLER +# error Please define the macro LLVM_DISASSEMBLER(TargetName) +#endif + +@LLVM_ENUM_DISASSEMBLERS@ + +#undef LLVM_DISASSEMBLER -- 2.11.0