r214656 - Tools.cpp: Avoid std::to_string() on -fbuild-session-timestamp to appease mingw32 builder.

NAKAMURA Takumi geek4civic at gmail.com
Sat Aug 2 18:11:45 PDT 2014


Author: chapuni
Date: Sat Aug  2 20:11:44 2014
New Revision: 214656

URL: http://llvm.org/viewvc/llvm-project?rev=214656&view=rev
Log:
Tools.cpp: Avoid std::to_string() on -fbuild-session-timestamp to appease mingw32 builder.

Modified:
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=214656&r1=214655&r2=214656&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sat Aug  2 20:11:44 2014
@@ -3863,9 +3863,10 @@ void Clang::ConstructJob(Compilation &C,
     llvm::sys::fs::file_status Status;
     if (llvm::sys::fs::status(A->getValue(), Status))
       D.Diag(diag::err_drv_no_such_file) << A->getValue();
-    auto Timestamp = Status.getLastModificationTime().toEpochTime();
-    CmdArgs.push_back(Args.MakeArgString("-fbuild-session-timestamp=" +
-                                         std::to_string(Timestamp)));
+    char TimeStamp[48];
+    snprintf(TimeStamp, sizeof(TimeStamp), "-fbuild-session-timestamp=%" PRIu64,
+             (uint64_t)Status.getLastModificationTime().toEpochTime());
+    CmdArgs.push_back(Args.MakeArgString(TimeStamp));
   }
 
   if (Args.getLastArg(options::OPT_fmodules_validate_once_per_build_session)) {





More information about the cfe-commits mailing list