Revert r254348: "Replace all weight-based interfaces in MBB with probability-based...
[oota-llvm.git] / include / llvm / Support / EndianStream.h
index 89c66d3b84809337abcd198473ae3c71485f65d6..d44a9b3b7ce8ba62aebbf1cc60d8d96fa6db14d4 100644 (file)
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LLVM_SUPPORT_ENDIAN_STREAM_H_
-#define _LLVM_SUPPORT_ENDIAN_STREAM_H_
+#ifndef LLVM_SUPPORT_ENDIANSTREAM_H
+#define LLVM_SUPPORT_ENDIANSTREAM_H
 
-#include <llvm/Support/Endian.h>
-#include <llvm/Support/raw_ostream.h>
+#include "llvm/Support/Endian.h"
+#include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
 namespace support {
@@ -31,9 +31,34 @@ template <endianness endian> struct Writer {
     OS.write((const char *)&Val, sizeof(value_type));
   }
 };
+
+template <>
+template <>
+inline void Writer<little>::write<float>(float Val) {
+  write(FloatToBits(Val));
+}
+
+template <>
+template <>
+inline void Writer<little>::write<double>(double Val) {
+  write(DoubleToBits(Val));
+}
+
+template <>
+template <>
+inline void Writer<big>::write<float>(float Val) {
+  write(FloatToBits(Val));
+}
+
+template <>
+template <>
+inline void Writer<big>::write<double>(double Val) {
+  write(DoubleToBits(Val));
+}
+
 } // end namespace endian
 
 } // end namespace support
 } // end namespace llvm
 
-#endif // _LLVM_SUPPORT_ENDIAN_STREAM_H_
+#endif