================
@@ -2288,16 +2303,23 @@ static ExprResult BuiltinMaskedLoad(Sema &S, CallExpr
*TheCall) {
Expr *MaskArg = TheCall->getArg(0);
Expr *PtrArg = TheCall->getArg(1);
- if (CheckMaskedBuiltinArgs(S, MaskArg, PtrArg, 2))
+ if (CheckMaskedBuiltinArgs(S, MaskArg, PtrArg, 2, /*AllowConst=*/true,
+ TheCall->getBuiltinCallee() ==
+ Builtin::BI__builtin_masked_load))
return ExprError();
QualType MaskTy = MaskArg->getType();
QualType PtrTy = PtrArg->getType();
QualType PointeeTy = PtrTy->getPointeeType();
const VectorType *MaskVecTy = MaskTy->getAs<VectorType>();
- QualType RetTy =
- S.Context.getExtVectorType(PointeeTy, MaskVecTy->getNumElements());
+ QualType RetTy = S.Context.getExtVectorType(PointeeTy.getUnqualifiedType(),
+ MaskVecTy->getNumElements());
+ Qualifiers Qs = PointeeTy.getQualifiers();
+ Qs.removeConst();
+ if (Qs.hasAddressSpace())
+ RetTy = S.Context.getQualifiedType(RetTy, Qs);
----------------
rjmccall wrote:
The return type is just an r-value and shouldn't have any qualifiers.
https://github.com/llvm/llvm-project/pull/160185
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits