This is an archive of the discontinued LLVM Phabricator instance.

Let writeWindowsResourceCOFF() take a TimeStamp parameter
ClosedPublic

Authored by thakis on Jun 10 2019, 7:56 PM.

Details

Summary

For lld, pass in Config->Timestamp (which is set based on lld's
/timestamp: and /Brepro flags). Since the writeWindowsResourceCOFF()
data is only used in-memory by LLD and the obj's timestamp isn't used
for anything in the output, this doesn't change behavior.

For llvm-cvtres, add an optional /timestamp: parameter, and use the
current behavior of calling time() if the parameter is not passed in.

This doesn't really change observable behavior (unless someone passes
/timestamp: to llvm-cvtres, which wasn't possible before), but it
removes the last unqualified call to time() from llvm/lib, which seems
like a good thing.

Diff Detail

Event Timeline

thakis created this revision.Jun 10 2019, 7:56 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2019, 7:56 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
thakis updated this revision to Diff 203964.Jun 10 2019, 7:59 PM
hans accepted this revision.Jun 11 2019, 1:48 AM

lgtm

This revision is now accepted and ready to land.Jun 11 2019, 1:48 AM
This revision was automatically updated to reflect the committed changes.
ruiu added a subscriber: ruiu.Jun 11 2019, 4:30 AM

LGTM

llvm/trunk/tools/llvm-cvtres/llvm-cvtres.cpp
94 ↗(On Diff #204014)

Can this happen? Is this for the year 2038 problem?

thakis marked an inline comment as done.Jun 11 2019, 4:46 AM
thakis added inline comments.
llvm/trunk/tools/llvm-cvtres/llvm-cvtres.cpp
94 ↗(On Diff #204014)

I just moved this function around so I'm not sure, but that was my guess as well.