1 //===-- TargetLibraryInfo.h - Library information ---------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_ANALYSIS_TARGETLIBRARYINFO_H
11 #define LLVM_ANALYSIS_TARGETLIBRARYINFO_H
13 #include "llvm/ADT/DenseMap.h"
14 #include "llvm/ADT/Optional.h"
15 #include "llvm/ADT/Triple.h"
16 #include "llvm/IR/Function.h"
17 #include "llvm/IR/Module.h"
18 #include "llvm/Pass.h"
20 // BEGIN ANDROID-SPECIFIC
29 // END ANDROID-SPECIFIC
32 class PreservedAnalyses;
36 /// int _IO_getc(_IO_FILE * __fp);
38 /// int _IO_putc(int __c, _IO_FILE * __fp);
40 /// void operator delete[](void*);
42 /// void operator delete[](void*, nothrow);
44 /// void operator delete[](void*, unsigned int);
46 /// void operator delete[](void*, unsigned long);
48 /// void operator delete(void*);
50 /// void operator delete(void*, nothrow);
52 /// void operator delete(void*, unsigned int);
54 /// void operator delete(void*, unsigned long);
56 /// void *new[](unsigned int);
58 /// void *new[](unsigned int, nothrow);
60 /// void *new[](unsigned long);
62 /// void *new[](unsigned long, nothrow);
64 /// void *new(unsigned int);
66 /// void *new(unsigned int, nothrow);
68 /// void *new(unsigned long);
70 /// void *new(unsigned long, nothrow);
72 /// double __cospi(double x);
74 /// float __cospif(float x);
76 /// int __cxa_atexit(void (*f)(void *), void *p, void *d);
78 /// void __cxa_guard_abort(guard_t *guard);
79 /// guard_t is int64_t in Itanium ABI or int32_t on ARM eabi.
81 /// int __cxa_guard_acquire(guard_t *guard);
83 /// void __cxa_guard_release(guard_t *guard);
85 /// int __isoc99_scanf (const char *format, ...)
87 /// int __isoc99_sscanf(const char *s, const char *format, ...)
89 /// void *__memcpy_chk(void *s1, const void *s2, size_t n, size_t s1size);
91 /// void *__memmove_chk(void *s1, const void *s2, size_t n,
94 /// void *__memset_chk(void *s, char v, size_t n, size_t s1size);
96 /// double __sincospi_stret(double x);
98 /// float __sincospif_stret(float x);
100 /// double __sinpi(double x);
102 /// float __sinpif(float x);
104 /// double __sqrt_finite(double x);
106 /// float __sqrt_finite(float x);
108 /// long double __sqrt_finite(long double x);
110 /// char *__stpcpy_chk(char *s1, const char *s2, size_t s1size);
112 /// char *__stpncpy_chk(char *s1, const char *s2, size_t n,
115 /// char *__strcpy_chk(char *s1, const char *s2, size_t s1size);
117 /// char * __strdup(const char *s);
119 /// char *__strncpy_chk(char *s1, const char *s2, size_t n,
122 /// char *__strndup(const char *s, size_t n);
124 /// char * __strtok_r(char *s, const char *delim, char **save_ptr);
128 /// int access(const char *path, int amode);
130 /// double acos(double x);
132 /// float acosf(float x);
134 /// double acosh(double x);
136 /// float acoshf(float x);
138 /// long double acoshl(long double x);
140 /// long double acosl(long double x);
142 /// double asin(double x);
144 /// float asinf(float x);
146 /// double asinh(double x);
148 /// float asinhf(float x);
150 /// long double asinhl(long double x);
152 /// long double asinl(long double x);
154 /// double atan(double x);
156 /// double atan2(double y, double x);
158 /// float atan2f(float y, float x);
160 /// long double atan2l(long double y, long double x);
162 /// float atanf(float x);
164 /// double atanh(double x);
166 /// float atanhf(float x);
168 /// long double atanhl(long double x);
170 /// long double atanl(long double x);
172 /// double atof(const char *str);
174 /// int atoi(const char *str);
176 /// long atol(const char *str);
178 /// long long atoll(const char *nptr);
180 /// int bcmp(const void *s1, const void *s2, size_t n);
182 /// void bcopy(const void *s1, void *s2, size_t n);
184 /// void bzero(void *s, size_t n);
186 /// void *calloc(size_t count, size_t size);
188 /// double cbrt(double x);
190 /// float cbrtf(float x);
192 /// long double cbrtl(long double x);
194 /// double ceil(double x);
196 /// float ceilf(float x);
198 /// long double ceill(long double x);
200 /// int chmod(const char *path, mode_t mode);
202 /// int chown(const char *path, uid_t owner, gid_t group);
204 /// void clearerr(FILE *stream);
206 /// int closedir(DIR *dirp);
208 /// double copysign(double x, double y);
210 /// float copysignf(float x, float y);
212 /// long double copysignl(long double x, long double y);
214 /// double cos(double x);
216 /// float cosf(float x);
218 /// double cosh(double x);
220 /// float coshf(float x);
222 /// long double coshl(long double x);
224 /// long double cosl(long double x);
226 /// char *ctermid(char *s);
228 /// double exp(double x);
230 /// double exp10(double x);
232 /// float exp10f(float x);
234 /// long double exp10l(long double x);
236 /// double exp2(double x);
238 /// float exp2f(float x);
240 /// long double exp2l(long double x);
242 /// float expf(float x);
244 /// long double expl(long double x);
246 /// double expm1(double x);
248 /// float expm1f(float x);
250 /// long double expm1l(long double x);
252 /// double fabs(double x);
254 /// float fabsf(float x);
256 /// long double fabsl(long double x);
258 /// int fclose(FILE *stream);
260 /// FILE *fdopen(int fildes, const char *mode);
262 /// int feof(FILE *stream);
264 /// int ferror(FILE *stream);
266 /// int fflush(FILE *stream);
270 /// int ffsl(long int i);
272 /// int ffsll(long long int i);
274 /// int fgetc(FILE *stream);
276 /// int fgetpos(FILE *stream, fpos_t *pos);
278 /// char *fgets(char *s, int n, FILE *stream);
280 /// int fileno(FILE *stream);
282 /// int fiprintf(FILE *stream, const char *format, ...);
284 /// void flockfile(FILE *file);
286 /// double floor(double x);
288 /// float floorf(float x);
290 /// long double floorl(long double x);
292 /// double fmax(double x, double y);
294 /// float fmaxf(float x, float y);
296 /// long double fmaxl(long double x, long double y);
298 /// double fmin(double x, double y);
300 /// float fminf(float x, float y);
302 /// long double fminl(long double x, long double y);
304 /// double fmod(double x, double y);
306 /// float fmodf(float x, float y);
308 /// long double fmodl(long double x, long double y);
310 /// FILE *fopen(const char *filename, const char *mode);
312 /// FILE *fopen64(const char *filename, const char *opentype)
314 /// int fprintf(FILE *stream, const char *format, ...);
316 /// int fputc(int c, FILE *stream);
318 /// int fputs(const char *s, FILE *stream);
320 /// size_t fread(void *ptr, size_t size, size_t nitems, FILE *stream);
322 /// void free(void *ptr);
324 /// double frexp(double num, int *exp);
326 /// float frexpf(float num, int *exp);
328 /// long double frexpl(long double num, int *exp);
330 /// int fscanf(FILE *stream, const char *format, ... );
332 /// int fseek(FILE *stream, long offset, int whence);
334 /// int fseeko(FILE *stream, off_t offset, int whence);
336 /// int fseeko64(FILE *stream, off64_t offset, int whence)
338 /// int fsetpos(FILE *stream, const fpos_t *pos);
340 /// int fstat(int fildes, struct stat *buf);
342 /// int fstat64(int filedes, struct stat64 *buf)
344 /// int fstatvfs(int fildes, struct statvfs *buf);
346 /// int fstatvfs64(int fildes, struct statvfs64 *buf);
348 /// long ftell(FILE *stream);
350 /// off_t ftello(FILE *stream);
352 /// off64_t ftello64(FILE *stream)
354 /// int ftrylockfile(FILE *file);
356 /// void funlockfile(FILE *file);
358 /// size_t fwrite(const void *ptr, size_t size, size_t nitems,
361 /// int getc(FILE *stream);
363 /// int getc_unlocked(FILE *stream);
365 /// int getchar(void);
367 /// char *getenv(const char *name);
369 /// int getitimer(int which, struct itimerval *value);
371 /// int getlogin_r(char *name, size_t namesize);
373 /// struct passwd *getpwnam(const char *name);
375 /// char *gets(char *s);
377 /// int gettimeofday(struct timeval *tp, void *tzp);
379 /// uint32_t htonl(uint32_t hostlong);
381 /// uint16_t htons(uint16_t hostshort);
383 /// int iprintf(const char *format, ...);
385 /// int isascii(int c);
387 /// int isdigit(int c);
389 /// long int labs(long int j);
391 /// int lchown(const char *path, uid_t owner, gid_t group);
393 /// double ldexp(double x, int n);
395 /// float ldexpf(float x, int n);
397 /// long double ldexpl(long double x, int n);
399 /// long long int llabs(long long int j);
401 /// double log(double x);
403 /// double log10(double x);
405 /// float log10f(float x);
407 /// long double log10l(long double x);
409 /// double log1p(double x);
411 /// float log1pf(float x);
413 /// long double log1pl(long double x);
415 /// double log2(double x);
417 /// float log2f(float x);
419 /// double long double log2l(long double x);
421 /// double logb(double x);
423 /// float logbf(float x);
425 /// long double logbl(long double x);
427 /// float logf(float x);
429 /// long double logl(long double x);
431 /// int lstat(const char *path, struct stat *buf);
433 /// int lstat64(const char *path, struct stat64 *buf);
435 /// void *malloc(size_t size);
437 /// void *memalign(size_t boundary, size_t size);
439 /// void *memccpy(void *s1, const void *s2, int c, size_t n);
441 /// void *memchr(const void *s, int c, size_t n);
443 /// int memcmp(const void *s1, const void *s2, size_t n);
445 /// void *memcpy(void *s1, const void *s2, size_t n);
447 /// void *memmove(void *s1, const void *s2, size_t n);
449 // void *memrchr(const void *s, int c, size_t n);
451 /// void *memset(void *b, int c, size_t len);
453 /// void memset_pattern16(void *b, const void *pattern16, size_t len);
455 /// int mkdir(const char *path, mode_t mode);
457 /// time_t mktime(struct tm *timeptr);
459 /// double modf(double x, double *iptr);
461 /// float modff(float, float *iptr);
463 /// long double modfl(long double value, long double *iptr);
465 /// double nearbyint(double x);
467 /// float nearbyintf(float x);
469 /// long double nearbyintl(long double x);
471 /// uint32_t ntohl(uint32_t netlong);
473 /// uint16_t ntohs(uint16_t netshort);
475 /// int open(const char *path, int oflag, ... );
477 /// int open64(const char *filename, int flags[, mode_t mode])
479 /// DIR *opendir(const char *dirname);
481 /// int pclose(FILE *stream);
483 /// void perror(const char *s);
485 /// FILE *popen(const char *command, const char *mode);
487 /// int posix_memalign(void **memptr, size_t alignment, size_t size);
489 /// double pow(double x, double y);
491 /// float powf(float x, float y);
493 /// long double powl(long double x, long double y);
495 /// ssize_t pread(int fildes, void *buf, size_t nbyte, off_t offset);
497 /// int printf(const char *format, ...);
499 /// int putc(int c, FILE *stream);
501 /// int putchar(int c);
503 /// int puts(const char *s);
505 /// ssize_t pwrite(int fildes, const void *buf, size_t nbyte,
508 /// void qsort(void *base, size_t nel, size_t width,
509 /// int (*compar)(const void *, const void *));
511 /// ssize_t read(int fildes, void *buf, size_t nbyte);
513 /// ssize_t readlink(const char *path, char *buf, size_t bufsize);
515 /// void *realloc(void *ptr, size_t size);
517 /// void *reallocf(void *ptr, size_t size);
519 /// char *realpath(const char *file_name, char *resolved_name);
521 /// int remove(const char *path);
523 /// int rename(const char *old, const char *new);
525 /// void rewind(FILE *stream);
527 /// double rint(double x);
529 /// float rintf(float x);
531 /// long double rintl(long double x);
533 /// int rmdir(const char *path);
535 /// double round(double x);
537 /// float roundf(float x);
539 /// long double roundl(long double x);
541 /// int scanf(const char *restrict format, ... );
543 /// void setbuf(FILE *stream, char *buf);
545 /// int setitimer(int which, const struct itimerval *value,
546 /// struct itimerval *ovalue);
548 /// int setvbuf(FILE *stream, char *buf, int type, size_t size);
550 /// double sin(double x);
552 /// float sinf(float x);
554 /// double sinh(double x);
556 /// float sinhf(float x);
558 /// long double sinhl(long double x);
560 /// long double sinl(long double x);
562 /// int siprintf(char *str, const char *format, ...);
564 /// int snprintf(char *s, size_t n, const char *format, ...);
566 /// int sprintf(char *str, const char *format, ...);
568 /// double sqrt(double x);
570 /// float sqrtf(float x);
572 /// long double sqrtl(long double x);
574 /// int sscanf(const char *s, const char *format, ... );
576 /// int stat(const char *path, struct stat *buf);
578 /// int stat64(const char *path, struct stat64 *buf);
580 /// int statvfs(const char *path, struct statvfs *buf);
582 /// int statvfs64(const char *path, struct statvfs64 *buf)
584 /// char *stpcpy(char *s1, const char *s2);
586 /// char *stpncpy(char *s1, const char *s2, size_t n);
588 /// int strcasecmp(const char *s1, const char *s2);
590 /// char *strcat(char *s1, const char *s2);
592 /// char *strchr(const char *s, int c);
594 /// int strcmp(const char *s1, const char *s2);
596 /// int strcoll(const char *s1, const char *s2);
598 /// char *strcpy(char *s1, const char *s2);
600 /// size_t strcspn(const char *s1, const char *s2);
602 /// char *strdup(const char *s1);
604 /// size_t strlen(const char *s);
606 /// int strncasecmp(const char *s1, const char *s2, size_t n);
608 /// char *strncat(char *s1, const char *s2, size_t n);
610 /// int strncmp(const char *s1, const char *s2, size_t n);
612 /// char *strncpy(char *s1, const char *s2, size_t n);
614 /// char *strndup(const char *s1, size_t n);
616 /// size_t strnlen(const char *s, size_t maxlen);
618 /// char *strpbrk(const char *s1, const char *s2);
620 /// char *strrchr(const char *s, int c);
622 /// size_t strspn(const char *s1, const char *s2);
624 /// char *strstr(const char *s1, const char *s2);
626 /// double strtod(const char *nptr, char **endptr);
628 /// float strtof(const char *nptr, char **endptr);
630 // char *strtok(char *s1, const char *s2);
632 // char *strtok_r(char *s, const char *sep, char **lasts);
634 /// long int strtol(const char *nptr, char **endptr, int base);
636 /// long double strtold(const char *nptr, char **endptr);
638 /// long long int strtoll(const char *nptr, char **endptr, int base);
640 /// unsigned long int strtoul(const char *nptr, char **endptr, int base);
642 /// unsigned long long int strtoull(const char *nptr, char **endptr,
645 /// size_t strxfrm(char *s1, const char *s2, size_t n);
647 /// int system(const char *command);
649 /// double tan(double x);
651 /// float tanf(float x);
653 /// double tanh(double x);
655 /// float tanhf(float x);
657 /// long double tanhl(long double x);
659 /// long double tanl(long double x);
661 /// clock_t times(struct tms *buffer);
663 /// FILE *tmpfile(void);
665 /// FILE *tmpfile64(void)
667 /// int toascii(int c);
669 /// double trunc(double x);
671 /// float truncf(float x);
673 /// long double truncl(long double x);
675 /// int uname(struct utsname *name);
677 /// int ungetc(int c, FILE *stream);
679 /// int unlink(const char *path);
681 /// int unsetenv(const char *name);
683 /// int utime(const char *path, const struct utimbuf *times);
685 /// int utimes(const char *path, const struct timeval times[2]);
687 /// void *valloc(size_t size);
689 /// int vfprintf(FILE *stream, const char *format, va_list ap);
691 /// int vfscanf(FILE *stream, const char *format, va_list arg);
693 /// int vprintf(const char *restrict format, va_list ap);
695 /// int vscanf(const char *format, va_list arg);
697 /// int vsnprintf(char *s, size_t n, const char *format, va_list ap);
699 /// int vsprintf(char *s, const char *format, va_list ap);
701 /// int vsscanf(const char *s, const char *format, va_list arg);
703 /// ssize_t write(int fildes, const void *buf, size_t nbyte);
710 /// \brief Implementation of the target library information.
712 /// This class constructs tables that hold the target library information and
713 /// make it available. However, it is somewhat expensive to compute and only
714 /// depends on the triple. So users typicaly interact with the \c
715 /// TargetLibraryInfo wrapper below.
716 class TargetLibraryInfoImpl {
717 friend class TargetLibraryInfo;
719 unsigned char AvailableArray[(LibFunc::NumLibFuncs+3)/4];
720 llvm::DenseMap<unsigned, std::string> CustomNames;
721 static const char* StandardNames[LibFunc::NumLibFuncs];
723 enum AvailabilityState {
724 StandardName = 3, // (memset to all ones)
726 Unavailable = 0 // (memset to all zeros)
728 void setState(LibFunc::Func F, AvailabilityState State) {
729 AvailableArray[F/4] &= ~(3 << 2*(F&3));
730 AvailableArray[F/4] |= State << 2*(F&3);
732 AvailabilityState getState(LibFunc::Func F) const {
733 return static_cast<AvailabilityState>((AvailableArray[F/4] >> 2*(F&3)) & 3);
737 TargetLibraryInfoImpl();
738 explicit TargetLibraryInfoImpl(const Triple &T);
740 // Provide value semantics.
741 TargetLibraryInfoImpl(const TargetLibraryInfoImpl &TLI);
742 TargetLibraryInfoImpl(TargetLibraryInfoImpl &&TLI);
743 TargetLibraryInfoImpl &operator=(const TargetLibraryInfoImpl &TLI);
744 TargetLibraryInfoImpl &operator=(TargetLibraryInfoImpl &&TLI);
746 /// \brief Searches for a particular function name.
748 /// If it is one of the known library functions, return true and set F to the
749 /// corresponding value.
750 bool getLibFunc(StringRef funcName, LibFunc::Func &F) const;
752 /// \brief Forces a function to be marked as unavailable.
753 void setUnavailable(LibFunc::Func F) {
754 setState(F, Unavailable);
757 /// \brief Forces a function to be marked as available.
758 void setAvailable(LibFunc::Func F) {
759 setState(F, StandardName);
762 /// \brief Forces a function to be marked as available and provide an
763 /// alternate name that must be used.
764 void setAvailableWithName(LibFunc::Func F, StringRef Name) {
765 if (StandardNames[F] != Name) {
766 setState(F, CustomName);
767 CustomNames[F] = Name;
768 assert(CustomNames.find(F) != CustomNames.end());
770 setState(F, StandardName);
774 /// \brief Disables all builtins.
776 /// This can be used for options like -fno-builtin.
777 void disableAllFunctions();
780 /// \brief Provides information about what library functions are available for
781 /// the current target.
783 /// This both allows optimizations to handle them specially and frontends to
784 /// disable such optimizations through -fno-builtin etc.
785 class TargetLibraryInfo {
786 friend class TargetLibraryAnalysis;
787 friend class TargetLibraryInfoWrapperPass;
789 const TargetLibraryInfoImpl *Impl;
792 explicit TargetLibraryInfo(const TargetLibraryInfoImpl &Impl) : Impl(&Impl) {}
794 // Provide value semantics.
795 TargetLibraryInfo(const TargetLibraryInfo &TLI) : Impl(TLI.Impl) {}
796 TargetLibraryInfo(TargetLibraryInfo &&TLI) : Impl(TLI.Impl) {}
797 TargetLibraryInfo &operator=(const TargetLibraryInfo &TLI) {
801 TargetLibraryInfo &operator=(TargetLibraryInfo &&TLI) {
806 /// \brief Searches for a particular function name.
808 /// If it is one of the known library functions, return true and set F to the
809 /// corresponding value.
810 bool getLibFunc(StringRef funcName, LibFunc::Func &F) const {
811 return Impl->getLibFunc(funcName, F);
814 /// \brief Tests wether a library function is available.
815 bool has(LibFunc::Func F) const {
816 return Impl->getState(F) != TargetLibraryInfoImpl::Unavailable;
819 /// \brief Tests if the function is both available and a candidate for
820 /// optimized code generation.
821 bool hasOptimizedCodeGen(LibFunc::Func F) const {
822 if (Impl->getState(F) == TargetLibraryInfoImpl::Unavailable)
826 case LibFunc::copysign: case LibFunc::copysignf: case LibFunc::copysignl:
827 case LibFunc::fabs: case LibFunc::fabsf: case LibFunc::fabsl:
828 case LibFunc::sin: case LibFunc::sinf: case LibFunc::sinl:
829 case LibFunc::cos: case LibFunc::cosf: case LibFunc::cosl:
830 case LibFunc::sqrt: case LibFunc::sqrtf: case LibFunc::sqrtl:
831 case LibFunc::sqrt_finite: case LibFunc::sqrtf_finite:
832 case LibFunc::sqrtl_finite:
833 case LibFunc::fmax: case LibFunc::fmaxf: case LibFunc::fmaxl:
834 case LibFunc::fmin: case LibFunc::fminf: case LibFunc::fminl:
835 case LibFunc::floor: case LibFunc::floorf: case LibFunc::floorl:
836 case LibFunc::nearbyint: case LibFunc::nearbyintf: case LibFunc::nearbyintl:
837 case LibFunc::ceil: case LibFunc::ceilf: case LibFunc::ceill:
838 case LibFunc::rint: case LibFunc::rintf: case LibFunc::rintl:
839 case LibFunc::round: case LibFunc::roundf: case LibFunc::roundl:
840 case LibFunc::trunc: case LibFunc::truncf: case LibFunc::truncl:
841 case LibFunc::log2: case LibFunc::log2f: case LibFunc::log2l:
842 case LibFunc::exp2: case LibFunc::exp2f: case LibFunc::exp2l:
843 case LibFunc::memcmp: case LibFunc::strcmp: case LibFunc::strcpy:
844 case LibFunc::stpcpy: case LibFunc::strlen: case LibFunc::strnlen:
845 case LibFunc::memchr:
851 StringRef getName(LibFunc::Func F) const {
852 auto State = Impl->getState(F);
853 if (State == TargetLibraryInfoImpl::Unavailable)
855 if (State == TargetLibraryInfoImpl::StandardName)
856 return Impl->StandardNames[F];
857 assert(State == TargetLibraryInfoImpl::CustomName);
858 return Impl->CustomNames.find(F)->second;
861 /// \brief Handle invalidation from the pass manager.
863 /// If we try to invalidate this info, just return false. It cannot become
864 /// invalid even if the module changes.
865 bool invalidate(Module &, const PreservedAnalyses &) { return false; }
868 /// \brief Analysis pass providing the \c TargetLibraryInfo.
870 /// Note that this pass's result cannot be invalidated, it is immutable for the
871 /// life of the module.
872 class TargetLibraryAnalysis {
874 typedef TargetLibraryInfo Result;
876 /// \brief Opaque, unique identifier for this analysis pass.
877 static void *ID() { return (void *)&PassID; }
879 /// \brief Default construct the library analysis.
881 /// This will use the module's triple to construct the library info for that
883 TargetLibraryAnalysis() {}
885 /// \brief Construct a library analysis with preset info.
887 /// This will directly copy the preset info into the result without
888 /// consulting the module's triple.
889 TargetLibraryAnalysis(TargetLibraryInfoImpl PresetInfoImpl)
890 : PresetInfoImpl(std::move(PresetInfoImpl)) {}
892 // Move semantics. We spell out the constructors for MSVC.
893 TargetLibraryAnalysis(TargetLibraryAnalysis &&Arg)
894 : PresetInfoImpl(std::move(Arg.PresetInfoImpl)), Impls(std::move(Arg.Impls)) {}
895 TargetLibraryAnalysis &operator=(TargetLibraryAnalysis &&RHS) {
896 PresetInfoImpl = std::move(RHS.PresetInfoImpl);
897 Impls = std::move(RHS.Impls);
901 TargetLibraryInfo run(Module &M);
902 TargetLibraryInfo run(Function &F);
904 /// \brief Provide access to a name for this pass for debugging purposes.
905 static StringRef name() { return "TargetLibraryAnalysis"; }
910 Optional<TargetLibraryInfoImpl> PresetInfoImpl;
912 StringMap<std::unique_ptr<TargetLibraryInfoImpl>> Impls;
914 TargetLibraryInfoImpl &lookupInfoImpl(Triple T);
917 class TargetLibraryInfoWrapperPass : public ImmutablePass {
918 TargetLibraryInfoImpl TLIImpl;
919 TargetLibraryInfo TLI;
921 virtual void anchor();
925 TargetLibraryInfoWrapperPass();
926 explicit TargetLibraryInfoWrapperPass(const Triple &T);
927 explicit TargetLibraryInfoWrapperPass(const TargetLibraryInfoImpl &TLI);
929 TargetLibraryInfo &getTLI() { return TLI; }
930 const TargetLibraryInfo &getTLI() const { return TLI; }
933 } // end namespace llvm