Added posix function gettimeofday to LibFunc::Func for all platforms but Windows.
authorMichael Gottesman <mgottesman@apple.com>
Wed, 3 Jul 2013 04:00:51 +0000 (04:00 +0000)
committerMichael Gottesman <mgottesman@apple.com>
Wed, 3 Jul 2013 04:00:51 +0000 (04:00 +0000)
*NOTE* In a recent version of posix, they added the restrict keyword to the
arguments for this function. From some spelunking it seems that on some
platforms, the call has restrict on its arguments and others it does not. Thus I
left off the restrict keyword from the function prototype in the comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185501 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetLibraryInfo.h
lib/Target/TargetLibraryInfo.cpp

index 4b9c0442dc97b1ae81b257a5029e50df4146f3b2..dc80e4001fdd172ebe39ce3d16026a5254cc4b42 100644 (file)
@@ -308,6 +308,8 @@ namespace llvm {
       getpwnam,
       /// char *gets(char *s);
       gets,
+      /// int gettimeofday(struct timeval *tp, void *tzp);
+      gettimeofday,
       /// uint32_t htonl(uint32_t hostlong);
       htonl,
       /// uint16_t htons(uint16_t hostshort);
index d2967d929d851399ba0f19dddd75fb52f0abdc39..99fff59535d03a62be963a075b9c31c18c041ee5 100644 (file)
@@ -168,6 +168,7 @@ const char* TargetLibraryInfo::StandardNames[LibFunc::NumLibFuncs] =
     "getlogin_r",
     "getpwnam",
     "gets",
+    "gettimeofday",
     "htonl",
     "htons",
     "iprintf",
@@ -490,6 +491,7 @@ static void initialize(TargetLibraryInfo &TLI, const Triple &T,
     TLI.setUnavailable(LibFunc::getitimer);
     TLI.setUnavailable(LibFunc::getlogin_r);
     TLI.setUnavailable(LibFunc::getpwnam);
+    TLI.setUnavailable(LibFunc::gettimeofday);
     TLI.setUnavailable(LibFunc::htonl);
     TLI.setUnavailable(LibFunc::htons);
     TLI.setUnavailable(LibFunc::lchown);