From: Sean Callanan Date: Tue, 2 Feb 2010 00:04:46 +0000 (+0000) Subject: Changed to Chris Lattner's suggested approach, which X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=37ad4661b4737e70c9f6a8a2037b4a9731add351;p=oota-llvm.git 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 2ac6c79296a..c2c179693e9 100644 --- a/tools/ed/EDMain.cpp +++ b/tools/ed/EDMain.cpp @@ -248,4 +248,18 @@ int EDBlockVisitTokens(EDInstRef inst, 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 b/tools/ed/EnhancedDisassembly.exports new file mode 100644 index 00000000000..63738e53665 --- /dev/null +++ b/tools/ed/EnhancedDisassembly.exports @@ -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 diff --git a/tools/ed/EnhancedDisassembly.exports.blocks b/tools/ed/EnhancedDisassembly.exports.blocks deleted file mode 100644 index 63738e53665..00000000000 --- a/tools/ed/EnhancedDisassembly.exports.blocks +++ /dev/null @@ -1,31 +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 -_EDBlockCreateInsts -_EDBlockEvaluateOperand -_EDBlockVisitTokens diff --git a/tools/ed/EnhancedDisassembly.exports.noblocks b/tools/ed/EnhancedDisassembly.exports.noblocks deleted file mode 100644 index 5852e7f4b22..00000000000 --- 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 23970a9cae4..a3c58796687 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 @@ ifeq ($(HOST_OS),Darwin) # 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 @@ EDInfo.inc: $(TBLGEN) $(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