• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- MCBitcodeInterceptor.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 <mcld/LD/Relocation.h>
10 #include <mcld/MC/MCBitcodeInterceptor.h>
11 #include <mcld/MC/MCLDInfo.h>
12 #include <mcld/Target/TargetLDBackend.h>
13 #include <llvm/MC/MCAssembler.h>
14 #include <llvm/MC/MCExpr.h>
15 #include <llvm/MC/MCValue.h>
16 #include <llvm/MC/MCFixup.h>
17 #include <llvm/MC/MCFixupKindInfo.h>
18 #include <llvm/MC/MCSymbol.h>
19 #include <llvm/MC/MCAsmLayout.h>
20 #include <llvm/MC/MCAsmBackend.h>
21 #include <llvm/MC/MCAssembler.h>
22 #include <llvm/Support/raw_ostream.h>
23 #include <llvm/MC/MCObjectStreamer.h>
24 #include <llvm/Support/Casting.h>
25 #include <llvm/Support/ELF.h>
26 
27 using namespace llvm;
28 using namespace mcld;
29 
30 //===----------------------------------------------------------------------===//
31 // non-member functions
32 
33 //===----------------------------------------------------------------------===//
34 // MCBitcodeInterceptor
MCBitcodeInterceptor(MCObjectStreamer & pStreamer,TargetLDBackend & pBackend,MCLDInfo & pLDInfo)35 MCBitcodeInterceptor::MCBitcodeInterceptor(MCObjectStreamer &pStreamer,
36                                            TargetLDBackend& pBackend,
37                                            MCLDInfo& pLDInfo)
38   : MCObjectWriter(llvm::nulls(),
39                    pStreamer.getAssembler().getWriter().isLittleEndian()),
40     m_Backend(pBackend),
41     m_LDInfo(pLDInfo) {
42   pStreamer.getAssembler().setWriter(*this);
43 }
44 
~MCBitcodeInterceptor()45 MCBitcodeInterceptor::~MCBitcodeInterceptor()
46 {
47 }
48 
ExecutePostLayoutBinding(MCAssembler & Asm,const MCAsmLayout & Layout)49 void MCBitcodeInterceptor::ExecutePostLayoutBinding(MCAssembler &Asm,
50                                                  const MCAsmLayout &Layout)
51 {
52 }
53 
54 
RecordRelocation(const MCAssembler & Asm,const MCAsmLayout & Layout,const MCFragment * Fragment,const MCFixup & Fixup,MCValue Target,uint64_t & FixedValue)55 void MCBitcodeInterceptor::RecordRelocation(const MCAssembler &Asm,
56                                          const MCAsmLayout &Layout,
57                                          const MCFragment *Fragment,
58                                          const MCFixup &Fixup,
59                                          MCValue Target,
60                                          uint64_t &FixedValue)
61 {
62 }
63 
64 /// WriteObject - not really write out a object. Instead, load data to LDContext
WriteObject(MCAssembler & Asm,const MCAsmLayout & Layout)65 void MCBitcodeInterceptor::WriteObject(MCAssembler &Asm,
66                                        const MCAsmLayout &Layout)
67 {
68 }
69 
70 
71