Changed to Chris Lattner's suggested approach, which
merely stubs out the blocks-based disassembly functions
if the library wasn't built with blocks, which allows a
constant .exports file and also properly deals with
situations in which the compiler used to build a client
is different from the compiler used to build the library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95034 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/ed/EDMain.cpp b/tools/ed/EDMain.cpp
index 2ac6c79..c2c1796 100644
--- a/tools/ed/EDMain.cpp
+++ b/tools/ed/EDMain.cpp
@@ -248,4 +248,18 @@
return inst->visitTokens(visitor);
}
+#else
+
+extern "C" unsigned int EDBlockCreateInsts() {
+ return 0;
+}
+
+extern "C" int EDBlockEvaluateOperand() {
+ return -1;
+}
+
+extern "C" int EDBlockVisitTokens() {
+ return -1;
+}
+
#endif
diff --git a/tools/ed/EnhancedDisassembly.exports.blocks b/tools/ed/EnhancedDisassembly.exports
similarity index 100%
rename from tools/ed/EnhancedDisassembly.exports.blocks
rename to tools/ed/EnhancedDisassembly.exports
diff --git a/tools/ed/EnhancedDisassembly.exports.noblocks b/tools/ed/EnhancedDisassembly.exports.noblocks
deleted file mode 100644
index 5852e7f..0000000
--- a/tools/ed/EnhancedDisassembly.exports.noblocks
+++ /dev/null
@@ -1,28 +0,0 @@
-_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
diff --git a/tools/ed/Makefile b/tools/ed/Makefile
index 23970a9..a3c5879 100644
--- a/tools/ed/Makefile
+++ b/tools/ed/Makefile
@@ -10,7 +10,7 @@
LEVEL = ../..
LIBRARYNAME = EnhancedDisassembly
-BUILT_SOURCES = EDInfo.inc EnhancedDisassembly.exports
+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
@@ -34,7 +34,7 @@
# extra options to override libtool defaults
LLVMLibsOptions := $(LLVMLibsOptions) \
-avoid-version \
- -Wl,-exported_symbols_list -Wl,EnhancedDisassembly.exports \
+ -Wl,-exported_symbols_list -Wl,$(PROJ_SRC_DIR)/EnhancedDisassembly.exports \
-Wl,-dead_strip \
-Wl,-seg1addr -Wl,0xE0000000
@@ -51,17 +51,5 @@
$(Echo) "Building semantic information header"
$(Verb) $(TableGen) -o $(call SYSPATH, $@) -gen-enhanced-disassembly-header /dev/null
-EnhancedDisassembly.exports: EnhancedDisassembly.exports.noblocks EnhancedDisassembly.exports.blocks
- $(Echo) "Copying exports file"
-ifeq ($(HOST_OS),Darwin)
- $(Verb) if [ $(DARWIN_VERS) -ge 10 ] ; \
- then $(CP) -f $(PROJ_SRC_DIR)/EnhancedDisassembly.exports.blocks EnhancedDisassembly.exports ; \
- else $(CP) -f $(PROJ_SRC_DIR)/EnhancedDisassembly.exports.noblocks EnhancedDisassembly.exports ; \
- fi
-else
- $(Verb) $(CP) -f $(PROJ_SRC_DIR)/EnhancedDisassembly.exports.noblocks EnhancedDisassembly.exports
-endif
-
clean::
-$(Verb) $(RM) -f EDInfo.inc
- -$(Verb) $(RM) -f EnhancedDisassembly.exports