Reference RegionPass to stop it being eliminated.
[oota-llvm.git] / include / llvm / CodeGen / BinaryObject.h
index 542a177529e44ecfa9a01a177ef83475bf9e3208..3ade7c9e47cd113e45c3a76d6e6c6bdf810c7ce9 100644 (file)
 #ifndef LLVM_CODEGEN_BINARYOBJECT_H
 #define LLVM_CODEGEN_BINARYOBJECT_H
 
-#include "llvm/Support/DataTypes.h"
+#include "llvm/CodeGen/MachineRelocation.h"
+#include "llvm/System/DataTypes.h"
 
 #include <string>
 #include <vector>
 
 namespace llvm {
 
-class MachineRelocation;
 typedef std::vector<uint8_t> BinaryData;
 
 class BinaryObject {
@@ -68,6 +68,13 @@ public:
     return !Relocations.empty();
   }
 
+  /// emitZeros - This callback is invoked to emit a arbitrary number 
+  /// of zero bytes to the data stream.
+  inline void emitZeros(unsigned Size) {
+    for (unsigned i=0; i < Size; ++i)
+      emitByte(0);
+  }
+
   /// emitByte - This callback is invoked when a byte needs to be
   /// written to the data stream.
   inline void emitByte(uint8_t B) {
@@ -124,6 +131,19 @@ public:
       emitDWordBE(W);
   }
 
+  /// emitWord64 - This callback is invoked when a x86_fp80 needs to be
+  /// written to the data stream in correct endian format.
+  inline void emitWordFP80(const uint64_t *W, unsigned PadSize) {
+    if (IsLittleEndian) {
+      emitWord64(W[0]);
+      emitWord16(W[1]);  
+    } else {
+      emitWord16(W[1]);  
+      emitWord64(W[0]);
+    }
+    emitZeros(PadSize);
+  }
+
   /// emitWordLE - This callback is invoked when a 32-bit word needs to be
   /// written to the data stream in little-endian format.
   inline void emitWordLE(uint32_t W) {