diff options
author | ed <ed@FreeBSD.org> | 2009-06-08 15:36:37 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-06-08 15:36:37 +0000 |
commit | de000e339094f8c6e06a635dac9a803861416ec6 (patch) | |
tree | 674737fb36b447a4141b2fbaf40d3465434fdfad /lib/CodeGen/ELFWriter.h | |
parent | e65fe1a3e103e3aa81b69704d20eb95f54097271 (diff) | |
download | FreeBSD-src-de000e339094f8c6e06a635dac9a803861416ec6.zip FreeBSD-src-de000e339094f8c6e06a635dac9a803861416ec6.tar.gz |
Import LLVM r73070.
Now I'm going to stop importing code for a while. I spent a lot of time
the last couple of days figuring out which LLVM commit caused g++ to
miscompile, which in its turn caused Clang to miscompile the next build.
I had to run `make buildworld' twice each time I bisected a revision.
Diffstat (limited to 'lib/CodeGen/ELFWriter.h')
-rw-r--r-- | lib/CodeGen/ELFWriter.h | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/lib/CodeGen/ELFWriter.h b/lib/CodeGen/ELFWriter.h index 0389185..14a44f0 100644 --- a/lib/CodeGen/ELFWriter.h +++ b/lib/CodeGen/ELFWriter.h @@ -14,6 +14,7 @@ #ifndef ELFWRITER_H #define ELFWRITER_H +#include "llvm/ADT/SetVector.h" #include "llvm/CodeGen/MachineFunctionPass.h" #include "ELF.h" #include <list> @@ -46,15 +47,12 @@ namespace llvm { protected: /// Output stream to send the resultant object file to. - /// raw_ostream &O; /// Target machine description. - /// TargetMachine &TM; /// Mang - The object used to perform name mangling for this module. - /// Mangler *Mang; /// MCE - The MachineCodeEmitter object that we are exposing to emit machine @@ -62,19 +60,8 @@ namespace llvm { ELFCodeEmitter *MCE; //===------------------------------------------------------------------===// - // Properties to be set by the derived class ctor, used to configure the - // ELFWriter. - - // e_machine - This field is the target specific value to emit as the - // e_machine member of the ELF header. - unsigned short e_machine; - - // e_flags - The machine flags for the target. This defaults to zero. - unsigned e_flags; - - //===------------------------------------------------------------------===// // Properties inferred automatically from the target machine. - // + //===------------------------------------------------------------------===// /// is64Bit/isLittleEndian - This information is inferred from the target /// machine directly, indicating whether to emit a 32- or 64-bit ELF file. @@ -95,6 +82,9 @@ namespace llvm { // as well!). DataBuffer FileHeader; + /// ElfHdr - Hold information about the ELF Header + ELFHeader *ElfHdr; + /// SectionList - This is the list of sections that we have emitted to the /// file. Once the file has been completely built, the section header table /// is constructed from this info. @@ -140,6 +130,11 @@ namespace llvm { /// local symbols first in the list). std::vector<ELFSym> SymbolTable; + /// PendingSyms - This is a list of externally defined symbols that we have + /// been asked to emit, but have not seen a reference to. When a reference + /// is seen, the symbol will move from this list to the SymbolTable. + SetVector<GlobalValue*> PendingGlobals; + // As we complete the ELF file, we need to update fields in the ELF header // (e.g. the location of the section table). These members keep track of // the offset in ELFHeader of these various pieces to update and other @@ -149,9 +144,8 @@ namespace llvm { unsigned ELFHdr_e_shnum_Offset; // e_shnum in ELF header. private: void EmitGlobal(GlobalVariable *GV); - void EmitSymbolTable(); - + void EmitRelocations(); void EmitSectionTableStringTable(); void OutputSectionsAndSectionTable(); }; |