forked from OSchip/llvm-project
CGCall.cpp - use castAs<> instead of getAs<> as we dereference the pointer directly. NFCI.
castAs<> will assert the correct cast type instead of just returning null, which we then try to dereference immediately in the setUsedBits call.
This commit is contained in:
parent
6d56823116
commit
eb7ea5aa1a
|
@ -3153,7 +3153,7 @@ llvm::Value *CodeGenFunction::EmitCMSEClearRecord(llvm::Value *Src,
|
|||
const llvm::DataLayout &DataLayout = CGM.getDataLayout();
|
||||
int Size = DataLayout.getTypeStoreSize(ITy);
|
||||
SmallVector<uint64_t, 4> Bits(Size);
|
||||
setUsedBits(CGM, QTy->getAs<RecordType>(), 0, Bits);
|
||||
setUsedBits(CGM, QTy->castAs<RecordType>(), 0, Bits);
|
||||
|
||||
int CharWidth = CGM.getContext().getCharWidth();
|
||||
uint64_t Mask =
|
||||
|
@ -3170,7 +3170,7 @@ llvm::Value *CodeGenFunction::EmitCMSEClearRecord(llvm::Value *Src,
|
|||
const llvm::DataLayout &DataLayout = CGM.getDataLayout();
|
||||
int Size = DataLayout.getTypeStoreSize(ATy);
|
||||
SmallVector<uint64_t, 16> Bits(Size);
|
||||
setUsedBits(CGM, QTy->getAs<RecordType>(), 0, Bits);
|
||||
setUsedBits(CGM, QTy->castAs<RecordType>(), 0, Bits);
|
||||
|
||||
// Clear each element of the LLVM array.
|
||||
int CharWidth = CGM.getContext().getCharWidth();
|
||||
|
|
Loading…
Reference in New Issue