[PATCH] D85527: [AIX] Generate unique module id based on PID and timestamp
Xiangling Liao via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 13 08:27:39 PDT 2020
Xiangling_L marked 3 inline comments as done.
Xiangling_L added inline comments.
================
Comment at: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1841
+ std::time_t Now = time(nullptr);
+ if (Now < 0 || !isUInt<64>(Now))
+ return UINT64_MAX;
----------------
jasonliu wrote:
> Not sure what this condition is trying to achieve.
> isUInt takes uint64_t as parameter, and we are asking if a uint64_t type is going to fit in 64 bit width. The answer is always going to be true.
As we discussed offline, current implementation of std::time_t may fail in 2038. But we will wait until then to see how OS upgrade the implementation and how we can adjust the implementation accordingly if needed.
================
Comment at: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1878
+ else
+ // Use PID and current time as unique module id when we cannot
+ // generate one based on a module's strong external symbols.
----------------
jasonliu wrote:
> I think in theory, we only want to take this path when we have a stdin input file.
> Other than that, we should be able to come up with a sufficiently unique name using output file name and options, etc.
> Could we put a TODO somewhere to indicate that?
Sure. good suggestion.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85527/new/
https://reviews.llvm.org/D85527
More information about the llvm-commits
mailing list