llvm.org GIT mirror llvm / 1555a23
Introduce new headers whose inclusion forces linking and initialization of all targets (InitializeAllTargets.h) or assembler printers (InitializeAllAsmPrinters.h). This is a step toward the elimination of relinked object files, so that we can build normal archives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73543 91177308-0d34-0410-b5e6-96231b3b80d8 Douglas Gregor 10 years ago
31 changed file(s) with 333 addition(s) and 30 deletion(s). Raw diff Collapse all Expand all
8080 set( LLVM_TARGETS_TO_BUILD ${LLVM_ALL_TARGETS} )
8181 endif()
8282
83 set(LLVM_ENUM_TARGETS "")
8384 foreach(c ${LLVM_TARGETS_TO_BUILD})
8485 list(FIND LLVM_ALL_TARGETS ${c} idx)
8586 if( idx LESS 0 )
8687 message(FATAL_ERROR "The target `${c}' does not exists.
8788 It should be one of\n${LLVM_ALL_TARGETS}")
89 else()
90 set(LLVM_ENUM_TARGETS "${LLVM_ENUM_TARGETS}LLVM_TARGET(${c})\n")
8891 endif()
8992 endforeach(c)
93
94 # Produce llvm/Config/Targets.def
95 configure_file(
96 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/Targets.def.in
97 ${LLVM_BINARY_DIR}/include/llvm/Config/Targets.def
98 )
9099
91100 set(llvm_builded_incs_dir ${LLVM_BINARY_DIR}/include/llvm)
92101
249258 add_subdirectory(lib/Analysis)
250259 add_subdirectory(lib/Analysis/IPA)
251260
252 foreach(t ${LLVM_TARGETS_TO_BUILD})
261 set(LLVM_ENUM_ASM_PRINTERS "")
262 foreach(t ${LLVM_TARGETS_TO_BUILD})
253263 message(STATUS "Targeting ${t}")
254264 add_subdirectory(lib/Target/${t})
255265 if( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/AsmPrinter/CMakeLists.txt )
256 add_subdirectory(lib/Target/${t}/AsmPrinter)
257 endif( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/AsmPrinter/CMakeLists.txt )
266 add_subdirectory(lib/Target/${t}/AsmPrinter)
267 set(LLVM_ENUM_ASM_PRINTERS
268 "${LLVM_ENUM_ASM_PRINTERS}LLVM_ASM_PRINTER(${t})\n")
269 endif( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/AsmPrinter/CMakeLists.txt )
258270 endforeach(t)
271
272 # Produce llvm/Config/AsmPrinters.def
273 configure_file(
274 ${LLVM_MAIN_INCLUDE_DIR}/llvm/Config/AsmPrinters.def.in
275 ${LLVM_BINARY_DIR}/include/llvm/Config/AsmPrinters.def
276 )
259277
260278 add_subdirectory(lib/ExecutionEngine)
261279 add_subdirectory(lib/ExecutionEngine/Interpreter)
133133 #------------------------------------------------------------------------
134134 FilesToConfig := \
135135 include/llvm/Config/config.h \
136 include/llvm/Config/Targets.def \
137 include/llvm/Config/AsmPrinters.def \
136138 include/llvm/Support/DataTypes.h \
137139 include/llvm/ADT/iterator.h
138140 FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
435435 esac
436436 AC_SUBST(TARGETS_TO_BUILD,$TARGETS_TO_BUILD)
437437
438 # Build the LLVM_TARGET and LLVM_ASM_PRINTER macro uses for
439 # Targets.def and AsmPrinters.def.
440 LLVM_ENUM_TARGETS=""
441 LLVM_ENUM_ASM_PRINTERS=""
442 for target_to_build in $TARGETS_TO_BUILD; do
443 LLVM_ENUM_TARGETS="LLVM_TARGET($target_to_build) $LLVM_ENUM_TARGETS"
444 if test -f ${srcdir}/lib/Target/${target_to_build}/AsmPrinter/Makefile ; then
445 LLVM_ENUM_ASM_PRINTERS="LLVM_ASM_PRINTER($target_to_build) $LLVM_ENUM_ASM_PRINTERS";
446 fi
447 done
448 AC_SUBST(LLVM_ENUM_TARGETS)
449 AC_SUBST(LLVM_ENUM_ASM_PRINTERS)
450
438451 dnl Prevent the CBackend from using printf("%a") for floating point so older
439452 dnl C compilers that cannot deal with the 0x0p+0 hex floating point format
440453 dnl can still compile the CBE's output
11101123 dnl contains the same list of files as AC_CONFIG_HEADERS below. This ensures the
11111124 dnl files can be updated automatically when their *.in sources change.
11121125 AC_CONFIG_HEADERS([include/llvm/Config/config.h])
1126 AC_CONFIG_FILES([include/llvm/Config/Targets.def])
1127 AC_CONFIG_FILES([include/llvm/Config/AsmPrinters.def])
11131128 AC_CONFIG_HEADERS([include/llvm/Support/DataTypes.h])
11141129 AC_CONFIG_HEADERS([include/llvm/ADT/iterator.h])
11151130
840840 ENABLE_THREADS
841841 ENABLE_PIC
842842 TARGETS_TO_BUILD
843 LLVM_ENUM_TARGETS
844 LLVM_ENUM_ASM_PRINTERS
843845 ENABLE_CBE_PRINTF_A
844846 EXTRA_OPTIONS
845847 BINUTILS_INCDIR
49584960 TARGETS_TO_BUILD=$TARGETS_TO_BUILD
49594961
49604962
4963 # Build the LLVM_TARGET and LLVM_ASM_PRINTER macro uses for
4964 # Targets.def and AsmPrinters.def.
4965 LLVM_ENUM_TARGETS=""
4966 LLVM_ENUM_ASM_PRINTERS=""
4967 for target_to_build in $TARGETS_TO_BUILD; do
4968 LLVM_ENUM_TARGETS="LLVM_TARGET($target_to_build) $LLVM_ENUM_TARGETS"
4969 if test -f ${srcdir}/lib/Target/${target_to_build}/AsmPrinter/Makefile ; then
4970 LLVM_ENUM_ASM_PRINTERS="LLVM_ASM_PRINTER($target_to_build) $LLVM_ENUM_ASM_PRINTERS";
4971 fi
4972 done
4973
4974
4975
49614976 # Check whether --enable-cbe-printf-a was given.
49624977 if test "${enable_cbe_printf_a+set}" = set; then
49634978 enableval=$enable_cbe_printf_a;
1059310608 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1059410609 lt_status=$lt_dlunknown
1059510610 cat > conftest.$ac_ext <
10596 #line 10597 "configure"
10611 #line 10612 "configure"
1059710612 #include "confdefs.h"
1059810613
1059910614 #if HAVE_DLFCN_H
1273712752 ;;
1273812753 *-*-irix6*)
1273912754 # Find out which ABI we are using.
12740 echo '#line 12741 "configure"' > conftest.$ac_ext
12755 echo '#line 12756 "configure"' > conftest.$ac_ext
1274112756 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
1274212757 (eval $ac_compile) 2>&5
1274312758 ac_status=$?
1445514470 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1445614471 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1445714472 -e 's:$: $lt_compiler_flag:'`
14458 (eval echo "\"\$as_me:14459: $lt_compile\"" >&5)
14473 (eval echo "\"\$as_me:14474: $lt_compile\"" >&5)
1445914474 (eval "$lt_compile" 2>conftest.err)
1446014475 ac_status=$?
1446114476 cat conftest.err >&5
14462 echo "$as_me:14463: \$? = $ac_status" >&5
14477 echo "$as_me:14478: \$? = $ac_status" >&5
1446314478 if (exit $ac_status) && test -s "$ac_outfile"; then
1446414479 # The compiler can only warn and ignore the option if not recognized
1446514480 # So say no if there are warnings other than the usual output.
1472314738 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1472414739 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1472514740 -e 's:$: $lt_compiler_flag:'`
14726 (eval echo "\"\$as_me:14727: $lt_compile\"" >&5)
14741 (eval echo "\"\$as_me:14742: $lt_compile\"" >&5)
1472714742 (eval "$lt_compile" 2>conftest.err)
1472814743 ac_status=$?
1472914744 cat conftest.err >&5
14730 echo "$as_me:14731: \$? = $ac_status" >&5
14745 echo "$as_me:14746: \$? = $ac_status" >&5
1473114746 if (exit $ac_status) && test -s "$ac_outfile"; then
1473214747 # The compiler can only warn and ignore the option if not recognized
1473314748 # So say no if there are warnings other than the usual output.
1482714842 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1482814843 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1482914844 -e 's:$: $lt_compiler_flag:'`
14830 (eval echo "\"\$as_me:14831: $lt_compile\"" >&5)
14845 (eval echo "\"\$as_me:14846: $lt_compile\"" >&5)
1483114846 (eval "$lt_compile" 2>out/conftest.err)
1483214847 ac_status=$?
1483314848 cat out/conftest.err >&5
14834 echo "$as_me:14835: \$? = $ac_status" >&5
14849 echo "$as_me:14850: \$? = $ac_status" >&5
1483514850 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1483614851 then
1483714852 # The compiler can only warn and ignore the option if not recognized
1727917294 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1728017295 lt_status=$lt_dlunknown
1728117296 cat > conftest.$ac_ext <
17282 #line 17283 "configure"
17297 #line 17298 "configure"
1728317298 #include "confdefs.h"
1728417299
1728517300 #if HAVE_DLFCN_H
1737917394 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1738017395 lt_status=$lt_dlunknown
1738117396 cat > conftest.$ac_ext <
17382 #line 17383 "configure"
17397 #line 17398 "configure"
1738317398 #include "confdefs.h"
1738417399
1738517400 #if HAVE_DLFCN_H
1974719762 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1974819763 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1974919764 -e 's:$: $lt_compiler_flag:'`
19750 (eval echo "\"\$as_me:19751: $lt_compile\"" >&5)
19765 (eval echo "\"\$as_me:19766: $lt_compile\"" >&5)
1975119766 (eval "$lt_compile" 2>conftest.err)
1975219767 ac_status=$?
1975319768 cat conftest.err >&5
19754 echo "$as_me:19755: \$? = $ac_status" >&5
19769 echo "$as_me:19770: \$? = $ac_status" >&5
1975519770 if (exit $ac_status) && test -s "$ac_outfile"; then
1975619771 # The compiler can only warn and ignore the option if not recognized
1975719772 # So say no if there are warnings other than the usual output.
1985119866 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
1985219867 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
1985319868 -e 's:$: $lt_compiler_flag:'`
19854 (eval echo "\"\$as_me:19855: $lt_compile\"" >&5)
19869 (eval echo "\"\$as_me:19870: $lt_compile\"" >&5)
1985519870 (eval "$lt_compile" 2>out/conftest.err)
1985619871 ac_status=$?
1985719872 cat out/conftest.err >&5
19858 echo "$as_me:19859: \$? = $ac_status" >&5
19873 echo "$as_me:19874: \$? = $ac_status" >&5
1985919874 if (exit $ac_status) && test -s out/conftest2.$ac_objext
1986019875 then
1986119876 # The compiler can only warn and ignore the option if not recognized
2142121436 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2142221437 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2142321438 -e 's:$: $lt_compiler_flag:'`
21424 (eval echo "\"\$as_me:21425: $lt_compile\"" >&5)
21439 (eval echo "\"\$as_me:21440: $lt_compile\"" >&5)
2142521440 (eval "$lt_compile" 2>conftest.err)
2142621441 ac_status=$?
2142721442 cat conftest.err >&5
21428 echo "$as_me:21429: \$? = $ac_status" >&5
21443 echo "$as_me:21444: \$? = $ac_status" >&5
2142921444 if (exit $ac_status) && test -s "$ac_outfile"; then
2143021445 # The compiler can only warn and ignore the option if not recognized
2143121446 # So say no if there are warnings other than the usual output.
2152521540 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2152621541 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2152721542 -e 's:$: $lt_compiler_flag:'`
21528 (eval echo "\"\$as_me:21529: $lt_compile\"" >&5)
21543 (eval echo "\"\$as_me:21544: $lt_compile\"" >&5)
2152921544 (eval "$lt_compile" 2>out/conftest.err)
2153021545 ac_status=$?
2153121546 cat out/conftest.err >&5
21532 echo "$as_me:21533: \$? = $ac_status" >&5
21547 echo "$as_me:21548: \$? = $ac_status" >&5
2153321548 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2153421549 then
2153521550 # The compiler can only warn and ignore the option if not recognized
2376023775 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2376123776 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2376223777 -e 's:$: $lt_compiler_flag:'`
23763 (eval echo "\"\$as_me:23764: $lt_compile\"" >&5)
23778 (eval echo "\"\$as_me:23779: $lt_compile\"" >&5)
2376423779 (eval "$lt_compile" 2>conftest.err)
2376523780 ac_status=$?
2376623781 cat conftest.err >&5
23767 echo "$as_me:23768: \$? = $ac_status" >&5
23782 echo "$as_me:23783: \$? = $ac_status" >&5
2376823783 if (exit $ac_status) && test -s "$ac_outfile"; then
2376923784 # The compiler can only warn and ignore the option if not recognized
2377023785 # So say no if there are warnings other than the usual output.
2402824043 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2402924044 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2403024045 -e 's:$: $lt_compiler_flag:'`
24031 (eval echo "\"\$as_me:24032: $lt_compile\"" >&5)
24046 (eval echo "\"\$as_me:24047: $lt_compile\"" >&5)
2403224047 (eval "$lt_compile" 2>conftest.err)
2403324048 ac_status=$?
2403424049 cat conftest.err >&5
24035 echo "$as_me:24036: \$? = $ac_status" >&5
24050 echo "$as_me:24051: \$? = $ac_status" >&5
2403624051 if (exit $ac_status) && test -s "$ac_outfile"; then
2403724052 # The compiler can only warn and ignore the option if not recognized
2403824053 # So say no if there are warnings other than the usual output.
2413224147 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
2413324148 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
2413424149 -e 's:$: $lt_compiler_flag:'`
24135 (eval echo "\"\$as_me:24136: $lt_compile\"" >&5)
24150 (eval echo "\"\$as_me:24151: $lt_compile\"" >&5)
2413624151 (eval "$lt_compile" 2>out/conftest.err)
2413724152 ac_status=$?
2413824153 cat out/conftest.err >&5
24139 echo "$as_me:24140: \$? = $ac_status" >&5
24154 echo "$as_me:24155: \$? = $ac_status" >&5
2414024155 if (exit $ac_status) && test -s out/conftest2.$ac_objext
2414124156 then
2414224157 # The compiler can only warn and ignore the option if not recognized
3422234237
3422334238 ac_config_headers="$ac_config_headers include/llvm/Config/config.h"
3422434239
34240 ac_config_files="$ac_config_files include/llvm/Config/Targets.def"
34241
34242 ac_config_files="$ac_config_files include/llvm/Config/AsmPrinters.def"
34243
3422534244 ac_config_headers="$ac_config_headers include/llvm/Support/DataTypes.h"
3422634245
3422734246 ac_config_headers="$ac_config_headers include/llvm/ADT/iterator.h"
3484834867 do
3484934868 case $ac_config_target in
3485034869 "include/llvm/Config/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/Config/config.h" ;;
34870 "include/llvm/Config/Targets.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/Targets.def" ;;
34871 "include/llvm/Config/AsmPrinters.def") CONFIG_FILES="$CONFIG_FILES include/llvm/Config/AsmPrinters.def" ;;
3485134872 "include/llvm/Support/DataTypes.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/Support/DataTypes.h" ;;
3485234873 "include/llvm/ADT/iterator.h") CONFIG_HEADERS="$CONFIG_HEADERS include/llvm/ADT/iterator.h" ;;
3485334874 "Makefile.config") CONFIG_FILES="$CONFIG_FILES Makefile.config" ;;
3501635037 ENABLE_THREADS!$ENABLE_THREADS$ac_delim
3501735038 ENABLE_PIC!$ENABLE_PIC$ac_delim
3501835039 TARGETS_TO_BUILD!$TARGETS_TO_BUILD$ac_delim
35040 LLVM_ENUM_TARGETS!$LLVM_ENUM_TARGETS$ac_delim
35041 LLVM_ENUM_ASM_PRINTERS!$LLVM_ENUM_ASM_PRINTERS$ac_delim
3501935042 ENABLE_CBE_PRINTF_A!$ENABLE_CBE_PRINTF_A$ac_delim
3502035043 EXTRA_OPTIONS!$EXTRA_OPTIONS$ac_delim
3502135044 BINUTILS_INCDIR!$BINUTILS_INCDIR$ac_delim
3502635049 ifGNUmake!$ifGNUmake$ac_delim
3502735050 LN_S!$LN_S$ac_delim
3502835051 CMP!$CMP$ac_delim
35029 CP!$CP$ac_delim
35030 DATE!$DATE$ac_delim
3503135052 _ACEOF
3503235053
3503335054 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
3506935090 ac_delim='%!_!# '
3507035091 for ac_last_try in false false false false false :; do
3507135092 cat >conf$$subs.sed <<_ACEOF
35093 CP!$CP$ac_delim
35094 DATE!$DATE$ac_delim
3507235095 FIND!$FIND$ac_delim
3507335096 MKDIR!$MKDIR$ac_delim
3507435097 MV!$MV$ac_delim
3515035173 LTLIBOBJS!$LTLIBOBJS$ac_delim
3515135174 _ACEOF
3515235175
35153 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 79; then
35176 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 81; then
3515435177 break
3515535178 elif $ac_last_try; then
3515635179 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
0 //===- llvm/Config/AsmPrinters.def - LLVM Assembly Printers -----*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file enumerates all of the assembly-language printers
10 // supported by this build of LLVM. Clients of this file should define
11 // the LLVM_ASM_PRINTER macro to be a function-like macro with a
12 // single parameter (the name of the target whose assembly can be
13 // generated); including this file will then enumerate all of the
14 // targets with assembly printers.
15 //
16 // The set of targets supported by LLVM is generated at configuration
17 // time, at which point this header is generated. Do not modify this
18 // header directly.
19 //
20 //===----------------------------------------------------------------------===//
21
22 #ifndef LLVM_ASM_PRINTER
23 # error Please define the macro LLVM_ASM_PRINTER(TargetName)
24 #endif
25
26 @LLVM_ENUM_ASM_PRINTERS@
27
28 #undef LLVM_ASM_PRINTER
0 //===- llvm/Config/Targets.def - LLVM Target Architectures ------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file enumerates all of the target architectures supported by
10 // this build of LLVM. Clients of this file should define the
11 // LLVM_TARGET macro to be a function-like macro with a single
12 // parameter (the name of the target); including this file will then
13 // enumerate all of the targets.
14 //
15 // The set of targets supported by LLVM is generated at configuration
16 // time, at which point this header is generated. Do not modify this
17 // header directly.
18 //
19 //===----------------------------------------------------------------------===//
20
21 #ifndef LLVM_TARGET
22 # error Please define the macro LLVM_TARGET(TargetName)
23 #endif
24
25 @LLVM_ENUM_TARGETS@
26
27 #undef LLVM_TARGET
0 //===- llvm/InitializeAllAsmPrinters.h - Init Asm Printers ------*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This header initializes all assembler printers for all configured
10 // LLVM targets, ensuring that they are registered.
11 //
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_INITIALIZE_ALL_ASM_PRINTERS_H
14 #define LLVM_INITIALIZE_ALL_ASM_PRINTERS_H
15
16 namespace llvm {
17
18 // Declare all of the target-initialization functions.
19 #define LLVM_ASM_PRINTER(TargetName) void Initialize##TargetName##AsmPrinter();
20 #include "llvm/Config/AsmPrinters.def"
21
22 namespace {
23 struct InitializeAllAsmPrinters {
24 InitializeAllAsmPrinters() {
25 // Call all of the target-initialization functions.
26 #define LLVM_ASM_PRINTER(TargetName) llvm::Initialize##TargetName##AsmPrinter();
27 #include "llvm/Config/AsmPrinters.def"
28 }
29 } DoInitializeAllAsmPrinters;
30 }
31 } // end namespace llvm
32
33 #endif // LLVM_INITIALIZE_ALL_ASM_PRINTERS_H
0 //===- llvm/InitializeAllTargets.h - Initialize All Targets -----*- C++ -*-===//
1 //
2 // The LLVM Compiler Infrastructure
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This header initializes all configured LLVM targets, ensuring that they
10 // are registered.
11 //
12 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_INITIALIZE_ALL_TARGETS_H
14 #define LLVM_INITIALIZE_ALL_TARGETS_H
15
16 namespace llvm {
17
18 // Declare all of the target-initialization functions.
19 #define LLVM_TARGET(TargetName) void Initialize##TargetName##Target();
20 #include "llvm/Config/Targets.def"
21
22 namespace {
23 struct InitializeAllTargets {
24 InitializeAllTargets() {
25 // Call all of the target-initialization functions.
26 #define LLVM_TARGET(TargetName) llvm::Initialize##TargetName##Target();
27 #include "llvm/Config/Targets.def"
28 }
29 } DoInitializeAllTargets;
30 }
31 } // end namespace llvm
32
33 #endif // LLVM_INITIALIZE_ALL_TARGETS_H
4040 // Register the target.
4141 static RegisterTarget X("arm", "ARM");
4242 static RegisterTarget Y("thumb", "Thumb");
43
44 // Force static initialization when called from llvm/InitializeAllTargets.h
45 namespace llvm {
46 void InitializeARMTarget() { }
47 }
4348
4449 // No assembler printer by default
4550 ARMTargetMachine::AsmPrinterCtorFn ARMTargetMachine::AsmPrinterCtor = 0;
11141114 }
11151115 } Registrator;
11161116 }
1117
1118 // Force static initialization when called from
1119 // llvm/InitializeAllAsmPrinters.h
1120 namespace llvm {
1121 void InitializeARMAsmPrinter() { }
1122 }
2929
3030 // Register the targets
3131 static RegisterTarget X("alpha", "Alpha [experimental]");
32
33 // Force static initialization when called from llvm/InitializeAllTargets.h
34 namespace llvm {
35 void InitializeAlphaTarget() { }
36 }
3237
3338 const TargetAsmInfo *AlphaTargetMachine::createTargetAsmInfo() const {
3439 return new AlphaTargetAsmInfo(*this);
302302 O << ")";
303303 return false;
304304 }
305
306 // Force static initialization when called from
307 // llvm/InitializeAllAsmPrinters.h
308 namespace llvm {
309 void InitializeAlphaAsmPrinter() { }
310 }
5757
5858 // Register the target.
5959 static RegisterTarget X("c", "C backend");
60
61 // Force static initialization when called from llvm/InitializeAllTargets.h
62 namespace llvm {
63 void InitializeCBackendTarget() { }
64 }
6065
6166 namespace {
6267 /// CBackendNameAllUsedStructsAndMergeFunctions - This pass inserts names for
620620 bool verbose) {
621621 return new LinuxAsmPrinter(o, tm, tm.getTargetAsmInfo(), OptLevel, verbose);
622622 }
623
624 // Force static initialization when called from
625 // llvm/InitializeAllAsmPrinters.h
626 namespace llvm {
627 void InitializeCellSPUAsmPrinter() { }
628 }
3434 // Register the targets
3535 RegisterTarget
3636 CELLSPU("cellspu", "STI CBEA Cell SPU [experimental]");
37 }
38
39 // Force static initialization when called from llvm/InitializeAllTargets.h
40 namespace llvm {
41 void InitializeCellSPUTarget() { }
3742 }
3843
3944 const std::pair *
8080
8181 // Register the target.
8282 static RegisterTarget X("cpp", "C++ backend");
83
84 // Force static initialization when called from llvm/InitializeAllTargets.h
85 namespace llvm {
86 void InitializeCppBackendTarget() { }
87 }
8388
8489 namespace {
8590 typedef std::vector TypeList;
373373 bool verbose) {
374374 return new IA64AsmPrinter(o, tm, tm.getTargetAsmInfo(), OptLevel, verbose);
375375 }
376
377 // Force static initialization when called from
378 // llvm/InitializeAllAsmPrinters.h
379 namespace llvm {
380 void InitializeIA64AsmPrinter() { }
381 }
2727
2828 static RegisterTarget X("ia64",
2929 "IA-64 (Itanium) [experimental]");
30
31 // Force static initialization when called from llvm/InitializeAllTargets.h
32 namespace llvm {
33 void InitializeIA64Target() { }
34 }
3035
3136 const TargetAsmInfo *IA64TargetMachine::createTargetAsmInfo() const {
3237 return new IA64TargetAsmInfo(*this);
5353 int MSILTargetMachineModule = 0;
5454
5555 static RegisterTarget X("msil", "MSIL backend");
56
57 // Force static initialization when called from llvm/InitializeAllTargets.h
58 namespace llvm {
59 void InitializeMSILTarget() { }
60 }
5661
5762 bool MSILModule::runOnModule(Module &M) {
5863 ModulePtr = &M;
3333 // Register the targets
3434 static RegisterTarget
3535 X("msp430", "MSP430 [experimental]");
36
37 // Force static initialization when called from llvm/InitializeAllTargets.h
38 namespace llvm {
39 void InitializeMSP430Target() { }
40 }
3641
3742 MSP430TargetMachine::MSP430TargetMachine(const Module &M,
3843 const std::string &FS) :
577577
578578 return AsmPrinter::doFinalization(M);
579579 }
580
581 // Force static initialization when called from
582 // llvm/InitializeAllAsmPrinters.h
583 namespace llvm {
584 void InitializeMipsAsmPrinter() { }
585 }
2929 // Register the target.
3030 static RegisterTarget X("mips", "Mips");
3131 static RegisterTarget Y("mipsel", "Mipsel");
32
33 // Force static initialization when called from llvm/InitializeAllTargets.h
34 namespace llvm {
35 void InitializeMipsTarget() { }
36 }
3237
3338 const TargetAsmInfo *MipsTargetMachine::
3439 createTargetAsmInfo() const
3535 X("pic16", "PIC16 14-bit [experimental].");
3636 static RegisterTarget
3737 Y("cooper", "PIC16 Cooper [experimental].");
38
39 // Force static initialization when called from llvm/InitializeAllTargets.h
40 namespace llvm {
41 void InitializePIC16Target() { }
42 }
3843
3944 // PIC16TargetMachine - Traditional PIC16 Machine.
4045 PIC16TargetMachine::PIC16TargetMachine(const Module &M, const std::string &FS,
12011201
12021202 extern "C" int PowerPCAsmPrinterForceLink;
12031203 int PowerPCAsmPrinterForceLink = 0;
1204
1205 // Force static initialization when called from
1206 // llvm/InitializeAllAsmPrinters.h
1207 namespace llvm {
1208 void InitializePowerPCAsmPrinter() { }
1209 }
3333 X("ppc32", "PowerPC 32");
3434 static RegisterTarget
3535 Y("ppc64", "PowerPC 64");
36
37 // Force static initialization when called from llvm/InitializeAllTargets.h
38 namespace llvm {
39 void InitializePowerPCTarget() { }
40 }
3641
3742 // No assembler printer by default
3843 PPCTargetMachine::AsmPrinterCtorFn PPCTargetMachine::AsmPrinterCtor = 0;
352352
353353 return false;
354354 }
355
356 // Force static initialization when called from
357 // llvm/InitializeAllAsmPrinters.h
358 namespace llvm {
359 void InitializeSparcAsmPrinter() { }
360 }
2727
2828 // Register the target.
2929 static RegisterTarget X("sparc", "SPARC");
30
31 // Force static initialization when called from llvm/InitializeAllTargets.h
32 namespace llvm {
33 void InitializeSparcTarget() { }
34 }
3035
3136 const TargetAsmInfo *SparcTargetMachine::createTargetAsmInfo() const {
3237 // FIXME: Handle Solaris subtarget someday :)
4747
4848 extern "C" int X86AsmPrinterForceLink;
4949 int X86AsmPrinterForceLink = 0;
50
51 // Force static initialization when called from
52 // llvm/InitializeAllAsmPrinters.h
53 namespace llvm {
54 void InitializeX86AsmPrinter() { }
55 }
3434 X("x86", "32-bit X86: Pentium-Pro and above");
3535 static RegisterTarget
3636 Y("x86-64", "64-bit X86: EM64T and AMD64");
37
38 // Force static initialization when called from llvm/InitializeAllTargets.h
39 namespace llvm {
40 void InitializeX86Target() { }
41 }
3742
3843 // No assembler printer by default
3944 X86TargetMachine::AsmPrinterCtorFn X86TargetMachine::AsmPrinterCtor = 0;
2828 namespace {
2929 // Register the target.
3030 RegisterTarget X("xcore", "XCore");
31 }
32
33 // Force static initialization when called from llvm/InitializeAllTargets.h
34 namespace llvm {
35 void InitializeXCoreTarget() { }
3136 }
3237
3338 const TargetAsmInfo *XCoreTargetMachine::createTargetAsmInfo() const {
3737 #include "llvm/System/Signals.h"
3838 #include "llvm/Config/config.h"
3939 #include "llvm/LinkAllVMCore.h"
40 #include "llvm/InitializeAllTargets.h"
41 #include "llvm/InitializeAllAsmPrinters.h"
4042 #include
4143 #include
4244 #include