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