Implemented serialization of signed integers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43828 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek
2007-11-07 18:24:34 +00:00
parent 29121848b9
commit 2e6452ca0c
5 changed files with 41 additions and 2 deletions

View File

@ -95,6 +95,8 @@ public:
~Deserializer();
uint64_t ReadInt();
int64_t ReadSInt();
bool ReadBool() {
return ReadInt() ? true : false;
}

View File

@ -50,6 +50,11 @@ SERIALIZE_INT_TRAIT(unsigned char)
SERIALIZE_INT_TRAIT(unsigned short)
SERIALIZE_INT_TRAIT(unsigned int)
SERIALIZE_INT_TRAIT(unsigned long)
SERIALIZE_INT_TRAIT(signed char)
SERIALIZE_INT_TRAIT(signed short)
SERIALIZE_INT_TRAIT(signed int)
SERIALIZE_INT_TRAIT(signed long)
#undef SERIALIZE_INT_TRAIT

View File

@ -37,7 +37,9 @@ public:
template <typename T>
inline void Emit(const T& X) { SerializeTrait<T>::Emit(*this,X); }
void EmitInt(unsigned X);
void EmitInt(uint64_t X);
void EmitSInt(int64_t X);
void EmitBool(bool X) { EmitInt(X); }
void EmitCStr(const char* beg, const char* end);
void EmitCStr(const char* cstr);