[llvm-commits] [llvm] r94780 - in /llvm/trunk/tools: Makefile ed/ ed/EDMain.cpp ed/EnhancedDisassembly.exports ed/Makefile

Sean Callanan scallanan at apple.com
Thu Jan 28 17:30:01 PST 2010


Author: spyffe
Date: Thu Jan 28 19:30:01 2010
New Revision: 94780

URL: http://llvm.org/viewvc/llvm-project?rev=94780&view=rev
Log:
Added a bare-bones Makefile to build the enhanced disassembly
library as a static and a shared library.  Added dependencies
so the target-specific enhanced disassembly info tables are
built before the library.

Added:
    llvm/trunk/tools/ed/
    llvm/trunk/tools/ed/EDMain.cpp
    llvm/trunk/tools/ed/EnhancedDisassembly.exports
    llvm/trunk/tools/ed/Makefile
Modified:
    llvm/trunk/tools/Makefile

Modified: llvm/trunk/tools/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/Makefile?rev=94780&r1=94779&r2=94780&view=diff

==============================================================================
--- llvm/trunk/tools/Makefile (original)
+++ llvm/trunk/tools/Makefile Thu Jan 28 19:30:01 2010
@@ -21,7 +21,8 @@
                  llvm-ld llvm-prof llvm-link \
                  lli llvm-extract \
                  bugpoint llvm-bcanalyzer llvm-stub \
-                 llvm-mc llvmc
+                 llvm-mc llvmc \
+                 ed
 
 # Let users override the set of tools to build from the command line.
 ifdef ONLY_TOOLS

Added: llvm/trunk/tools/ed/EDMain.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/ed/EDMain.cpp?rev=94780&view=auto

==============================================================================
--- llvm/trunk/tools/ed/EDMain.cpp (added)
+++ llvm/trunk/tools/ed/EDMain.cpp Thu Jan 28 19:30:01 2010
@@ -0,0 +1,20 @@
+//===-EDMain.cpp - LLVM Enhanced Disassembly C API ------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+// 
+//===----------------------------------------------------------------------===//
+//
+// This file implements the enhanced disassembler's public C API.
+//
+//===----------------------------------------------------------------------===//
+
+#include <llvm-c/EnhancedDisassembly.h>
+
+int EDGetDisassembler(EDDisassemblerRef *disassembler,
+                      const char *triple,
+                      EDAssemblySyntax_t syntax) {
+  return -1;
+}

Added: llvm/trunk/tools/ed/EnhancedDisassembly.exports
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/ed/EnhancedDisassembly.exports?rev=94780&view=auto

==============================================================================
--- llvm/trunk/tools/ed/EnhancedDisassembly.exports (added)
+++ llvm/trunk/tools/ed/EnhancedDisassembly.exports Thu Jan 28 19:30:01 2010
@@ -0,0 +1,31 @@
+_EDGetDisassembler
+_EDGetRegisterName
+_EDRegisterIsStackPointer
+_EDRegisterIsProgramCounter
+_EDCreateInsts
+_EDReleaseInst
+_EDInstByteSize
+_EDGetInstString
+_EDInstIsBranch
+_EDInstIsMove
+_EDBranchTargetID
+_EDMoveSourceID
+_EDMoveTargetID
+_EDNumTokens
+_EDGetToken
+_EDGetTokenString
+_EDOperandIndexForToken
+_EDTokenIsWhitespace
+_EDTokenIsPunctuation
+_EDTokenIsOpcode
+_EDTokenIsLiteral
+_EDTokenIsRegister
+_EDTokenIsNegativeLiteral
+_EDLiteralTokenAbsoluteValue
+_EDRegisterTokenValue
+_EDNumOperands
+_EDGetOperand
+_EDEvaluateOperand
+_EDBlockCreateInsts
+_EDBlockEvaluateOperand
+_EDBlockVisitTokens

Added: llvm/trunk/tools/ed/Makefile
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/ed/Makefile?rev=94780&view=auto

==============================================================================
--- llvm/trunk/tools/ed/Makefile (added)
+++ llvm/trunk/tools/ed/Makefile Thu Jan 28 19:30:01 2010
@@ -0,0 +1,55 @@
+##===- tools/ed/Makefile -----------------------------------*- Makefile -*-===##
+# 
+#                     The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+# 
+##===----------------------------------------------------------------------===##
+
+LEVEL = ../..
+LIBRARYNAME = EnhancedDisassembly
+
+BUILT_SOURCES = EDInfo.inc
+
+# Include this here so we can get the configuration of the targets
+# that have been configured for construction. We have to do this 
+# early so we can set up LINK_COMPONENTS before including Makefile.rules
+include $(LEVEL)/Makefile.config
+
+LINK_LIBS_IN_SHARED = 1
+SHARED_LIBRARY = 1
+
+LINK_COMPONENTS := $(TARGETS_TO_BUILD) x86asmprinter x86disassembler
+
+include $(LEVEL)/Makefile.common
+
+ifeq ($(HOST_OS),Darwin)
+    # set dylib internal version number to llvmCore submission number
+    ifdef LLVM_SUBMIT_VERSION
+        LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-current_version \
+                        -Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION) \
+                        -Wl,-compatibility_version -Wl,1
+    endif
+    # extra options to override libtool defaults 
+    LLVMLibsOptions    := $(LLVMLibsOptions)  \
+                         -avoid-version \
+                         -Wl,-exported_symbols_list -Wl,$(PROJ_SRC_DIR)/EnhancedDisassembly.exports \
+                         -Wl,-dead_strip \
+                         -Wl,-seg1addr -Wl,0xE0000000 
+
+    # Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
+    DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
+    ifneq ($(DARWIN_VERS),8)
+       LLVMLibsOptions    := $(LLVMLibsOptions)  \
+                            -no-undefined -Wl,-install_name \
+                            -Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
+    endif
+endif
+
+EDInfo.inc:	$(TBLGEN)
+	$(Echo) "Building semantic information header"
+	$(Verb) $(TableGen) -o $(call SYSPATH, $@) -gen-enhanced-disassembly-header /dev/null
+
+clean::
+	-$(Verb) $(RM) -f EDInfo.inc





More information about the llvm-commits mailing list