1 //===- ARMTargetMachine.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 "ARMTargetMachine.h" 10 11 #include "mcld/Support/TargetRegistry.h" 12 #include "mcld/MC/MCLDInfo.h" 13 #include "ARM.h" 14 15 extern "C" void LLVMInitializeARMLDTarget() { 16 // Register createTargetMachine function pointer to mcld::Target 17 mcld::RegisterTargetMachine<mcld::ARMBaseTargetMachine> X(mcld::TheARMTarget); 18 } 19 20 mcld::ARMBaseTargetMachine::ARMBaseTargetMachine(llvm::TargetMachine& pPM, 21 const mcld::Target &pTarget, 22 const std::string& pTriple) 23 : mcld::LLVMTargetMachine(pPM, pTarget, pTriple) { 24 // arg1 - the number of total attributes 25 // arg2 - the most possible number of input files 26 m_pLDInfo = new MCLDInfo(pTriple, 32, 64); 27 } 28 29 mcld::ARMBaseTargetMachine::~ARMBaseTargetMachine() 30 { 31 delete m_pLDInfo; 32 } 33