Commit 6419104
[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)!
- 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
(cherry picked from commit 0d04789)1 parent d502822 commit 6419104
File tree
4 files changed
+12
-3
lines changed- clang
- include/clang
- Basic
- Driver
- lib/Sema
- test/Sema
4 files changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
| 499 | + | |
| 500 | + | |
499 | 501 | | |
500 | 502 | | |
501 | 503 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1917 | 1917 | | |
1918 | 1918 | | |
1919 | 1919 | | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
1920 | 1928 | | |
1921 | 1929 | | |
1922 | 1930 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2891 | 2891 | | |
2892 | 2892 | | |
2893 | 2893 | | |
2894 | | - | |
2895 | | - | |
| 2894 | + | |
2896 | 2895 | | |
2897 | 2896 | | |
2898 | 2897 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
0 commit comments