summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2007-01-24 03:36:05 +0000
committerBill Wendling <isanbard@gmail.com>2007-01-24 03:36:05 +0000
commita1b7b8a4850d9a61ee306ee23d42a745d8ad2967 (patch)
tree0f1021637116a1f76adf4ad7ed4290bdc6647d94 /llvm/lib/Target
parent8942551dee7c140e4334d85320a5ed6df0e5bd00 (diff)
downloadbcm5719-llvm-a1b7b8a4850d9a61ee306ee23d42a745d8ad2967.tar.gz
bcm5719-llvm-a1b7b8a4850d9a61ee306ee23d42a745d8ad2967.zip
New "TargetMachOWriterInfo" class. It holds target-specific information
that the MachOWriter needs in order to do its writing stuff 'n things. llvm-svn: 33475
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp22
-rw-r--r--llvm/lib/Target/PowerPC/PPCMachOWriterInfo.h35
-rw-r--r--llvm/lib/Target/TargetMachOWriterInfo.cpp23
3 files changed, 80 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp b/llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp
new file mode 100644
index 00000000000..54e06812229
--- /dev/null
+++ b/llvm/lib/Target/PowerPC/PPCMachOWriterInfo.cpp
@@ -0,0 +1,22 @@
+//===-- PPCMachOWriterInfo.cpp - Mach-O Writer Info for the PowerPC -------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by Bill Wendling and is distributed under the
+// University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements Mach-O writer information for the PowerPC backend.
+//
+//===----------------------------------------------------------------------===//
+
+#include "PPCMachOWriterInfo.h"
+#include "PPCTargetMachine.h"
+using namespace llvm;
+
+PPCMachOWriterInfo::PPCMachOWriterInfo(const PPCTargetMachine &TM)
+ : TargetMachOWriterInfo(TM.getTargetData()->getPointerSizeInBits() == 64 ?
+ HDR_CPU_TYPE_POWERPC64 :
+ HDR_CPU_TYPE_POWERPC,
+ HDR_CPU_SUBTYPE_POWERPC_ALL) {}
diff --git a/llvm/lib/Target/PowerPC/PPCMachOWriterInfo.h b/llvm/lib/Target/PowerPC/PPCMachOWriterInfo.h
new file mode 100644
index 00000000000..af47833d4cb
--- /dev/null
+++ b/llvm/lib/Target/PowerPC/PPCMachOWriterInfo.h
@@ -0,0 +1,35 @@
+//===-- PPCMachOWriterInfo.h - Mach-O Writer Info for PowerPC ---*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by Bill Wendling and is distributed under the
+// University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file implements Mach-O writer information for the PowerPC backend.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef PPC_MACHO_WRITER_INFO_H
+#define PPC_MACHO_WRITER_INFO_H
+
+#include "llvm/Target/TargetMachOWriterInfo.h"
+
+namespace llvm {
+
+ // Forward declarations
+ class PPCTargetMachine;
+
+ struct PPCMachOWriterInfo : public TargetMachOWriterInfo {
+ PPCMachOWriterInfo(const PPCTargetMachine &TM);
+ virtual ~PPCMachOWriterInfo() {}
+
+ virtual const char *getPassName() const {
+ return "PowerPC Mach-O Writer";
+ }
+ };
+
+} // end llvm namespace
+
+#endif // PPC_MACHO_WRITER_INFO_H
diff --git a/llvm/lib/Target/TargetMachOWriterInfo.cpp b/llvm/lib/Target/TargetMachOWriterInfo.cpp
new file mode 100644
index 00000000000..3cf297499c5
--- /dev/null
+++ b/llvm/lib/Target/TargetMachOWriterInfo.cpp
@@ -0,0 +1,23 @@
+//===-- llvm/Target/TargetMachOWriterInfo.h - MachO Writer Info -*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file was developed by Bill Wendling and is distributed under the
+// University of Illinois Open Source License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines the TargetMachOWriterInfo class.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/Target/TargetMachOWriterInfo.h"
+#include "llvm/CodeGen/MachineRelocation.h"
+using namespace llvm;
+
+MachineRelocation
+TargetMachOWriterInfo::GetJTRelocation(unsigned Offset,
+ MachineBasicBlock *MBB) const {
+ // FIXME: do something about PIC
+ return MachineRelocation::getBB(Offset, MachineRelocation::VANILLA, MBB);
+}
OpenPOWER on IntegriCloud