[clang] [LifetimeSafety] Introduce intra-procedural analysis in Clang (PR #142313)

Prabhu Rajasekaran via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 10 18:07:02 PDT 2025


Prabhuk wrote:

I am part of a toolchain team at Google and we are seeing clang test failures in our toolchain builders from this PR.

```
Exit Code: 1

Command Output (stderr):
--
/b/s/w/ir/x/w/llvm_build/bin/clang -cc1 -internal-isystem /b/s/w/ir/x/w/llvm_build/lib/clang/21/include -nostdsysteminc -mllvm -debug-only=LifetimeFacts -Wexperimental-lifetime-safety /b/s/w/ir/x/w/llvm-llvm-project/clang/test/Sema/warn-lifetime-safety-dataflow.cpp 2>&1 | /b/s/w/ir/x/w/llvm_build/bin/FileCheck /b/s/w/ir/x/w/llvm-llvm-project/clang/test/Sema/warn-lifetime-safety-dataflow.cpp # RUN: at line 1
+ /b/s/w/ir/x/w/llvm_build/bin/clang -cc1 -internal-isystem /b/s/w/ir/x/w/llvm_build/lib/clang/21/include -nostdsysteminc -mllvm -debug-only=LifetimeFacts -Wexperimental-lifetime-safety /b/s/w/ir/x/w/llvm-llvm-project/clang/test/Sema/warn-lifetime-safety-dataflow.cpp
+ /b/s/w/ir/x/w/llvm_build/bin/FileCheck /b/s/w/ir/x/w/llvm-llvm-project/clang/test/Sema/warn-lifetime-safety-dataflow.cpp
/b/s/w/ir/x/w/llvm-llvm-project/clang/test/Sema/warn-lifetime-safety-dataflow.cpp:9:17: error: CHECK-LABEL: expected string not found in input
// CHECK-LABEL: Function: return_local_addr
                ^
<stdin>:1:1: note: scanning from here
clang (LLVM option parsing): Unknown command line argument '-debug-only=LifetimeFacts'. Try: 'clang (LLVM option parsing) --help'
^
<stdin>:1:105: note: possible intended match here
clang (LLVM option parsing): Unknown command line argument '-debug-only=LifetimeFacts'. Try: 'clang (LLVM option parsing) --help'
                                                                                                        ^

Input file: <stdin>
Check file: /b/s/w/ir/x/w/llvm-llvm-project/clang/test/Sema/warn-lifetime-safety-dataflow.cpp

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1: clang (LLVM option parsing): Unknown command line argument '-debug-only=LifetimeFacts'. Try: 'clang (LLVM option parsing) --help' 
label:9'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
label:9'1                                                                                                             ?                          possible intended match
           2: clang (LLVM option parsing): Did you mean '--debug-pass=LifetimeFacts'? 
label:9'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>

--
```

I am taking a closer look. Here are the logs: https://logs.chromium.org/logs/fuchsia/buildbucket/cr-buildbucket/8709695680348159649/+/u/clang/tests/stdout

https://github.com/llvm/llvm-project/pull/142313


More information about the cfe-commits mailing list