[all-commits] [llvm/llvm-project] 211f5a: [clang] Move getenv call for SOURCE_DATE_EPOCH out...

Ben Langmuir via All-commits all-commits at lists.llvm.org
Wed Oct 26 12:43:17 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 211f5af38af1810925343bb71d90ca8485e66300
      https://github.com/llvm/llvm-project/commit/211f5af38af1810925343bb71d90ca8485e66300
  Author: Ben Langmuir <blangmuir at apple.com>
  Date:   2022-10-26 (Wed, 26 Oct 2022)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M clang/lib/Driver/ToolChains/Clang.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    A clang/test/Driver/SOURCE_DATE_EPOCH.c
    M clang/test/Preprocessor/SOURCE_DATE_EPOCH.c

  Log Message:
  -----------
  [clang] Move getenv call for SOURCE_DATE_EPOCH out of frontend NFC

Move the check for SOURCE_DATE_EPOCH to the driver and use a cc1 option
to pass it to the frontend. This avoids hidden state in the cc1
invocation and makes this env variable behave more like other env
variables that clang handles in the driver.

Differential Revision: https://reviews.llvm.org/D136717




More information about the All-commits mailing list