From 0122c9051a0157908e3f4e1c604435339ac4761d Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Tue, 22 Dec 2009 01:11:26 +0000 Subject: [PATCH] Fixed library dependencies between the X86 disassembler and X86 codegen that were causing circular symbol dependencies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91871 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/X86/Disassembler/X86Disassembler.cpp | 13 +++++-------- .../X86/Disassembler/X86DisassemblerDecoder.c | 6 ------ lib/Target/X86/X86TargetMachine.cpp | 4 ---- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/lib/Target/X86/Disassembler/X86Disassembler.cpp b/lib/Target/X86/Disassembler/X86Disassembler.cpp index 4bb9075789a..17dbd7f237f 100644 --- a/lib/Target/X86/Disassembler/X86Disassembler.cpp +++ b/lib/Target/X86/Disassembler/X86Disassembler.cpp @@ -14,11 +14,8 @@ // //===----------------------------------------------------------------------===// -#if 0 - #include "X86Disassembler.h" #include "X86DisassemblerDecoder.h" -#include "X86InstrInfo.h" #include "llvm/MC/MCDisassembler.h" #include "llvm/MC/MCDisassembler.h" @@ -27,6 +24,9 @@ #include "llvm/Support/MemoryObject.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/raw_ostream.h" + +#include "../X86GenRegisterNames.inc" + using namespace llvm; using namespace llvm::X86Disassembler; @@ -46,6 +46,8 @@ namespace X86 { }; } +extern Target TheX86_32Target, TheX86_64Target; + } static void translateInstruction(MCInst &target, @@ -461,8 +463,3 @@ extern "C" void LLVMInitializeX86Disassembler() { TargetRegistry::RegisterMCDisassembler(TheX86_64Target, createX86_64Disassembler); } - -#endif - -extern "C" void LLVMInitializeX86Disassembler() { -} diff --git a/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c b/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c index 118a7a389fd..84c1dc945e1 100644 --- a/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c +++ b/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c @@ -13,8 +13,6 @@ * *===----------------------------------------------------------------------===*/ -#if 0 - #include /* for assert() */ #include /* for va_*() */ #include /* for vsnprintf() */ @@ -1361,7 +1359,3 @@ int decodeInstruction(struct InternalInstruction* insn, return 0; } - -#endif - -int X86DissemblerDecoder_dummy = 0; diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index c22c9fea72b..962f0f7be9a 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -38,8 +38,6 @@ static const MCAsmInfo *createMCAsmInfo(const Target &T, StringRef TT) { } } -extern "C" void LLVMInitializeX86Disassembler(); - extern "C" void LLVMInitializeX86Target() { // Register the target. RegisterTargetMachine X(TheX86_32Target); @@ -49,8 +47,6 @@ extern "C" void LLVMInitializeX86Target() { RegisterAsmInfoFn A(TheX86_32Target, createMCAsmInfo); RegisterAsmInfoFn B(TheX86_64Target, createMCAsmInfo); - LLVMInitializeX86Disassembler(); - // Register the code emitter. TargetRegistry::RegisterCodeEmitter(TheX86_32Target, createX86MCCodeEmitter); TargetRegistry::RegisterCodeEmitter(TheX86_64Target, createX86MCCodeEmitter);