[PATCH] D85527: [AIX] Generate unique module id based on PID and timestamp

Jason Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 10:46:12 PDT 2020


jasonliu 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;
----------------
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.


================
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.
----------------
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? 


================
Comment at: llvm/test/CodeGen/PowerPC/aix-static-init-no-unique-module-id.ll:10
 
-; CHECK: LLVM ERROR: cannot produce a unique identifier for this module based on strong external symbols
+; Use PID and timestamp to generate a unique module id when strong external
+; symbols are not available in current module. The module id generated in this
----------------
Need a TODO here as well to indicate that this is not the final solution for this specific case.


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