diff --git a/clang/lib/CIR/CodeGen/CIRGenExprAgg.cpp b/clang/lib/CIR/CodeGen/CIRGenExprAgg.cpp index ad4a638a178f..0f1ef0cfcfb1 100644 --- a/clang/lib/CIR/CodeGen/CIRGenExprAgg.cpp +++ b/clang/lib/CIR/CodeGen/CIRGenExprAgg.cpp @@ -311,7 +311,7 @@ class AggExprEmitter : public StmtVisitor { assert(llvm::isa(subExpr)); llvm::SmallVector inits{}; for (auto *init : llvm::cast(subExpr)->inits()) { - RValue tmpInit = CGF.buildAnyExprToTemp(init); + RValue tmpInit = CGF.emitAnyExprToTemp(init); if (tmpInit.isScalar()) { inits.push_back(tmpInit.getScalarVal()); } else if (tmpInit.isComplex()) { @@ -321,7 +321,7 @@ class AggExprEmitter : public StmtVisitor { } } AggValueSlot dest = EnsureSlot(loc, E->getType()); - builder.create(loc, dest.getPointer(), inits); + builder.create(loc, dest.getPointer(), inits); } void VisitExprWithCleanups(ExprWithCleanups *E); diff --git a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp index 1f003c860c0b..d82939266968 100644 --- a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp +++ b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp @@ -4387,12 +4387,12 @@ class CIRSignBitOpLowering : public mlir::OpConversionPattern { }; class CIRInitListCtorLowering - : public mlir::OpConversionPattern { + : public mlir::OpConversionPattern { public: - using OpConversionPattern::OpConversionPattern; + using OpConversionPattern::OpConversionPattern; mlir::LogicalResult - matchAndRewrite(mlir::cir::InitListCtor op, OpAdaptor adaptor, + matchAndRewrite(cir::InitListCtor op, OpAdaptor adaptor, mlir::ConversionPatternRewriter &rewriter) const override { auto loc = op.getLoc(); const bool inbounds = true; @@ -4402,9 +4402,8 @@ class CIRInitListCtorLowering mlir::LLVM::LLVMPointerType::get(rewriter.getContext()); // initlist object - auto initListType = mlir::cast( - mlir::cast(op->getOperand(0).getType()) - .getPointee()); + auto initListType = mlir::cast( + mlir::cast(op->getOperand(0).getType()).getPointee()); assert(initListType.getMembers().size() == 2U); auto initListLLVMType = getTypeConverter()->convertType(initListType); mlir::Value initlist = adaptor.getOperands()[0]; @@ -4434,16 +4433,16 @@ class CIRInitListCtorLowering initArgStoragePtr); } // rewrite - assert(mlir::isa(initListType.getMembers()[0])); + assert(mlir::isa(initListType.getMembers()[0])); auto llvmStartType = getTypeConverter()->convertType( - (mlir::cast(initListType.getMembers()[0]))); + (mlir::cast(initListType.getMembers()[0]))); auto llvmStartElement = rewriter.create( loc, llvmStartType, initListLLVMType, initlist, llvm::SmallVector{0, 0}, inbounds); rewriter.create(loc, llvmArrayPtr, llvmStartElement); auto endType = initListType.getMembers()[1]; - if (mlir::dyn_cast(endType)) { + if (mlir::dyn_cast(endType)) { auto llvmEndOfArray = rewriter.create( loc, llvmPtrType, llvmArrayType, llvmArrayPtr, llvm::SmallVector{0, argListSize}, inbounds); diff --git a/clang/test/CIR/CodeGen/initlist-ptr-ptr.cpp b/clang/test/CIR/CodeGen/initlist-ptr-ptr.cpp index b65784241cb9..cb528f388275 100644 --- a/clang/test/CIR/CodeGen/initlist-ptr-ptr.cpp +++ b/clang/test/CIR/CodeGen/initlist-ptr-ptr.cpp @@ -56,7 +56,7 @@ void test() { // LLVM: [[ELEM_ARRAY_PTR:%.*]] = alloca [2 x ptr], align 8, // LLVM: store ptr @.str, ptr [[ELEM_ARRAY_PTR]], align 8, // LLVM: [[PTR_SECOND_ELEM:%.*]] = getelementptr inbounds [2 x ptr], ptr [[ELEM_ARRAY_PTR]], i32 1, -// LLVM: store ptr @.str1, ptr [[PTR_SECOND_ELEM]], align 8, +// LLVM: store ptr @.str.1, ptr [[PTR_SECOND_ELEM]], align 8, // LLVM: [[INIT_START_FLD_PTR:%.*]] = getelementptr inbounds %"class.std::initializer_list", ptr [[INIT_STRUCT]], i32 0, i32 0, // LLVM: store ptr [[ELEM_ARRAY_PTR]], ptr [[INIT_START_FLD_PTR]], align 8, // LLVM: [[ELEM_ARRAY_END:%.*]] = getelementptr inbounds [2 x ptr], ptr [[ELEM_ARRAY_PTR]], i32 0, i32 2,