1 //===- X86TargetMachine.cpp -----------------------------------------------===// 2 // 3 // The MCLinker Project 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 #include "X86TargetMachine.h" 10 11 #include "mcld/Target/TargetMachine.h" 12 #include "mcld/Support/TargetRegistry.h" 13 #include "mcld/MC/MCLDInfo.h" 14 #include "X86.h" 15 16 extern "C" void LLVMInitializeX86LDTarget() { 17 // Register createTargetMachine function pointer to mcld::Target 18 mcld::RegisterTargetMachine<mcld::X86TargetMachine> X(mcld::TheX86Target); 19 } 20 21 mcld::X86TargetMachine::X86TargetMachine(llvm::TargetMachine& pPM, 22 const mcld::Target &pTarget, 23 const std::string& pTriple) 24 : mcld::LLVMTargetMachine(pPM, pTarget, pTriple) { 25 // arg1 - the number of total attributes 26 // arg2 - the most possible number of input files 27 m_pLDInfo = new MCLDInfo(pTriple, 32, 64); 28 } 29 30 mcld::X86TargetMachine::~X86TargetMachine() 31 { 32 delete m_pLDInfo; 33 } 34