@@ -76,7 +76,7 @@ static void addDereferenceableAttributeToBuilder(IRGenModule &IGM,
7676}
7777
7878static void addIndirectValueParameterAttributes (IRGenModule &IGM,
79- llvm::AttributeSet &attrs,
79+ llvm::AttributeList &attrs,
8080 const TypeInfo &ti,
8181 unsigned argIndex) {
8282 llvm::AttrBuilder b;
@@ -86,14 +86,13 @@ static void addIndirectValueParameterAttributes(IRGenModule &IGM,
8686 // The parameter must reference dereferenceable memory of the type.
8787 addDereferenceableAttributeToBuilder (IGM, b, ti);
8888
89- auto resultAttrs = llvm::AttributeSet ::get (IGM.LLVMContext , argIndex+ 1 , b);
89+ auto resultAttrs = llvm::AttributeList ::get (IGM.LLVMContext , argIndex + 1 , b);
9090 attrs = attrs.addAttributes (IGM.LLVMContext , argIndex+1 , resultAttrs);
9191}
9292
9393static void addInoutParameterAttributes (IRGenModule &IGM,
94- llvm::AttributeSet &attrs,
95- const TypeInfo &ti,
96- unsigned argIndex,
94+ llvm::AttributeList &attrs,
95+ const TypeInfo &ti, unsigned argIndex,
9796 bool aliasable) {
9897 llvm::AttrBuilder b;
9998 // Aliasing inouts is unspecified, but we still want aliasing to be memory-
@@ -103,7 +102,7 @@ static void addInoutParameterAttributes(IRGenModule &IGM,
103102 // The inout must reference dereferenceable memory of the type.
104103 addDereferenceableAttributeToBuilder (IGM, b, ti);
105104
106- auto resultAttrs = llvm::AttributeSet ::get (IGM.LLVMContext , argIndex+ 1 , b);
105+ auto resultAttrs = llvm::AttributeList ::get (IGM.LLVMContext , argIndex + 1 , b);
107106 attrs = attrs.addAttributes (IGM.LLVMContext , argIndex+1 , resultAttrs);
108107}
109108
@@ -133,9 +132,8 @@ llvm::CallingConv::ID irgen::expandCallingConv(IRGenModule &IGM,
133132}
134133
135134static void addIndirectResultAttributes (IRGenModule &IGM,
136- llvm::AttributeSet &attrs,
137- unsigned paramIndex,
138- bool allowSRet) {
135+ llvm::AttributeList &attrs,
136+ unsigned paramIndex, bool allowSRet) {
139137 static const llvm::Attribute::AttrKind attrKindsWithSRet[] = {
140138 llvm::Attribute::StructRet,
141139 llvm::Attribute::NoAlias,
@@ -145,26 +143,26 @@ static void addIndirectResultAttributes(IRGenModule &IGM,
145143 llvm::Attribute::NoAlias,
146144 llvm::Attribute::NoCapture,
147145 };
148- auto resultAttrs =
149- llvm::AttributeSet::get ( IGM.LLVMContext , paramIndex + 1 ,
150- (allowSRet ? makeArrayRef (attrKindsWithSRet)
151- : makeArrayRef (attrKindsWithoutSRet)));
146+ auto resultAttrs = llvm::AttributeList::get (
147+ IGM.LLVMContext , paramIndex + 1 ,
148+ (allowSRet ? makeArrayRef (attrKindsWithSRet)
149+ : makeArrayRef (attrKindsWithoutSRet)));
152150 attrs = attrs.addAttributes (IGM.LLVMContext , paramIndex + 1 , resultAttrs);
153151}
154152
155- void IRGenModule::addSwiftSelfAttributes (llvm::AttributeSet &attrs,
153+ void IRGenModule::addSwiftSelfAttributes (llvm::AttributeList &attrs,
156154 unsigned argIndex) {
157155 if (!UseSwiftCC)
158156 return ;
159157 static const llvm::Attribute::AttrKind attrKinds[] = {
160158 llvm::Attribute::SwiftSelf,
161159 };
162160 auto argAttrs =
163- llvm::AttributeSet ::get (this ->LLVMContext , argIndex + 1 , attrKinds);
161+ llvm::AttributeList ::get (this ->LLVMContext , argIndex + 1 , attrKinds);
164162 attrs = attrs.addAttributes (this ->LLVMContext , argIndex + 1 , argAttrs);
165163}
166164
167- void IRGenModule::addSwiftErrorAttributes (llvm::AttributeSet &attrs,
165+ void IRGenModule::addSwiftErrorAttributes (llvm::AttributeList &attrs,
168166 unsigned argIndex) {
169167 // Don't add the swifterror attribute on ABI that don't pass it in a register.
170168 // We create a shadow stack location of the swifterror parameter for the
@@ -177,33 +175,31 @@ void IRGenModule::addSwiftErrorAttributes(llvm::AttributeSet &attrs,
177175 llvm::Attribute::SwiftError,
178176 };
179177 auto argAttrs =
180- llvm::AttributeSet ::get (this ->LLVMContext , argIndex + 1 , attrKinds);
178+ llvm::AttributeList ::get (this ->LLVMContext , argIndex + 1 , attrKinds);
181179 attrs = attrs.addAttributes (this ->LLVMContext , argIndex + 1 , argAttrs);
182180}
183181
184182void irgen::addByvalArgumentAttributes (IRGenModule &IGM,
185- llvm::AttributeSet &attrs,
186- unsigned argIndex,
187- Alignment align) {
183+ llvm::AttributeList &attrs,
184+ unsigned argIndex, Alignment align) {
188185 llvm::AttrBuilder b;
189186 b.addAttribute (llvm::Attribute::ByVal);
190187 b.addAttribute (llvm::Attribute::getWithAlignment (IGM.LLVMContext ,
191188 align.getValue ()));
192- auto resultAttrs = llvm::AttributeSet ::get (IGM.LLVMContext , argIndex+ 1 , b);
189+ auto resultAttrs = llvm::AttributeList ::get (IGM.LLVMContext , argIndex + 1 , b);
193190 attrs = attrs.addAttributes (IGM.LLVMContext ,
194191 argIndex+1 ,
195192 resultAttrs);
196193}
197194
198- void irgen::addExtendAttribute (IRGenModule &IGM,
199- llvm::AttributeSet &attrs,
195+ void irgen::addExtendAttribute (IRGenModule &IGM, llvm::AttributeList &attrs,
200196 unsigned index, bool signExtend) {
201197 llvm::AttrBuilder b;
202198 if (signExtend)
203199 b.addAttribute (llvm::Attribute::SExt);
204200 else
205201 b.addAttribute (llvm::Attribute::ZExt);
206- auto resultAttrs = llvm::AttributeSet ::get (IGM.LLVMContext , index, b);
202+ auto resultAttrs = llvm::AttributeList ::get (IGM.LLVMContext , index, b);
207203 attrs = attrs.addAttributes (IGM.LLVMContext , index, resultAttrs);
208204}
209205
@@ -213,7 +209,7 @@ namespace {
213209 CanSILFunctionType FnType;
214210 public:
215211 SmallVector<llvm::Type*, 8 > ParamIRTypes;
216- llvm::AttributeSet Attrs;
212+ llvm::AttributeList Attrs;
217213 ForeignFunctionInfo ForeignInfo;
218214 bool CanUseSRet = true ;
219215 bool CanUseError = true ;
@@ -902,7 +898,7 @@ llvm::Type *SignatureExpansion::expandExternalSignatureTypes() {
902898 bool signExt = clangResultTy->hasSignedIntegerRepresentation ();
903899 assert ((signExt || clangResultTy->hasUnsignedIntegerRepresentation ()) &&
904900 " Invalid attempt to add extension attribute to argument!" );
905- addExtendAttribute (IGM, Attrs, llvm::AttributeSet ::ReturnIndex, signExt);
901+ addExtendAttribute (IGM, Attrs, llvm::AttributeList ::ReturnIndex, signExt);
906902 }
907903
908904 // If we return indirectly, that is the first parameter type.
@@ -1305,8 +1301,8 @@ void CallEmission::emitToUnmappedMemory(Address result) {
13051301// FIXME: This doesn't belong on IGF.
13061302llvm::CallSite CallEmission::emitInvoke (llvm::CallingConv::ID convention,
13071303 llvm::Value *fn,
1308- ArrayRef<llvm::Value*> args,
1309- const llvm::AttributeSet &attrs) {
1304+ ArrayRef<llvm::Value *> args,
1305+ const llvm::AttributeList &attrs) {
13101306 // TODO: exceptions!
13111307 llvm::CallInst *call = IGF.Builder .CreateCall (fn, args);
13121308 call->setAttributes (attrs);
@@ -1339,9 +1335,8 @@ llvm::CallSite CallEmission::emitCallSite() {
13391335 Args[i] = IGF.coerceValue (Args[i], paramTy, IGF.IGM .DataLayout );
13401336 }
13411337
1342- llvm::CallSite call = emitInvoke (cc, fnPtr, Args,
1343- llvm::AttributeSet::get (fnPtr->getContext (),
1344- Attrs));
1338+ llvm::CallSite call = emitInvoke (
1339+ cc, fnPtr, Args, llvm::AttributeList::get (fnPtr->getContext (), Attrs));
13451340 Args.clear ();
13461341
13471342 // Return.
0 commit comments