blob: 02db22305344e7eb7c00d773464cb231ddf308ff (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
//==- Serialization.h - Generic Object Serialization to Bitcode ---*- C++ -*-=//
//
// 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 {
class Serializer;
class Deserializer;
template <typename T> struct SerializeTrait;
#define SERIALIZE_INT_TRAIT(TYPE)\
template <> struct SerializeTrait<TYPE> {\
static void Emit(Serializer& S, TYPE X);\
static void Read(Deserializer& S, TYPE& X);\
static TYPE ReadVal(Deserializer& S); };
SERIALIZE_INT_TRAIT(bool)
SERIALIZE_INT_TRAIT(unsigned char)
SERIALIZE_INT_TRAIT(unsigned short)
SERIALIZE_INT_TRAIT(unsigned int)
SERIALIZE_INT_TRAIT(unsigned long)
#undef SERIALIZE_INT_TRAIT
} // end namespace llvm
#endif
|