[PATCH] D31787: [TLI] Add declarations for various math header file routines from math-finite.h that create '__<func>_finite as functions

Andy Kaylor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 2 14:23:12 PDT 2017


andrew.w.kaylor added inline comments.


================
Comment at: include/llvm/Analysis/TargetLibraryInfo.def:165
+/// double __acos_finite(double x);
+TLI_DEFINE_ENUM_INTERNAL(acos_finite)
+TLI_DEFINE_STRING_INTERNAL("__acos_finite")
----------------
chrischr wrote:
> andrew.w.kaylor wrote:
> > Is there a reason for these being inserted where they are?  It looks rather arbitrary.
> The list needs to be created in sorted order based on the value of the string definition.
> 
> 
> ```
> static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T,
>                        ArrayRef<StringRef> StandardNames) {
>   // Verify that the StandardNames array is in alphabetical order.
>   assert(std::is_sorted(StandardNames.begin(), StandardNames.end(),
>                         [](StringRef LHS, StringRef RHS) {
>                           return LHS < RHS;
>                         }) &&
>          "TargetLibraryInfoImpl function names must be sorted");
> ```
> 
OK.  That makes sense now.

What about a test?


https://reviews.llvm.org/D31787





More information about the llvm-commits mailing list