Created header file to include minimal forward references needed for
[oota-llvm.git] / include / llvm / Bitcode / Serialization.h
1 //==- Serialization.h - Generic Object Serialization to Bitcode ---*- C++ -*-=//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by Ted Kremenek and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines traits for primitive types used for both object
11 // serialization and deserialization.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef LLVM_BITCODE_SERIALIZE
16 #define LLVM_BITCODE_SERIALIZE
17
18 #include "llvm/Bitcode/SerializationFwd.h"
19
20 namespace llvm {
21   
22 #define SERIALIZE_INT_TRAIT(TYPE)\
23 template <> struct SerializeTrait<TYPE> {\
24   static void Emit(Serializer& S, TYPE X);\
25   static void Read(Deserializer& S, TYPE& X);\
26   static TYPE ReadVal(Deserializer& S); };
27
28 SERIALIZE_INT_TRAIT(bool)
29 SERIALIZE_INT_TRAIT(unsigned char)
30 SERIALIZE_INT_TRAIT(unsigned short)
31 SERIALIZE_INT_TRAIT(unsigned int)
32 SERIALIZE_INT_TRAIT(unsigned long)
33
34 #undef SERIALIZE_INT_TRAIT
35   
36 } // end namespace llvm
37
38 #endif