summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-25 04:46:58 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-25 04:46:58 +0000
commite8b8ccefcb4903eb44e0ab8613a59495c9a6fd8e (patch)
treee7a42ac0308acf12b1472c7e361c9ff75fc3ed31
parent320272093343e9d300308f2a5554d7dfd5501cef (diff)
downloadbcm5719-llvm-e8b8ccefcb4903eb44e0ab8613a59495c9a6fd8e.tar.gz
bcm5719-llvm-e8b8ccefcb4903eb44e0ab8613a59495c9a6fd8e.zip
Add the rest of the build system logic for optional target disassemblers
llvm-svn: 89841
-rw-r--r--llvm/Makefile6
-rw-r--r--llvm/Makefile.rules5
-rwxr-xr-xllvm/cmake/modules/LLVMConfig.cmake6
-rw-r--r--llvm/include/llvm/Target/TargetSelect.h14
-rw-r--r--llvm/tools/llvm-config/llvm-config.in.in4
5 files changed, 32 insertions, 3 deletions
diff --git a/llvm/Makefile b/llvm/Makefile
index 31c1b6961a3..1ef89e4ede0 100644
--- a/llvm/Makefile
+++ b/llvm/Makefile
@@ -155,9 +155,11 @@ install-libs: install
FilesToConfig := \
include/llvm/Config/config.h \
include/llvm/Config/Targets.def \
- include/llvm/Config/AsmPrinters.def \
+ include/llvm/Config/AsmPrinters.def \
+ include/llvm/Config/AsmParsers.def \
+ include/llvm/Config/Disassemblers.def \
include/llvm/System/DataTypes.h \
- tools/llvmc/plugins/Base/Base.td
+ tools/llvmc/plugins/Base/Base.td
FilesToConfigPATH := $(addprefix $(LLVM_OBJ_ROOT)/,$(FilesToConfig))
all-local:: $(FilesToConfigPATH)
diff --git a/llvm/Makefile.rules b/llvm/Makefile.rules
index d9b210841e6..49ecb1e2d86 100644
--- a/llvm/Makefile.rules
+++ b/llvm/Makefile.rules
@@ -1565,6 +1565,11 @@ $(ObjDir)/%GenDAGISel.inc.tmp : %.td $(ObjDir)/.dir
$(Echo) "Building $(<F) DAG instruction selector implementation with tblgen"
$(Verb) $(TableGen) -gen-dag-isel -o $(call SYSPATH, $@) $<
+$(TARGET:%=$(ObjDir)/%GenDisassemblerTables.inc.tmp): \
+$(ObjDir)/%GenDisassemblerTables.inc.tmp : %.td $(ObjDir)/.dir
+ $(Echo) "Building $(<F) disassembly tables with tblgen"
+ $(Verb) $(TableGen) -gen-disassembler -o $(call SYSPATH, $@) $<
+
$(TARGET:%=$(ObjDir)/%GenFastISel.inc.tmp): \
$(ObjDir)/%GenFastISel.inc.tmp : %.td $(ObjDir)/.dir
$(Echo) "Building $(<F) \"fast\" instruction selector implementation with tblgen"
diff --git a/llvm/cmake/modules/LLVMConfig.cmake b/llvm/cmake/modules/LLVMConfig.cmake
index a7536748a37..0744b50d648 100755
--- a/llvm/cmake/modules/LLVMConfig.cmake
+++ b/llvm/cmake/modules/LLVMConfig.cmake
@@ -32,7 +32,7 @@ endfunction(explicit_llvm_config)
function(explicit_map_components_to_libraries out_libs)
set( link_components ${ARGN} )
foreach(c ${link_components})
- # add codegen, asmprinter, asmparser
+ # add codegen, asmprinter, asmparser, disassembler
list(FIND LLVM_TARGETS_TO_BUILD ${c} idx)
if( NOT idx LESS 0 )
list(FIND llvm_libs "LLVM${c}CodeGen" idx)
@@ -58,6 +58,10 @@ function(explicit_map_components_to_libraries out_libs)
if( NOT asmidx LESS 0 )
list(APPEND expanded_components "LLVM${c}Info")
endif()
+ list(FIND llvm_libs "LLVM${c}Disassembler" asmidx)
+ if( NOT asmidx LESS 0 )
+ list(APPEND expanded_components "LLVM${c}Disassembler")
+ endif()
elseif( c STREQUAL "native" )
list(APPEND expanded_components "LLVM${LLVM_NATIVE_ARCH}CodeGen")
elseif( c STREQUAL "nativecodegen" )
diff --git a/llvm/include/llvm/Target/TargetSelect.h b/llvm/include/llvm/Target/TargetSelect.h
index e79f651e5da..951e7fa86b5 100644
--- a/llvm/include/llvm/Target/TargetSelect.h
+++ b/llvm/include/llvm/Target/TargetSelect.h
@@ -33,6 +33,10 @@ extern "C" {
// Declare all of the available assembly parser initialization functions.
#define LLVM_ASM_PARSER(TargetName) void LLVMInitialize##TargetName##AsmParser();
#include "llvm/Config/AsmParsers.def"
+
+ // Declare all of the available disassembler initialization functions.
+#define LLVM_DISASSEMBLER(TargetName) void LLVMInitialize##TargetName##Disassembler();
+#include "llvm/Config/Disassemblers.def"
}
namespace llvm {
@@ -79,6 +83,16 @@ namespace llvm {
#include "llvm/Config/AsmParsers.def"
}
+ /// InitializeAllDisassemblers - The main program should call this function if
+ /// it wants all disassemblers that LLVM is configured to support, to make
+ /// them available via the TargetRegistry.
+ ///
+ /// It is legal for a client to make multiple calls to this function.
+ inline void InitializeAllDisassemblers() {
+#define LLVM_DISASSEMBLER(TargetName) LLVMInitialize##TargetName##Disassembler();
+#include "llvm/Config/Disassemblers.def"
+ }
+
/// InitializeNativeTarget - The main program should call this function to
/// initialize the native target corresponding to the host. This is useful
/// for JIT applications to ensure that the target gets linked in correctly.
diff --git a/llvm/tools/llvm-config/llvm-config.in.in b/llvm/tools/llvm-config/llvm-config.in.in
index 7f93f168dfd..d0edda0ef55 100644
--- a/llvm/tools/llvm-config/llvm-config.in.in
+++ b/llvm/tools/llvm-config/llvm-config.in.in
@@ -333,6 +333,10 @@ sub build_name_map {
if (defined $NAME_MAP{$target.'asmparser'}) {
push @{$NAME_MAP{$target}},$target.'asmparser'
}
+
+ if (defined $NAME_MAP{$target.'disassembler'}) {
+ push @{$NAME_MAP{$target}},$target.'disassembler'
+ }
}
# Add virtual entries.
OpenPOWER on IntegriCloud