@@ -47,9 +47,7 @@ Value *llvm::EmitStrLen(Value *Ptr, IRBuilder<> &B, const DataLayout *TD,
47
47
ArrayRef<Attributes::AttrVal>(AVs, 2 ));
48
48
49
49
LLVMContext &Context = B.GetInsertBlock ()->getContext ();
50
- Constant *StrLen = M->getOrInsertFunction (" strlen" ,
51
- AttrListPtr::get (M->getContext (),
52
- AWI),
50
+ Constant *StrLen = M->getOrInsertFunction (" strlen" , AttrListPtr::get (AWI),
53
51
TD->getIntPtrType (Context),
54
52
B.getInt8PtrTy (),
55
53
NULL );
@@ -76,9 +74,7 @@ Value *llvm::EmitStrNLen(Value *Ptr, Value *MaxLen, IRBuilder<> &B,
76
74
ArrayRef<Attributes::AttrVal>(AVs, 2 ));
77
75
78
76
LLVMContext &Context = B.GetInsertBlock ()->getContext ();
79
- Constant *StrNLen = M->getOrInsertFunction (" strnlen" ,
80
- AttrListPtr::get (M->getContext (),
81
- AWI),
77
+ Constant *StrNLen = M->getOrInsertFunction (" strnlen" , AttrListPtr::get (AWI),
82
78
TD->getIntPtrType (Context),
83
79
B.getInt8PtrTy (),
84
80
TD->getIntPtrType (Context),
@@ -106,9 +102,7 @@ Value *llvm::EmitStrChr(Value *Ptr, char C, IRBuilder<> &B,
106
102
107
103
Type *I8Ptr = B.getInt8PtrTy ();
108
104
Type *I32Ty = B.getInt32Ty ();
109
- Constant *StrChr = M->getOrInsertFunction (" strchr" ,
110
- AttrListPtr::get (M->getContext (),
111
- AWI),
105
+ Constant *StrChr = M->getOrInsertFunction (" strchr" , AttrListPtr::get (AWI),
112
106
I8Ptr, I8Ptr, I32Ty, NULL );
113
107
CallInst *CI = B.CreateCall2 (StrChr, CastToCStr (Ptr, B),
114
108
ConstantInt::get (I32Ty, C), " strchr" );
@@ -133,9 +127,7 @@ Value *llvm::EmitStrNCmp(Value *Ptr1, Value *Ptr2, Value *Len,
133
127
ArrayRef<Attributes::AttrVal>(AVs, 2 ));
134
128
135
129
LLVMContext &Context = B.GetInsertBlock ()->getContext ();
136
- Value *StrNCmp = M->getOrInsertFunction (" strncmp" ,
137
- AttrListPtr::get (M->getContext (),
138
- AWI),
130
+ Value *StrNCmp = M->getOrInsertFunction (" strncmp" , AttrListPtr::get (AWI),
139
131
B.getInt32Ty (),
140
132
B.getInt8PtrTy (),
141
133
B.getInt8PtrTy (),
@@ -163,8 +155,7 @@ Value *llvm::EmitStrCpy(Value *Dst, Value *Src, IRBuilder<> &B,
163
155
AWI[1 ] = AttributeWithIndex::get (M->getContext (), AttrListPtr::FunctionIndex,
164
156
Attributes::NoUnwind);
165
157
Type *I8Ptr = B.getInt8PtrTy ();
166
- Value *StrCpy = M->getOrInsertFunction (Name,
167
- AttrListPtr::get (M->getContext (), AWI),
158
+ Value *StrCpy = M->getOrInsertFunction (Name, AttrListPtr::get (AWI),
168
159
I8Ptr, I8Ptr, I8Ptr, NULL );
169
160
CallInst *CI = B.CreateCall2 (StrCpy, CastToCStr (Dst, B), CastToCStr (Src, B),
170
161
Name);
@@ -187,9 +178,7 @@ Value *llvm::EmitStrNCpy(Value *Dst, Value *Src, Value *Len,
187
178
AWI[1 ] = AttributeWithIndex::get (M->getContext (), AttrListPtr::FunctionIndex,
188
179
Attributes::NoUnwind);
189
180
Type *I8Ptr = B.getInt8PtrTy ();
190
- Value *StrNCpy = M->getOrInsertFunction (Name,
191
- AttrListPtr::get (M->getContext (),
192
- AWI),
181
+ Value *StrNCpy = M->getOrInsertFunction (Name, AttrListPtr::get (AWI),
193
182
I8Ptr, I8Ptr, I8Ptr,
194
183
Len->getType (), NULL );
195
184
CallInst *CI = B.CreateCall3 (StrNCpy, CastToCStr (Dst, B), CastToCStr (Src, B),
@@ -214,7 +203,7 @@ Value *llvm::EmitMemCpyChk(Value *Dst, Value *Src, Value *Len, Value *ObjSize,
214
203
Attributes::NoUnwind);
215
204
LLVMContext &Context = B.GetInsertBlock ()->getContext ();
216
205
Value *MemCpy = M->getOrInsertFunction (" __memcpy_chk" ,
217
- AttrListPtr::get (M-> getContext (), AWI),
206
+ AttrListPtr::get (AWI),
218
207
B.getInt8PtrTy (),
219
208
B.getInt8PtrTy (),
220
209
B.getInt8PtrTy (),
@@ -242,8 +231,7 @@ Value *llvm::EmitMemChr(Value *Ptr, Value *Val,
242
231
AWI = AttributeWithIndex::get (M->getContext (), AttrListPtr::FunctionIndex,
243
232
ArrayRef<Attributes::AttrVal>(AVs, 2 ));
244
233
LLVMContext &Context = B.GetInsertBlock ()->getContext ();
245
- Value *MemChr = M->getOrInsertFunction (" memchr" ,
246
- AttrListPtr::get (M->getContext (), AWI),
234
+ Value *MemChr = M->getOrInsertFunction (" memchr" , AttrListPtr::get (AWI),
247
235
B.getInt8PtrTy (),
248
236
B.getInt8PtrTy (),
249
237
B.getInt32Ty (),
@@ -273,8 +261,7 @@ Value *llvm::EmitMemCmp(Value *Ptr1, Value *Ptr2,
273
261
ArrayRef<Attributes::AttrVal>(AVs, 2 ));
274
262
275
263
LLVMContext &Context = B.GetInsertBlock ()->getContext ();
276
- Value *MemCmp = M->getOrInsertFunction (" memcmp" ,
277
- AttrListPtr::get (M->getContext (), AWI),
264
+ Value *MemCmp = M->getOrInsertFunction (" memcmp" , AttrListPtr::get (AWI),
278
265
B.getInt32Ty (),
279
266
B.getInt8PtrTy (),
280
267
B.getInt8PtrTy (),
@@ -351,8 +338,7 @@ Value *llvm::EmitPutS(Value *Str, IRBuilder<> &B, const DataLayout *TD,
351
338
AWI[1 ] = AttributeWithIndex::get (M->getContext (), AttrListPtr::FunctionIndex,
352
339
Attributes::NoUnwind);
353
340
354
- Value *PutS = M->getOrInsertFunction (" puts" ,
355
- AttrListPtr::get (M->getContext (), AWI),
341
+ Value *PutS = M->getOrInsertFunction (" puts" , AttrListPtr::get (AWI),
356
342
B.getInt32Ty (),
357
343
B.getInt8PtrTy (),
358
344
NULL );
@@ -376,8 +362,7 @@ Value *llvm::EmitFPutC(Value *Char, Value *File, IRBuilder<> &B,
376
362
Attributes::NoUnwind);
377
363
Constant *F;
378
364
if (File->getType ()->isPointerTy ())
379
- F = M->getOrInsertFunction (" fputc" ,
380
- AttrListPtr::get (M->getContext (), AWI),
365
+ F = M->getOrInsertFunction (" fputc" , AttrListPtr::get (AWI),
381
366
B.getInt32Ty (),
382
367
B.getInt32Ty (), File->getType (),
383
368
NULL );
@@ -411,8 +396,7 @@ Value *llvm::EmitFPutS(Value *Str, Value *File, IRBuilder<> &B,
411
396
StringRef FPutsName = TLI->getName (LibFunc::fputs);
412
397
Constant *F;
413
398
if (File->getType ()->isPointerTy ())
414
- F = M->getOrInsertFunction (FPutsName,
415
- AttrListPtr::get (M->getContext (), AWI),
399
+ F = M->getOrInsertFunction (FPutsName, AttrListPtr::get (AWI),
416
400
B.getInt32Ty (),
417
401
B.getInt8PtrTy (),
418
402
File->getType (), NULL );
@@ -445,8 +429,7 @@ Value *llvm::EmitFWrite(Value *Ptr, Value *Size, Value *File,
445
429
StringRef FWriteName = TLI->getName (LibFunc::fwrite);
446
430
Constant *F;
447
431
if (File->getType ()->isPointerTy ())
448
- F = M->getOrInsertFunction (FWriteName,
449
- AttrListPtr::get (M->getContext (), AWI),
432
+ F = M->getOrInsertFunction (FWriteName, AttrListPtr::get (AWI),
450
433
TD->getIntPtrType (Context),
451
434
B.getInt8PtrTy (),
452
435
TD->getIntPtrType (Context),
0 commit comments