1 //===-- DeserializeAPInt.cpp - Deserialization for APInts ------*- C++ -*--===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file implements deserialization of APInts.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/ADT/APInt.h"
15 #include "llvm/Bitcode/Deserialize.h"
20 void APInt::Read(Deserializer
& D
) {
21 BitWidth
= D
.ReadInt();
26 uint32_t NumWords
= D
.ReadInt();
27 assert (NumWords
> 1);
28 pVal
= new uint64_t[NumWords
];
29 assert (pVal
&& "Allocation in deserialization of APInt failed.");
30 for (unsigned i
= 0; i
< NumWords
; ++i
)
31 pVal
[i
] = D
.ReadInt();