Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(52)

Delta Between Two Patch Sets: lib/CodeGen/ELFWriter.h

Issue 91042: Implement LLVM JIT side of GDB JIT debugging interface (Closed) SVN Base: http://llvm.org/svn/llvm-project/llvm/trunk/
Left Patch Set: Move the object files off disk and into memory. Created 3 months, 2 weeks ago
Right Patch Set: Synced with TOT. Created 2 months, 2 weeks ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
1 //===-- ELFWriter.h - Target-independent ELF writer support -----*- C++ -*-===// 1 //===-- ELFWriter.h - Target-independent ELF writer support -----*- C++ -*-===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file defines the ELFWriter class. 10 // This file defines the ELFWriter class.
(...skipping 15 matching lines...) Expand all
26 class ELFCodeEmitter; 26 class ELFCodeEmitter;
27 class ELFRelocation; 27 class ELFRelocation;
28 class ELFSection; 28 class ELFSection;
29 struct ELFSym; 29 struct ELFSym;
30 class GlobalVariable; 30 class GlobalVariable;
31 class JITDebugRegisterer; 31 class JITDebugRegisterer;
32 class Mangler; 32 class Mangler;
33 class MachineCodeEmitter; 33 class MachineCodeEmitter;
34 class MachineConstantPoolEntry; 34 class MachineConstantPoolEntry;
35 class ObjectCodeEmitter; 35 class ObjectCodeEmitter;
36 class TargetAsmInfo; 36 class MCAsmInfo;
37 class TargetELFWriterInfo; 37 class TargetELFWriterInfo;
38 class TargetLoweringObjectFile; 38 class TargetLoweringObjectFile;
39 class raw_ostream; 39 class raw_ostream;
40 class SectionKind; 40 class SectionKind;
41 class MCContext; 41 class MCContext;
42 42
43 typedef std::vector<ELFSym*>::iterator ELFSymIter; 43 typedef std::vector<ELFSym*>::iterator ELFSymIter;
44 typedef std::vector<ELFSection*>::iterator ELFSectionIter; 44 typedef std::vector<ELFSection*>::iterator ELFSectionIter;
45 typedef SetVector<const GlobalValue*>::const_iterator PendingGblsIter; 45 typedef SetVector<const GlobalValue*>::const_iterator PendingGblsIter;
46 typedef SetVector<const char *>::const_iterator PendingExtsIter; 46 typedef SetVector<const char *>::const_iterator PendingExtsIter;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 Mangler *Mang; 81 Mangler *Mang;
82 82
83 /// MCE - The MachineCodeEmitter object that we are exposing to emit machine 83 /// MCE - The MachineCodeEmitter object that we are exposing to emit machine
84 /// code for functions to the .o file. 84 /// code for functions to the .o file.
85 ELFCodeEmitter *ElfCE; 85 ELFCodeEmitter *ElfCE;
86 86
87 /// TLOF - Target Lowering Object File, provide section names for globals 87 /// TLOF - Target Lowering Object File, provide section names for globals
88 /// and other object file specific stuff 88 /// and other object file specific stuff
89 const TargetLoweringObjectFile &TLOF; 89 const TargetLoweringObjectFile &TLOF;
90 90
91 /// TAI - Target Asm Info, provide information about section names for 91 /// MAI - Target Asm Info, provide information about section names for
92 /// globals and other target specific stuff. 92 /// globals and other target specific stuff.
93 const TargetAsmInfo *TAI; 93 const MCAsmInfo *MAI;
94 94
95 //===------------------------------------------------------------------===// 95 //===------------------------------------------------------------------===//
96 // Properties inferred automatically from the target machine. 96 // Properties inferred automatically from the target machine.
97 //===------------------------------------------------------------------===// 97 //===------------------------------------------------------------------===//
98 98
99 /// is64Bit/isLittleEndian - This information is inferred from the target 99 /// is64Bit/isLittleEndian - This information is inferred from the target
100 /// machine directly, indicating whether to emit a 32- or 64-bit ELF file. 100 /// machine directly, indicating whether to emit a 32- or 64-bit ELF file.
101 bool is64Bit, isLittleEndian; 101 bool is64Bit, isLittleEndian;
102 102
103 /// doInitialization - Emit the file header and all of the global variables 103 /// doInitialization - Emit the file header and all of the global variables
104 /// for the module to the ELF file. 104 /// for the module to the ELF file.
105 bool doInitialization(Module &M); 105 bool doInitialization(Module &M);
106 bool runOnMachineFunction(MachineFunction &MF); 106 bool runOnMachineFunction(MachineFunction &MF);
107 107
108 /// doFinalization - Now that the module has been completely processed, emit 108 /// doFinalization - Now that the module has been completely processed, emit
109 /// the ELF file to 'O'. 109 /// the ELF file to 'O'.
110 bool doFinalization(Module &M); 110 bool doFinalization(Module &M);
111 111
112 private: 112 private:
113 /// Blob containing the Elf header 113 /// Blob containing the Elf header
114 BinaryObject ElfHdr; 114 BinaryObject ElfHdr;
115 115
116 /// SectionList - This is the list of sections that we have emitted to the 116 /// SectionList - This is the list of sections that we have emitted to the
117 /// file. Once the file has been completely built, the section header table 117 /// file. Once the file has been completely built, the section header table
118 /// is constructed from this info. 118 /// is constructed from this info.
119 std::vector<ELFSection*> SectionList; 119 std::vector<ELFSection*> SectionList;
120 unsigned NumSections; // Always = SectionList.size() 120 unsigned NumSections; // Always = SectionList.size()
121 121
122 /// SectionLookup - This is a mapping from section name to section number in 122 /// SectionLookup - This is a mapping from section name to section number in
123 /// the SectionList. Used to quickly gather the Section Index from TAI names 123 /// the SectionList. Used to quickly gather the Section Index from MAI names
124 std::map<std::string, ELFSection*> SectionLookup; 124 std::map<std::string, ELFSection*> SectionLookup;
125 125
126 /// PendingGlobals - Globals not processed as symbols yet. 126 /// PendingGlobals - Globals not processed as symbols yet.
127 SetVector<const GlobalValue*> PendingGlobals; 127 SetVector<const GlobalValue*> PendingGlobals;
128 128
129 /// GblSymLookup - This is a mapping from global value to a symbol index 129 /// GblSymLookup - This is a mapping from global value to a symbol index
130 /// in the symbol table or private symbols list. This is useful since reloc 130 /// in the symbol table or private symbols list. This is useful since reloc
131 /// symbol references must be quickly mapped to their indices on the lists. 131 /// symbol references must be quickly mapped to their indices on the lists.
132 std::map<const GlobalValue*, uint32_t> GblSymLookup; 132 std::map<const GlobalValue*, uint32_t> GblSymLookup;
133 133
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 void EmitStringTable(const std::string &ModuleName); 241 void EmitStringTable(const std::string &ModuleName);
242 void OutputSectionsAndSectionTable(); 242 void OutputSectionsAndSectionTable();
243 void RelocateField(BinaryObject &BO, uint32_t Offset, int64_t Value, 243 void RelocateField(BinaryObject &BO, uint32_t Offset, int64_t Value,
244 unsigned Size); 244 unsigned Size);
245 unsigned SortSymbols(); 245 unsigned SortSymbols();
246 CstExprResTy ResolveConstantExpr(const Constant *CV); 246 CstExprResTy ResolveConstantExpr(const Constant *CV);
247 }; 247 };
248 } 248 }
249 249
250 #endif 250 #endif
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld r497