[all-commits] [llvm/llvm-project] 0d0478: [LifetimeSafety] Add language option for experimen...

Utkarsh Saxena via All-commits all-commits at lists.llvm.org
Tue Jul 22 12:31:32 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0d0478903474b2e53c874427e3d6eb2ed7567e50
      https://github.com/llvm/llvm-project/commit/0d0478903474b2e53c874427e3d6eb2ed7567e50
  Author: Utkarsh Saxena <usx at google.com>
  Date:   2025-07-22 (Tue, 22 Jul 2025)

  Changed paths:
    M clang/include/clang/Basic/LangOptions.def
    M clang/include/clang/Driver/Options.td
    M clang/lib/Sema/AnalysisBasedWarnings.cpp
    M clang/test/Sema/warn-lifetime-safety-dataflow.cpp

  Log Message:
  -----------
  [LifetimeSafety] Add language option for experimental lifetime safety (#149592)

Add a language option flag for experimental lifetime safety analysis in C++.

This change provides a language option to control the experimental lifetime safety analysis feature, making it more explicit and easier to enable/disable. Previously, the feature was controlled indirectly through a diagnostic warning flag, which we do not want to accidentally enable with `-Weverything` (atm)!

### Changes:

- Added a new language option `EnableLifetimeSafety` in `LangOptions.def` for experimental lifetime safety analysis in C++
- Added corresponding driver options `-fexperimental-lifetime-safety` and `-fno-experimental-lifetime-safety` in `Options.td`
- Modified `AnalysisBasedWarnings.cpp` to use the new language option flag instead of checking if a specific diagnostic is ignored
- Updated a test case to use the new flag instead of relying on the warning flag alone



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list