Author: Utkarsh Saxena Date: 2026-06-17T09:05:09Z New Revision: 4995c6e59e7cc263f2fd001e4e417f0dab6eade1
URL: https://github.com/llvm/llvm-project/commit/4995c6e59e7cc263f2fd001e4e417f0dab6eade1 DIFF: https://github.com/llvm/llvm-project/commit/4995c6e59e7cc263f2fd001e4e417f0dab6eade1.diff LOG: [LifetimeSafety] Mark lifetime safety LangOptions as `Benign` (#204316) Without this, we cannot load modules built without lifetime safety. Analysis options are in general benign and does not effect AST construction. See doc: ```cpp /// For ASTs produced with different option value, signifies their level of /// compatibility. enum class CompatibilityKind { /// Does affect the construction of the AST in a way that does prevent /// module interoperability. NotCompatible, /// Does affect the construction of the AST in a way that doesn't prevent /// interoperability (that is, the value can be different between an /// explicit module and the user of that module). Compatible, /// Does not affect the construction of the AST in any way (that is, the /// value can be different between an implicit module and the user of that /// module). Benign, }; ``` Added: Modified: clang/include/clang/Basic/LangOptions.def Removed: ################################################################################ diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def index 4a3e3b7c04822..d3ec6bc1ebd23 100644 --- a/clang/include/clang/Basic/LangOptions.def +++ b/clang/include/clang/Basic/LangOptions.def @@ -518,14 +518,14 @@ LANGOPT(CheckConstexprFunctionBodies, 1, 1, Benign, LANGOPT(BoundsSafety, 1, 0, NotCompatible, "Bounds safety extension for C") -LANGOPT(DebugRunLifetimeSafety, 1, 0, NotCompatible, "Run lifetime safety analysis for C++. Does not enable warnings.") +LANGOPT(DebugRunLifetimeSafety, 1, 0, Benign, "Run lifetime safety analysis for C++. Does not enable warnings.") -LANGOPT(LifetimeSafetyMaxCFGBlocks, 32, 0, NotCompatible, "Skip LifetimeSafety analysis for functions with CFG block count exceeding this threshold. Specify 0 for no limit") +LANGOPT(LifetimeSafetyMaxCFGBlocks, 32, 0, Benign, "Skip LifetimeSafety analysis for functions with CFG block count exceeding this threshold. Specify 0 for no limit") -LANGOPT(EnableLifetimeSafetyInference, 1, 0, NotCompatible, "Lifetime safety inference analysis for C++") +LANGOPT(EnableLifetimeSafetyInference, 1, 0, Benign, "Lifetime safety inference analysis for C++") // TODO: Remove flag and default to end-of-TU analysis for lifetime safety after performance validation. -LANGOPT(EnableLifetimeSafetyTUAnalysis, 1, 0, NotCompatible, "Lifetime safety at translation-unit end, analyzing functions in call graph post-order for C++") +LANGOPT(EnableLifetimeSafetyTUAnalysis, 1, 0, Benign, "Lifetime safety at translation-unit end, analyzing functions in call graph post-order for C++") LANGOPT(PreserveVec3Type, 1, 0, NotCompatible, "Preserve 3-component vector type") LANGOPT(Reflection , 1, 0, NotCompatible, "C++26 Reflection") _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
