aboutsummaryrefslogtreecommitdiff
path: root/lib/Bytecode/Writer/WriterPrimitives.h
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-07-11 17:22:07 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-07-11 17:22:07 +0000
commit87bc41833458760082d259f92d1e40a343428ceb (patch)
treef2e2fce6af207ecd97e9d5b069b91f0b01685227 /lib/Bytecode/Writer/WriterPrimitives.h
parentbeff74f821b461d6934ffdbecb426335f8f1f197 (diff)
Prepare the writer for a non-broken implementation of writing floating
point values. This will be fixed when I figure out how to do it correctly without depending on knowing the endianess of a platform. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14762 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode/Writer/WriterPrimitives.h')
-rw-r--r--lib/Bytecode/Writer/WriterPrimitives.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Bytecode/Writer/WriterPrimitives.h b/lib/Bytecode/Writer/WriterPrimitives.h
index b76cc55e16..02c225baf1 100644
--- a/lib/Bytecode/Writer/WriterPrimitives.h
+++ b/lib/Bytecode/Writer/WriterPrimitives.h
@@ -119,6 +119,23 @@ static inline void output_data(const void *Ptr, const void *End,
Out.insert(Out.end(), (const unsigned char*)Ptr, (const unsigned char*)End);
}
+static inline void output_float(float& FloatVal,
+ std::deque<unsigned char>& Out) {
+ /// FIXME: This is a broken implementation! It writes
+ /// it in a platform-specific endianess. Need to make
+ /// it little endian always.
+ output_data(&FloatVal, &FloatVal+1, Out);
+}
+
+static inline void output_double(double& DoubleVal,
+ std::deque<unsigned char>& Out) {
+ /// FIXME: This is a broken implementation! It writes
+ /// it in a platform-specific endianess. Need to make
+ /// it little endian always.
+ output_data(&DoubleVal, &DoubleVal+1, Out);
+}
+
} // End llvm namespace
+// vim: sw=2 ai
#endif