diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp --- a/clang/lib/CodeGen/CGBlocks.cpp +++ b/clang/lib/CodeGen/CGBlocks.cpp @@ -1261,7 +1261,7 @@ auto &byrefInfo = getBlockByrefInfo(variable); addr = Address(Builder.CreateLoad(addr), Int8Ty, byrefInfo.ByrefAlignment); - addr = Builder.CreateElementBitCast(addr, byrefInfo.Type, "byref.addr"); + addr = Builder.CreateElementBitCast(addr, byrefInfo.Type); addr = emitBlockByrefAddress(addr, byrefInfo, /*follow*/ true, variable->getName()); @@ -1936,13 +1936,12 @@ Address src = GetAddrOfLocalVar(&SrcDecl); src = Address(Builder.CreateLoad(src), Int8Ty, blockInfo.BlockAlign); - src = Builder.CreateElementBitCast(src, blockInfo.StructureType, - "block.source"); + src = Builder.CreateElementBitCast(src, blockInfo.StructureType); Address dst = GetAddrOfLocalVar(&DstDecl); dst = Address(Builder.CreateLoad(dst), Int8Ty, blockInfo.BlockAlign); dst = - Builder.CreateElementBitCast(dst, blockInfo.StructureType, "block.dest"); + Builder.CreateElementBitCast(dst, blockInfo.StructureType); for (auto &capture : blockInfo.SortedCaptures) { if (capture.isConstantOrTrivial()) @@ -2126,7 +2125,7 @@ Address src = GetAddrOfLocalVar(&SrcDecl); src = Address(Builder.CreateLoad(src), Int8Ty, blockInfo.BlockAlign); - src = Builder.CreateElementBitCast(src, blockInfo.StructureType, "block"); + src = Builder.CreateElementBitCast(src, blockInfo.StructureType); CodeGenFunction::RunCleanupsScope cleanups(*this); diff --git a/clang/lib/CodeGen/CGBuilder.h b/clang/lib/CodeGen/CGBuilder.h --- a/clang/lib/CodeGen/CGBuilder.h +++ b/clang/lib/CodeGen/CGBuilder.h @@ -166,8 +166,7 @@ /// Cast the element type of the given address to a different type, /// preserving information like the alignment and address space. - Address CreateElementBitCast(Address Addr, llvm::Type *Ty, - const llvm::Twine &Name = "") { + Address CreateElementBitCast(Address Addr, llvm::Type *Ty) { return Address(Addr.getPointer(), Ty, Addr.getAlignment(), Addr.isKnownNonNull()); } diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp --- a/clang/lib/CodeGen/CGBuiltin.cpp +++ b/clang/lib/CodeGen/CGBuiltin.cpp @@ -1860,7 +1860,7 @@ Address Arg = GetAddrOfLocalVar(Args[I]); Address Addr = Builder.CreateConstByteGEP(BufAddr, Offset, "argData"); Addr = - Builder.CreateElementBitCast(Addr, Arg.getElementType(), "argDataCast"); + Builder.CreateElementBitCast(Addr, Arg.getElementType()); Builder.CreateStore(Builder.CreateLoad(Arg), Addr); Offset += Size; ++I; diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -1792,7 +1792,7 @@ SizeVal = Builder.CreateNUWMul(SizeVal, CGM.getSize(EltSize)); llvm::Value *BaseSizeInChars = llvm::ConstantInt::get(IntPtrTy, EltSize.getQuantity()); - Address Begin = Builder.CreateElementBitCast(Loc, Int8Ty, "vla.begin"); + Address Begin = Builder.CreateElementBitCast(Loc, Int8Ty); llvm::Value *End = Builder.CreateInBoundsGEP( Begin.getElementType(), Begin.getPointer(), SizeVal, "vla.end"); llvm::BasicBlock *OriginBB = Builder.GetInsertBlock(); @@ -2486,8 +2486,7 @@ if (Arg.isIndirect()) { // If we have a prettier pointer type at this point, bitcast to that. DeclPtr = Arg.getIndirectAddress(); - DeclPtr = Builder.CreateElementBitCast(DeclPtr, ConvertTypeForMem(Ty), - D.getName()); + DeclPtr = Builder.CreateElementBitCast(DeclPtr, ConvertTypeForMem(Ty)); // Indirect argument is in alloca address space, which may be different // from the default address space. auto AllocaAS = CGM.getASTAllocaAddressSpace(); diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -1756,7 +1756,7 @@ // Bitcast to vec4 type. llvm::VectorType *vec4Ty = llvm::FixedVectorType::get(VTy->getElementType(), 4); - Address Cast = Builder.CreateElementBitCast(Addr, vec4Ty, "castToVec4"); + Address Cast = Builder.CreateElementBitCast(Addr, vec4Ty); // Now load value. llvm::Value *V = Builder.CreateLoad(Cast, Volatile, "loadVec4"); @@ -1896,7 +1896,7 @@ SrcTy = llvm::FixedVectorType::get(VecTy->getElementType(), 4); } if (Addr.getElementType() != SrcTy) { - Addr = Builder.CreateElementBitCast(Addr, SrcTy, "storetmp"); + Addr = Builder.CreateElementBitCast(Addr, SrcTy); } } } @@ -2079,8 +2079,7 @@ llvm::Type *VectorElementTy = CGM.getTypes().ConvertType(EQT); Address CastToPointerElement = - Builder.CreateElementBitCast(VectorAddress, VectorElementTy, - "conv.ptr.element"); + Builder.CreateElementBitCast(VectorAddress, VectorElementTy); const llvm::Constant *Elts = LV.getExtVectorElts(); unsigned ix = getAccessedFieldNo(0, Elts); @@ -4500,7 +4499,7 @@ if (FieldType->isReferenceType()) addr = Builder.CreateElementBitCast( - addr, CGM.getTypes().ConvertTypeForMem(FieldType), field->getName()); + addr, CGM.getTypes().ConvertTypeForMem(FieldType)); } else { if (!IsInPreservedAIRegion && (!getDebugInfo() || !rec->hasAttr())) @@ -4529,7 +4528,7 @@ // will need a bitcast if the LLVM type laid out doesn't match the desired // type. addr = Builder.CreateElementBitCast( - addr, CGM.getTypes().ConvertTypeForMem(FieldType), field->getName()); + addr, CGM.getTypes().ConvertTypeForMem(FieldType)); if (field->hasAttr()) addr = EmitFieldAnnotations(field, addr); @@ -4556,7 +4555,7 @@ // Make sure that the address is pointing to the right type. llvm::Type *llvmType = ConvertTypeForMem(FieldType); - V = Builder.CreateElementBitCast(V, llvmType, Field->getName()); + V = Builder.CreateElementBitCast(V, llvmType); // TODO: Generate TBAA information that describes this access as a structure // member access and not just an access to an object of the field's type. This diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -2177,8 +2177,7 @@ Address Addr = CGF.CreateDefaultAlignTempAlloca(SrcTy, "saved-value"); LValue LV = CGF.MakeAddrLValue(Addr, E->getType()); CGF.EmitStoreOfScalar(Src, LV); - Addr = Builder.CreateElementBitCast(Addr, CGF.ConvertTypeForMem(DestTy), - "castFixedSve"); + Addr = Builder.CreateElementBitCast(Addr, CGF.ConvertTypeForMem(DestTy)); LValue DestLV = CGF.MakeAddrLValue(Addr, DestTy); DestLV.setTBAAInfo(TBAAAccessInfo::getMayAliasInfo()); return EmitLoadOfLValue(DestLV, CE->getExprLoc()); diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -1268,8 +1268,7 @@ RedCG.getSharedLValue(Count).getAddress(*this)); PrivateScope.addPrivate(RHSVD, Builder.CreateElementBitCast( GetAddrOfLocalVar(PrivateVD), - ConvertTypeForMem(RHSVD->getType()), - "rhs.begin")); + ConvertTypeForMem(RHSVD->getType()))); } else { QualType Type = PrivateVD->getType(); bool IsArray = getContext().getAsArrayType(Type) != nullptr; @@ -1278,13 +1277,13 @@ // implicit variable. if (IsArray) { OriginalAddr = Builder.CreateElementBitCast( - OriginalAddr, ConvertTypeForMem(LHSVD->getType()), "lhs.begin"); + OriginalAddr, ConvertTypeForMem(LHSVD->getType())); } PrivateScope.addPrivate(LHSVD, OriginalAddr); PrivateScope.addPrivate( RHSVD, IsArray ? Builder.CreateElementBitCast( GetAddrOfLocalVar(PrivateVD), - ConvertTypeForMem(RHSVD->getType()), "rhs.begin") + ConvertTypeForMem(RHSVD->getType())) : GetAddrOfLocalVar(PrivateVD)); } ++ILHS; diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -1936,7 +1936,7 @@ = llvm::ConstantInt::get(CGF.IntPtrTy, baseSize.getQuantity()); Address begin = - Builder.CreateElementBitCast(dest, CGF.Int8Ty, "vla.begin"); + Builder.CreateElementBitCast(dest, CGF.Int8Ty); llvm::Value *end = Builder.CreateInBoundsGEP( begin.getElementType(), begin.getPointer(), sizeInChars, "vla.end"); @@ -2142,7 +2142,7 @@ } llvm::Type *baseType = ConvertType(eltType); - addr = Builder.CreateElementBitCast(addr, baseType, "array.begin"); + addr = Builder.CreateElementBitCast(addr, baseType); } else { // Create the actual GEP. addr = Address(Builder.CreateInBoundsGEP( diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp --- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp +++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp @@ -1279,7 +1279,7 @@ void MicrosoftCXXABI::EmitVBPtrStores(CodeGenFunction &CGF, const CXXRecordDecl *RD) { Address This = getThisAddress(CGF); - This = CGF.Builder.CreateElementBitCast(This, CGM.Int8Ty, "this.int8"); + This = CGF.Builder.CreateElementBitCast(This, CGM.Int8Ty); const ASTContext &Context = getContext(); const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD); @@ -1296,8 +1296,7 @@ Address VBPtr = CGF.Builder.CreateConstInBoundsByteGEP(This, Offs); llvm::Value *GVPtr = CGF.Builder.CreateConstInBoundsGEP2_32(GV->getValueType(), GV, 0, 0); - VBPtr = CGF.Builder.CreateElementBitCast(VBPtr, GVPtr->getType(), - "vbptr." + VBT->ObjectWithVPtr->getName()); + VBPtr = CGF.Builder.CreateElementBitCast(VBPtr, GVPtr->getType()); CGF.Builder.CreateStore(GVPtr, VBPtr); } } diff --git a/clang/lib/CodeGen/TargetInfo.cpp b/clang/lib/CodeGen/TargetInfo.cpp --- a/clang/lib/CodeGen/TargetInfo.cpp +++ b/clang/lib/CodeGen/TargetInfo.cpp @@ -7668,7 +7668,7 @@ Address(CGF.Builder.CreateLoad(OverflowArgAreaPtr, "overflow_arg_area"), CGF.Int8Ty, TyInfo.Align); Address MemAddr = - CGF.Builder.CreateElementBitCast(OverflowArgArea, DirectTy, "mem_addr"); + CGF.Builder.CreateElementBitCast(OverflowArgArea, DirectTy); // Update overflow_arg_area_ptr pointer llvm::Value *NewOverflowArgArea = CGF.Builder.CreateGEP( @@ -7726,7 +7726,7 @@ CGF.Builder.CreateGEP(CGF.Int8Ty, RegSaveArea, RegOffset, "raw_reg_addr"), CGF.Int8Ty, PaddedSize); Address RegAddr = - CGF.Builder.CreateElementBitCast(RawRegAddr, DirectTy, "reg_addr"); + CGF.Builder.CreateElementBitCast(RawRegAddr, DirectTy); // Update the register count llvm::Value *One = llvm::ConstantInt::get(IndexTy, 1); @@ -7747,7 +7747,7 @@ Address RawMemAddr = CGF.Builder.CreateConstByteGEP(OverflowArgArea, Padding, "raw_mem_addr"); Address MemAddr = - CGF.Builder.CreateElementBitCast(RawMemAddr, DirectTy, "mem_addr"); + CGF.Builder.CreateElementBitCast(RawMemAddr, DirectTy); // Update overflow_arg_area_ptr pointer llvm::Value *NewOverflowArgArea = @@ -8856,7 +8856,7 @@ // FIXME: Need to handle alignment llvm::Type *BP = CGF.Int8PtrTy; CGBuilderTy &Builder = CGF.Builder; - Address VAListAddrAsBPP = Builder.CreateElementBitCast(VAListAddr, BP, "ap"); + Address VAListAddrAsBPP = Builder.CreateElementBitCast(VAListAddr, BP); llvm::Value *Addr = Builder.CreateLoad(VAListAddrAsBPP, "ap.cur"); // Handle address alignment for type alignment > 32 bits uint64_t TyAlign = CGF.getContext().getTypeAlign(Ty) / 8; @@ -9981,7 +9981,7 @@ case ABIArgInfo::Indirect: case ABIArgInfo::IndirectAliased: Stride = SlotSize; - ArgAddr = Builder.CreateElementBitCast(Addr, ArgPtrTy, "indirect"); + ArgAddr = Builder.CreateElementBitCast(Addr, ArgPtrTy); ArgAddr = Address(Builder.CreateLoad(ArgAddr, "indirect.arg"), ArgTy, TypeInfo.Align); break; @@ -9994,7 +9994,7 @@ Address NextPtr = Builder.CreateConstInBoundsByteGEP(Addr, Stride, "ap.next"); Builder.CreateStore(NextPtr.getPointer(), VAListAddr); - return Builder.CreateElementBitCast(ArgAddr, ArgTy, "arg.addr"); + return Builder.CreateElementBitCast(ArgAddr, ArgTy); } void SparcV9ABIInfo::computeInfo(CGFunctionInfo &FI) const {