MCPcopy Create free account
hub / github.com/ablab/spades / initFromArray

Method initFromArray

ext/src/llvm/APInt.cpp:91–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91void APInt::initFromArray(ArrayRef<uint64_t> bigVal) {
92 assert(BitWidth && "Bitwidth too small");
93 assert(bigVal.data() && "Null pointer detected!");
94 if (isSingleWord())
95 U.VAL = bigVal[0];
96 else {
97 // Get memory, cleared to 0
98 U.pVal = getClearedMemory(getNumWords());
99 // Calculate the number of words to copy
100 unsigned words = std::min<unsigned>(bigVal.size(), getNumWords());
101 // Copy the words from bigVal to pVal
102 memcpy(U.pVal, bigVal.data(), words * APINT_WORD_SIZE);
103 }
104 // Make sure unused high bits are cleared
105 clearUnusedBits();
106}
107
108APInt::APInt(unsigned numBits, ArrayRef<uint64_t> bigVal)
109 : BitWidth(numBits) {

Callers

nothing calls this directly

Calls 6

assertClass · 0.85
isSingleWordFunction · 0.85
getClearedMemoryFunction · 0.85
getNumWordsFunction · 0.85
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected