[PATCH] D135045: [Frontend] Recognize environment variable SOURCE_DATE_EPOCH

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 5 15:59:14 PDT 2022


MaskRay marked an inline comment as done.
MaskRay added inline comments.


================
Comment at: clang/lib/Lex/PPMacroExpansion.cpp:1092
+    TT = *PP.getPreprocessorOpts().SourceDateEpoch;
+    TM = std::gmtime(&TT);
+  } else {
----------------
ychen wrote:
> Why not use localtime as the else branch?
> 
> As mentioned above, diagnose null TM here or when parsing the user-specifed value. A small trade-off to make, up to you.
Can you elaborate? With the check in Frontend I think a check here is not necessary...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135045/new/

https://reviews.llvm.org/D135045



More information about the cfe-commits mailing list