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

Jordan Rose jordan_rose at apple.com
Sun Aug 3 22:58:40 PDT 2014


It looks like MakeArgString takes a Twine, so 

Twine("-fbuild-session-timestamp=") + Timestamp

should work, right?

On Aug 2, 2014, at 18:11 , NAKAMURA Takumi <geek4civic at gmail.com> wrote:

> 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)) {
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list