Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions clang/include/clang/AST/APNumericStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ class APNumericStorage {
llvm::APInt getIntValue() const {
unsigned NumWords = llvm::APInt::getNumWords(BitWidth);
if (NumWords > 1)
return llvm::APInt(BitWidth, NumWords, pVal);
else
return llvm::APInt(BitWidth, VAL);
return llvm::APInt(BitWidth, llvm::ArrayRef(pVal, NumWords));
return llvm::APInt(BitWidth, VAL);
}
void setIntValue(const ASTContext &C, const llvm::APInt &Val);
};
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/AST/AbstractBasicReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class DataStreamBasicReader : public BasicReaderBase<Impl> {
llvm::SmallVector<uint64_t, 4> data;
for (uint32_t i = 0; i != numWords; ++i)
data.push_back(asImpl().readUInt64());
return llvm::APInt(bitWidth, numWords, &data[0]);
return llvm::APInt(bitWidth, data);
}

llvm::FixedPointSemantics readFixedPointSemantics() {
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/AST/ByteCode/Floating.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ class Floating final {
if (singleWord())
return APFloat(getSemantics(), APInt(BitWidth, Val));
unsigned NumWords = numWords();
return APFloat(getSemantics(), APInt(BitWidth, NumWords, Memory));
return APFloat(getSemantics(),
APInt(BitWidth, llvm::ArrayRef(Memory, NumWords)));
}

public:
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/AST/ByteCode/IntegralAP.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ template <bool Signed> class IntegralAP final {
if (singleWord())
return APInt(BitWidth, Val, Signed);
unsigned NumWords = llvm::APInt::getNumWords(BitWidth);
return llvm::APInt(BitWidth, NumWords, Memory);
return llvm::APInt(BitWidth, llvm::ArrayRef(Memory, NumWords));
}

public:
Expand Down