aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/MachO.h
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-07-06 06:40:51 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2009-07-06 06:40:51 +0000
commit752e928e6b87a2988588fed9cc224fd6ec02c5f6 (patch)
tree7f710d72d9411ad625ead5698d48935ea6ece974 /lib/CodeGen/MachO.h
parent8ae058a815d41d73965832cf3d190e27a48de5f6 (diff)
downloadexternal_llvm-752e928e6b87a2988588fed9cc224fd6ec02c5f6.zip
external_llvm-752e928e6b87a2988588fed9cc224fd6ec02c5f6.tar.gz
external_llvm-752e928e6b87a2988588fed9cc224fd6ec02c5f6.tar.bz2
Cleanup MachO writer and code emitter. Fix 80 cols problems, remove extra spaces, shrink down includes and move some methods out-of-line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74817 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachO.h')
-rw-r--r--lib/CodeGen/MachO.h31
1 files changed, 14 insertions, 17 deletions
diff --git a/lib/CodeGen/MachO.h b/lib/CodeGen/MachO.h
index 76c8699..247b4a6 100644
--- a/lib/CodeGen/MachO.h
+++ b/lib/CodeGen/MachO.h
@@ -14,18 +14,15 @@
#ifndef MACHO_H
#define MACHO_H
-#include "llvm/Constants.h"
-#include "llvm/DerivedTypes.h"
-#include "llvm/CodeGen/MachineRelocation.h"
#include "llvm/CodeGen/BinaryObject.h"
-#include "llvm/Target/TargetAsmInfo.h"
#include <string>
#include <vector>
namespace llvm {
-typedef std::vector<unsigned char> DataBuffer;
-
+class GlobalValue;
+class TargetAsmInfo;
+
/// MachOSym - This struct contains information about each symbol that is
/// added to logical symbol table for the module. This is eventually
/// turned into a real symbol table in the file.
@@ -111,7 +108,7 @@ struct MachOHeader {
/// HeaderData - The actual data for the header which we are building
/// up for emission to the file.
- DataBuffer HeaderData;
+ std::vector<unsigned char> HeaderData;
// Constants for the filetype field
// see <mach-o/loader.h> for additional info on the various types
@@ -181,8 +178,8 @@ struct MachOHeader {
};
MachOHeader() : magic(0), filetype(0), ncmds(0), sizeofcmds(0), flags(0),
- reserved(0) { }
-
+ reserved(0) {}
+
/// cmdSize - This routine returns the size of the MachOSection as written
/// to disk, depending on whether the destination is a 64 bit Mach-O file.
unsigned cmdSize(bool is64Bit) const {
@@ -204,7 +201,7 @@ struct MachOHeader {
}
}; // end struct MachOHeader
-
+
/// MachOSegment - This struct contains the necessary information to
/// emit the load commands for each section in the file.
struct MachOSegment {
@@ -246,13 +243,13 @@ struct MachOSegment {
SEG_VM_PROT_EXECUTE = VM_PROT_EXECUTE,
SEG_VM_PROT_ALL = VM_PROT_ALL
};
-
+
// Constants for the cmd field
// see <mach-o/loader.h>
enum { LC_SEGMENT = 0x01, // segment of this file to be mapped
LC_SEGMENT_64 = 0x19 // 64-bit segment of this file to be mapped
};
-
+
/// cmdSize - This routine returns the size of the MachOSection as written
/// to disk, depending on whether the destination is a 64 bit Mach-O file.
unsigned cmdSize(bool is64Bit) const {
@@ -285,15 +282,15 @@ struct MachOSection : public BinaryObject {
uint32_t reserved1; // reserved (for offset or index)
uint32_t reserved2; // reserved (for count or sizeof)
uint32_t reserved3; // reserved (64 bit only)
-
+
/// A unique number for this section, which will be used to match symbols
/// to the correct section.
uint32_t Index;
-
+
/// RelocBuffer - A buffer to hold the mach-o relocations before we write
/// them out at the appropriate location in the file.
- DataBuffer RelocBuffer;
-
+ std::vector<unsigned char> RelocBuffer;
+
// Constants for the section types (low 8 bits of flags field)
// see <mach-o/loader.h>
enum { S_REGULAR = 0,
@@ -405,7 +402,7 @@ struct MachODySymTab {
ilocalsym(0), nlocalsym(0), iextdefsym(0), nextdefsym(0),
iundefsym(0), nundefsym(0), tocoff(0), ntoc(0), modtaboff(0),
nmodtab(0), extrefsymoff(0), nextrefsyms(0), indirectsymoff(0),
- nindirectsyms(0), extreloff(0), nextrel(0), locreloff(0), nlocrel(0) { }
+ nindirectsyms(0), extreloff(0), nextrel(0), locreloff(0), nlocrel(0) {}
}; // end struct MachODySymTab