2007-10-24 19:06:40 +00:00
|
|
|
//==- Serialization.h - Generic Object Serialization to Bitcode ---*- C++ -*-=//
|
2007-10-23 21:29:33 +00:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by Ted Kremenek and is distributed under the
|
|
|
|
// University of Illinois Open Source License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines the interface for generic object serialization to
|
|
|
|
// LLVM bitcode.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LLVM_BITCODE_SERIALIZE
|
|
|
|
#define LLVM_BITCODE_SERIALIZE
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2007-10-24 19:06:40 +00:00
|
|
|
class Serializer;
|
|
|
|
class Deserializer;
|
2007-10-23 21:29:33 +00:00
|
|
|
template <typename T> struct SerializeTrait;
|
|
|
|
|
2007-10-24 19:06:40 +00:00
|
|
|
#define SERIALIZE_INT_TRAIT(TYPE)\
|
|
|
|
template <> struct SerializeTrait<TYPE> {\
|
|
|
|
static void Emit(Serializer& S, TYPE X);\
|
2007-10-25 00:10:21 +00:00
|
|
|
static void Read(Deserializer& S, TYPE& X);\
|
|
|
|
static TYPE ReadVal(Deserializer& S); };
|
2007-10-23 21:29:33 +00:00
|
|
|
|
2007-10-24 19:06:40 +00:00
|
|
|
SERIALIZE_INT_TRAIT(bool)
|
|
|
|
SERIALIZE_INT_TRAIT(unsigned char)
|
|
|
|
SERIALIZE_INT_TRAIT(unsigned short)
|
|
|
|
SERIALIZE_INT_TRAIT(unsigned int)
|
|
|
|
SERIALIZE_INT_TRAIT(unsigned long)
|
2007-10-23 21:29:33 +00:00
|
|
|
|
2007-10-24 19:06:40 +00:00
|
|
|
#undef SERIALIZE_INT_TRAIT
|
2007-10-23 22:17:03 +00:00
|
|
|
|
2007-10-23 21:29:33 +00:00
|
|
|
} // end namespace llvm
|
2007-10-24 19:06:40 +00:00
|
|
|
|
2007-10-23 21:29:33 +00:00
|
|
|
#endif
|