[PATCH] D28030: [TLI] Add prototype checking for all remaining LibFuncs.

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 19:55:15 PST 2017


davide added a comment.

This looks much better now.



================
Comment at: lib/Analysis/TargetLibraryInfo.cpp:782-787
+  case LibFunc::ZdaPvRKSt9nothrow_t:
+  case LibFunc::ZdaPvj:
+  case LibFunc::ZdaPvm:
+  case LibFunc::ZdlPvRKSt9nothrow_t:
+  case LibFunc::ZdlPvj:
+  case LibFunc::ZdlPvm:
----------------
Please add a comment with the demangled name (as it's done in other places).


================
Comment at: lib/Analysis/TargetLibraryInfo.cpp:828-831
+  case LibFunc::fiprintf:
   case LibFunc::fprintf:
     return (NumParams >= 2 && FTy.getParamType(0)->isPointerTy() &&
             FTy.getParamType(1)->isPointerTy());
----------------
This is missing the check for the return type, `int`.


================
Comment at: lib/Analysis/TargetLibraryInfo.cpp:838
+  case LibFunc::gets:
+    return (NumParams == 1 && FTy.getParamType(0)->isPointerTy());
   case LibFunc::getitimer:
----------------
Can you narrow this? `char *` instead of `isPointerTy()`


================
Comment at: lib/Analysis/TargetLibraryInfo.cpp:940-943
+  case LibFunc::ZnwjRKSt9nothrow_t:
+  case LibFunc::ZnwmRKSt9nothrow_t:
+  case LibFunc::ZnajRKSt9nothrow_t:
+  case LibFunc::ZnamRKSt9nothrow_t:
----------------
please add a comment with the demangled name for our sanity =)


https://reviews.llvm.org/D28030





More information about the llvm-commits mailing list