llvm.org GIT mirror llvm / f87ea4d
Add the rest of the build system logic for optional target disassemblers git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89841 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 9 years ago
5 changed file(s) with 32 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
154154 FilesToConfig := \
155155 include/llvm/Config/config.h \
156156 include/llvm/Config/Targets.def \
157 include/llvm/Config/AsmPrinters.def \
157 include/llvm/Config/AsmPrinters.def \
158 include/llvm/Config/AsmParsers.def \
159 include/llvm/Config/Disassemblers.def \
158160 include/llvm/System/DataTypes.h \
159 tools/llvmc/plugins/Base/Base.td
161 tools/llvmc/plugins/Base/Base.td
160162 FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
161163
162164 all-local:: $(FilesToConfigPATH)
15631563 $(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir
15641564 $(Echo) "Building $(
15651565 $(Verb) $(TableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<
1566
1567 $(TARGET:%=$(ObjDir)/%GenDisassemblerTables.inc.tmp): \
1568 $(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir
1569 $(Echo) "Building $(
1570 $(Verb) $(TableGen) -gen-disassembler -o $(call SYSPATH, $@) $<
15661571
15671572 $(TARGET:%=$(ObjDir)/%GenFastISel.inc.tmp): \
15681573 $(ObjDir)/%GenFastISel.inc.tmp : %.td $(ObjDir)/.dir
3131 function(explicit_map_components_to_libraries out_libs)
3232 set( link_components ${ARGN} )
3333 foreach(c ${link_components})
34 # add codegen, asmprinter, asmparser
34 # add codegen, asmprinter, asmparser, disassembler
3535 list(FIND LLVM_TARGETS_TO_BUILD ${c} idx)
3636 if( NOT idx LESS 0 )
3737 list(FIND llvm_libs "LLVM${c}CodeGen" idx)
5656 list(FIND llvm_libs "LLVM${c}Info" asmidx)
5757 if( NOT asmidx LESS 0 )
5858 list(APPEND expanded_components "LLVM${c}Info")
59 endif()
60 list(FIND llvm_libs "LLVM${c}Disassembler" asmidx)
61 if( NOT asmidx LESS 0 )
62 list(APPEND expanded_components "LLVM${c}Disassembler")
5963 endif()
6064 elseif( c STREQUAL "native" )
6165 list(APPEND expanded_components "LLVM${LLVM_NATIVE_ARCH}CodeGen")
3232 // Declare all of the available assembly parser initialization functions.
3333 #define LLVM_ASM_PARSER(TargetName) void LLVMInitialize##TargetName##AsmParser();
3434 #include "llvm/Config/AsmParsers.def"
35
36 // Declare all of the available disassembler initialization functions.
37 #define LLVM_DISASSEMBLER(TargetName) void LLVMInitialize##TargetName##Disassembler();
38 #include "llvm/Config/Disassemblers.def"
3539 }
3640
3741 namespace llvm {
7882 #include "llvm/Config/AsmParsers.def"
7983 }
8084
85 /// InitializeAllDisassemblers - The main program should call this function if
86 /// it wants all disassemblers that LLVM is configured to support, to make
87 /// them available via the TargetRegistry.
88 ///
89 /// It is legal for a client to make multiple calls to this function.
90 inline void InitializeAllDisassemblers() {
91 #define LLVM_DISASSEMBLER(TargetName) LLVMInitialize##TargetName##Disassembler();
92 #include "llvm/Config/Disassemblers.def"
93 }
94
8195 /// InitializeNativeTarget - The main program should call this function to
8296 /// initialize the native target corresponding to the host. This is useful
8397 /// for JIT applications to ensure that the target gets linked in correctly.
332332 if (defined $NAME_MAP{$target.'asmparser'}) {
333333 push @{$NAME_MAP{$target}},$target.'asmparser'
334334 }
335
336 if (defined $NAME_MAP{$target.'disassembler'}) {
337 push @{$NAME_MAP{$target}},$target.'disassembler'
338 }
335339 }
336340
337341 # Add virtual entries.