blob: 47792c7d089430dbf9b950d30b9fd737afcc6df7 (
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
|
//===-- SerializeAPInt.cpp - Serialization for APInts ----------*- C++ -*--===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file implements serialization of APInts.
//
//===----------------------------------------------------------------------===//
#include "llvm/ADT/APInt.h"
#include "llvm/Bitcode/Serialize.h"
#include <cassert>
using namespace llvm;
void APInt::Emit(Serializer& S) const {
S.EmitInt(BitWidth);
if (isSingleWord())
S.EmitInt(VAL);
else {
uint32_t NumWords = getNumWords();
S.EmitInt(NumWords);
for (unsigned i = 0; i < NumWords; ++i)
S.EmitInt(pVal[i]);
}
}
|