Files
llvm-project/flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
jeanPerier e4f1530edc [flang][debug] generate llvm.fake.use for arguments at -g and O0 (#187044)
Fix for https://github.com/llvm/llvm-project/issues/185432.

This patch extends the lifetime of procedure dummy arguments using llvm.fake.use
so that they are accessible in debugger during the whole lifetime of the function.

This is done by:
- adding a new fir.fake_use operation and emitting it in AddDebugInfo.cpp for
   dummy arguments at the end of the procedure scope.
- lower this new fir.fake_use to the llvm.fake.use intrinsic.

This is done under -g at O0 only to avoid pessimizing the generated code when
optimizations are requested.
2026-04-24 09:21:01 +02:00

46 KiB