[llvm] [DebugMetadata][DwarfDebug][CodeView] Support function-local static variables in lexical block scopes (6/7) (PR #187927)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 22 05:39:03 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {undef deprecator}-->
:warning: undef deprecator found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git diff -U0 --pickaxe-regex -S '([^a-zA-Z0-9#_-]undef([^a-zA-Z0-9_-]|$)|UndefValue::get)' 'HEAD~1' HEAD llvm/test/Bitcode/upgrade-cu-static-locals.ll llvm/test/DebugInfo/Generic/lexical-block-static-var.ll llvm/test/DebugInfo/Generic/verifier-invalid-dicompileunit.ll llvm/include/llvm/IR/DIBuilder.h llvm/include/llvm/IR/DebugInfo.h llvm/include/llvm/IR/DebugInfoMetadata.h llvm/lib/Bitcode/Reader/MetadataLoader.cpp llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.h llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp llvm/lib/IR/DIBuilder.cpp llvm/lib/IR/DebugInfo.cpp llvm/lib/IR/DebugInfoMetadata.cpp llvm/lib/IR/Verifier.cpp llvm/lib/Target/BPF/BPFAbstractMemberAccess.cpp llvm/lib/Target/BPF/BTFDebug.cpp llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp llvm/lib/Transforms/Utils/CloneFunction.cpp llvm/lib/Transforms/Utils/Debugify.cpp llvm/test/Bitcode/DIModule-fortran-external-module.ll llvm/test/CodeGen/AArch64/arm64-2011-03-17-AsmPrinterCrash.ll llvm/test/CodeGen/BPF/BTF/static-var-inited-sec.ll llvm/test/CodeGen/BPF/BTF/static-var-inited.ll llvm/test/CodeGen/BPF/BTF/static-var-readonly-sec.ll llvm/test/CodeGen/BPF/BTF/static-var-readonly.ll llvm/test/CodeGen/BPF/BTF/static-var-sec.ll llvm/test/CodeGen/BPF/BTF/static-var.ll llvm/test/CodeGen/BPF/dwarfdump.ll llvm/test/CodeGen/PowerPC/pr24546.ll llvm/test/CodeGen/X86/dbg-distringtype-uint.ll llvm/test/DebugInfo/COFF/fortran-basic.ll llvm/test/DebugInfo/COFF/fortran-contained-proc.ll llvm/test/DebugInfo/COFF/global_visibility.ll llvm/test/DebugInfo/COFF/type-quals.ll llvm/test/DebugInfo/Generic/2009-11-05-DeadGlobalVariable.ll llvm/test/DebugInfo/Generic/inlined-static-var.ll llvm/test/DebugInfo/Generic/verifier-invalid-disubprogram.ll llvm/test/DebugInfo/Symbolize/XCOFF/xcoff-symbolize-data.ll llvm/test/DebugInfo/X86/DW_AT_specification.ll llvm/test/DebugInfo/X86/dbg-value-transfer-order.ll llvm/test/DebugInfo/X86/dimodule-external-fortran.ll llvm/test/DebugInfo/X86/distringtype.ll llvm/test/DebugInfo/X86/global-sra-struct-fit-segment.ll llvm/test/DebugInfo/X86/global-sra-struct-part-overlap-segment.ll llvm/test/DebugInfo/X86/gnu-public-names.ll llvm/test/DebugInfo/X86/namelist1.ll llvm/test/DebugInfo/X86/sdag-dbgvalue-phi-use-4.ll llvm/test/DebugInfo/duplicate_dbgvalue.ll llvm/test/Instrumentation/InstrProfiling/debug-info-correlate.ll llvm/test/Transforms/Util/clone-dicompileunit.ll llvm/test/tools/llvm-debuginfo-analyzer/DWARF/Inputs/ThreadLocalStorage.ll llvm/unittests/Transforms/Utils/CloningTest.cpp
``````````
</details>
The following files introduce new uses of undef:
- llvm/test/DebugInfo/X86/sdag-dbgvalue-phi-use-4.ll
[Undef](https://llvm.org/docs/LangRef.html#undefined-values) is now deprecated and should only be used in the rare cases where no replacement is possible. For example, a load of uninitialized memory yields `undef`. You should use `poison` values for placeholders instead.
In tests, avoid using `undef` and having tests that trigger undefined behavior. If you need an operand with some unimportant value, you can add a new argument to the function and use that instead.
For example, this is considered a bad practice:
```llvm
define void @fn() {
...
br i1 undef, ...
}
```
Please use the following instead:
```llvm
define void @fn(i1 %cond) {
...
br i1 %cond, ...
}
```
Please refer to the [Undefined Behavior Manual](https://llvm.org/docs/UndefinedBehavior.html) for more information.
https://github.com/llvm/llvm-project/pull/187927
More information about the llvm-commits
mailing list