1 //==- Serialization.h - Generic Object Serialization to Bitcode ---*- C++ -*-=//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
10 // This file defines traits for primitive types used for both object
11 // serialization and deserialization.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_BITCODE_SERIALIZE
16 #define LLVM_BITCODE_SERIALIZE
18 #include "llvm/Bitcode/SerializationFwd.h"
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); };
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)
34 #undef SERIALIZE_INT_TRAIT
36 } // end namespace llvm