[all-commits] [llvm/llvm-project] fef185: [clang][modules] Reset codegen options. (#74006)

Juergen Ributzka via All-commits all-commits at lists.llvm.org
Mon Dec 4 13:55:11 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fef1854318bd797c1f8a141d4b45b113b04860d1
      https://github.com/llvm/llvm-project/commit/fef1854318bd797c1f8a141d4b45b113b04860d1
  Author: Juergen Ributzka <juergen at ributzka.de>
  Date:   2023-12-04 (Mon, 04 Dec 2023)

  Changed paths:
    M clang/include/clang/Basic/CodeGenOptions.def
    M clang/include/clang/Basic/CodeGenOptions.h
    A clang/include/clang/Basic/DebugOptions.def
    M clang/include/module.modulemap
    M clang/lib/Basic/CodeGenOptions.cpp
    M clang/lib/Frontend/CompilerInvocation.cpp
    A clang/test/ClangScanDeps/strip-codegen-args.m

  Log Message:
  -----------
  [clang][modules] Reset codegen options. (#74006)

CodeGen options do not affect the AST, so they usually can be ignored.
The only exception to the rule is when a PCM is created with
`-gmodules`.
In that case the Clang module format is switched to object file
container and contains also serialized debug information that can be
affected by debug options. There the following approach was choosen:

1.) Split out all the debug options into a separate `DebugOptions.def`
    file. The file is included by `CodeGenOptions.def`, so the change is
    transparent to all existing users of `CodeGenOptions.def`.
2.) Reset all CodeGen options, but excluding affecting debug options.
3.) Conditionally reset debug options that can affect the PCM.

This fixes rdar://113135909.




More information about the All-commits mailing list