Lines Matching refs:F
42 static bool setDoesNotAccessMemory(Function &F) { in setDoesNotAccessMemory() argument
43 if (F.doesNotAccessMemory()) in setDoesNotAccessMemory()
45 F.setDoesNotAccessMemory(); in setDoesNotAccessMemory()
50 static bool setOnlyReadsMemory(Function &F) { in setOnlyReadsMemory() argument
51 if (F.onlyReadsMemory()) in setOnlyReadsMemory()
53 F.setOnlyReadsMemory(); in setOnlyReadsMemory()
58 static bool setOnlyAccessesArgMemory(Function &F) { in setOnlyAccessesArgMemory() argument
59 if (F.onlyAccessesArgMemory()) in setOnlyAccessesArgMemory()
61 F.setOnlyAccessesArgMemory (); in setOnlyAccessesArgMemory()
66 static bool setDoesNotThrow(Function &F) { in setDoesNotThrow() argument
67 if (F.doesNotThrow()) in setDoesNotThrow()
69 F.setDoesNotThrow(); in setDoesNotThrow()
74 static bool setDoesNotCapture(Function &F, unsigned n) { in setDoesNotCapture() argument
75 if (F.doesNotCapture(n)) in setDoesNotCapture()
77 F.setDoesNotCapture(n); in setDoesNotCapture()
82 static bool setOnlyReadsMemory(Function &F, unsigned n) { in setOnlyReadsMemory() argument
83 if (F.onlyReadsMemory(n)) in setOnlyReadsMemory()
85 F.setOnlyReadsMemory(n); in setOnlyReadsMemory()
90 static bool setDoesNotAlias(Function &F, unsigned n) { in setDoesNotAlias() argument
91 if (F.doesNotAlias(n)) in setDoesNotAlias()
93 F.setDoesNotAlias(n); in setDoesNotAlias()
98 static bool setNonNull(Function &F, unsigned n) { in setNonNull() argument
100 F.getReturnType()->isPointerTy()) && in setNonNull()
102 if (F.getAttributes().hasAttribute(n, Attribute::NonNull)) in setNonNull()
104 F.addAttribute(n, Attribute::NonNull); in setNonNull()
109 bool llvm::inferLibFuncAttributes(Function &F, const TargetLibraryInfo &TLI) { in inferLibFuncAttributes() argument
111 if (!(TLI.getLibFunc(F, TheLibFunc) && TLI.has(TheLibFunc))) in inferLibFuncAttributes()
117 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
118 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
119 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
123 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
124 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
133 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
134 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
135 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
143 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
144 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
145 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
148 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
149 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
150 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
151 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
160 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
161 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
162 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
163 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
167 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
168 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
169 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
173 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
174 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
175 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
178 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
179 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
180 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
184 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
185 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
189 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
190 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
191 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
192 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
196 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
197 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
198 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
199 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
202 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
203 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
204 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
205 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
206 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
209 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
210 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
211 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
212 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
215 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
216 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
217 Changed |= setDoesNotCapture(F, 3); in inferLibFuncAttributes()
218 Changed |= setOnlyReadsMemory(F, 3); in inferLibFuncAttributes()
221 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
222 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
223 Changed |= setDoesNotCapture(F, 3); in inferLibFuncAttributes()
224 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
228 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
229 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
232 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
233 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
236 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
237 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
238 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
239 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
243 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
244 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
249 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
250 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
255 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
256 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
257 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
260 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
263 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
266 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
267 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
268 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
271 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
272 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
275 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
276 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
277 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
281 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
284 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
285 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
290 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
291 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
292 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
295 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
296 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
297 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
298 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
299 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
302 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
303 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
304 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
305 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
309 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
310 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
313 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
314 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
315 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
316 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
319 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
320 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
321 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
322 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
325 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
326 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
329 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
330 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
334 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
335 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
336 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
341 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
342 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
348 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
349 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
350 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
353 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
354 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
355 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
358 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
359 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
360 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
361 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
362 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
363 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
366 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
367 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
368 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
369 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
385 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
386 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
389 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
390 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
391 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
399 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
400 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
403 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
404 Changed |= setDoesNotCapture(F, 3); in inferLibFuncAttributes()
407 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
408 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
409 Changed |= setDoesNotCapture(F, 4); in inferLibFuncAttributes()
412 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
413 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
414 Changed |= setDoesNotCapture(F, 4); in inferLibFuncAttributes()
418 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
419 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
420 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
421 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
425 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
426 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
427 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
428 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
431 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
432 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
433 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
438 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
439 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
442 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
443 Changed |= setOnlyReadsMemory(F); in inferLibFuncAttributes()
444 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
448 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
451 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
452 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
455 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
456 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
457 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
460 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
461 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
464 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
465 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
468 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
469 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
470 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
473 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
474 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
475 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
479 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
480 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
481 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
482 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
483 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
486 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
487 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
492 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
493 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
494 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
498 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
502 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
503 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
506 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
509 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
510 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
511 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
512 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
513 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
514 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
517 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
518 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
521 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
522 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
523 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
526 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
527 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
528 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
529 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
530 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
533 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
534 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
535 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
536 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
539 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
540 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
543 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
544 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
545 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
549 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
550 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
551 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
552 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
555 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
556 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
557 Changed |= setDoesNotCapture(F, 3); in inferLibFuncAttributes()
558 Changed |= setOnlyReadsMemory(F, 3); in inferLibFuncAttributes()
562 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
563 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
566 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
567 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
568 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
569 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
572 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
573 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
576 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
577 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
583 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
584 Changed |= setDoesNotAccessMemory(F); in inferLibFuncAttributes()
587 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
588 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
589 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
590 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
593 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
594 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
595 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
599 Changed |= setDoesNotCapture(F, 4); in inferLibFuncAttributes()
603 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
604 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
605 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
606 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
609 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
610 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
611 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
614 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
615 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
618 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
619 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
622 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
623 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
624 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
629 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
630 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
631 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
632 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
635 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
636 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
637 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
638 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
639 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
642 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
643 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
644 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
645 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
646 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
647 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
651 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
652 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
655 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
656 Changed |= setDoesNotAlias(F, 0); in inferLibFuncAttributes()
660 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
661 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
665 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
666 Changed |= setOnlyReadsMemory(F, 1); in inferLibFuncAttributes()
672 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
673 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
674 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
685 Changed |= setNonNull(F, AttributeSet::ReturnIndex); in inferLibFuncAttributes()
686 Changed |= setDoesNotAlias(F, AttributeSet::ReturnIndex); in inferLibFuncAttributes()
692 Changed |= setOnlyAccessesArgMemory(F); in inferLibFuncAttributes()
693 Changed |= setDoesNotCapture(F, 1); in inferLibFuncAttributes()
694 Changed |= setDoesNotCapture(F, 2); in inferLibFuncAttributes()
695 Changed |= setOnlyReadsMemory(F, 2); in inferLibFuncAttributes()
699 Changed |= setDoesNotAccessMemory(F); in inferLibFuncAttributes()
700 Changed |= setDoesNotThrow(F); in inferLibFuncAttributes()
728 if (const Function *F = dyn_cast<Function>(StrLen->stripPointerCasts())) in emitStrLen() local
729 CI->setCallingConv(F->getCallingConv()); in emitStrLen()
747 if (const Function *F = dyn_cast<Function>(StrChr->stripPointerCasts())) in emitStrChr() local
748 CI->setCallingConv(F->getCallingConv()); in emitStrChr()
766 if (const Function *F = dyn_cast<Function>(StrNCmp->stripPointerCasts())) in emitStrNCmp() local
767 CI->setCallingConv(F->getCallingConv()); in emitStrNCmp()
783 if (const Function *F = dyn_cast<Function>(StrCpy->stripPointerCasts())) in emitStrCpy() local
784 CI->setCallingConv(F->getCallingConv()); in emitStrCpy()
800 if (const Function *F = dyn_cast<Function>(StrNCpy->stripPointerCasts())) in emitStrNCpy() local
801 CI->setCallingConv(F->getCallingConv()); in emitStrNCpy()
823 if (const Function *F = dyn_cast<Function>(MemCpy->stripPointerCasts())) in emitMemCpyChk() local
824 CI->setCallingConv(F->getCallingConv()); in emitMemCpyChk()
841 if (const Function *F = dyn_cast<Function>(MemChr->stripPointerCasts())) in emitMemChr() local
842 CI->setCallingConv(F->getCallingConv()); in emitMemChr()
861 if (const Function *F = dyn_cast<Function>(MemCmp->stripPointerCasts())) in emitMemCmp() local
862 CI->setCallingConv(F->getCallingConv()); in emitMemCmp()
892 if (const Function *F = dyn_cast<Function>(Callee->stripPointerCasts())) in emitUnaryFloatFnCall() local
893 CI->setCallingConv(F->getCallingConv()); in emitUnaryFloatFnCall()
908 if (const Function *F = dyn_cast<Function>(Callee->stripPointerCasts())) in emitBinaryFloatFnCall() local
909 CI->setCallingConv(F->getCallingConv()); in emitBinaryFloatFnCall()
929 if (const Function *F = dyn_cast<Function>(PutChar->stripPointerCasts())) in emitPutChar() local
930 CI->setCallingConv(F->getCallingConv()); in emitPutChar()
944 if (const Function *F = dyn_cast<Function>(PutS->stripPointerCasts())) in emitPutS() local
945 CI->setCallingConv(F->getCallingConv()); in emitPutS()
955 Constant *F = M->getOrInsertFunction("fputc", B.getInt32Ty(), B.getInt32Ty(), in emitFPutC() local
961 CallInst *CI = B.CreateCall(F, {Char, File}, "fputc"); in emitFPutC()
963 if (const Function *Fn = dyn_cast<Function>(F->stripPointerCasts())) in emitFPutC()
975 Constant *F = M->getOrInsertFunction( in emitFPutS() local
979 CallInst *CI = B.CreateCall(F, {castToCStr(Str, B), File}, "fputs"); in emitFPutS()
981 if (const Function *Fn = dyn_cast<Function>(F->stripPointerCasts())) in emitFPutS()
994 Constant *F = M->getOrInsertFunction( in emitFWrite() local
1001 B.CreateCall(F, {castToCStr(Ptr, B), Size, in emitFWrite()
1004 if (const Function *Fn = dyn_cast<Function>(F->stripPointerCasts())) in emitFWrite()