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
This commit is contained in:
Daniel Dunbar 2009-11-25 04:30:13 +00:00
parent 405887419f
commit fa3f0b9bc2
3 changed files with 49 additions and 2 deletions

View File

@ -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)

View File

@ -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

View File

@ -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