[clang] [lldb] [clang][Expr] Teach IgnoreUnlessSpelledInSource about implicit calls to std::get free function (PR #122265)

Michael Buch via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 23 06:46:43 PDT 2025


Michael137 wrote:

> I'm afraid I'm seeing a test regression with this change (confirmed via bisect), on Gentoo amd64:
> 
> ```
> FAIL: Clang :: DebugInfo/CXX/structured-binding.cpp (11221 of 22437)
> ******************** TEST 'Clang :: DebugInfo/CXX/structured-binding.cpp' FAILED ********************
> Exit Code: 1
> 
> Command Output (stderr):
> --
> /var/tmp/portage/llvm-core/clang-22.0.0.9999/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/llvm-core/clang-22.0.0.9999/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/22/include -nostdsysteminc -std=c++23 -emit-llvm -debug-info-kind=standalone -triple i686-pc-linux-gnu /var/tmp/portage/llvm-core/clang-22.0.0.9999/work/clang/test/DebugInfo/CXX/structured-binding.cpp -o - | /usr/lib/llvm/22/bin/FileCheck /var/tmp/portage/llvm-core/clang-22.0.0.9999/work/clang/test/DebugInfo/CXX/structured-binding.cpp --implicit-check-not="call void @llvm.dbg.declare" # RUN: at line 1
> + /var/tmp/portage/llvm-core/clang-22.0.0.9999/work/x/y/clang-abi_x86_32.x86/bin/clang -cc1 -internal-isystem /var/tmp/portage/llvm-core/clang-22.0.0.9999/work/x/y/clang-abi_x86_32.x86/bin/../../../../lib/clang/22/include -nostdsysteminc -std=c++23 -emit-llvm -debug-info-kind=standalone -triple i686-pc-linux-gnu /var/tmp/portage/llvm-core/clang-22.0.0.9999/work/clang/test/DebugInfo/CXX/structured-binding.cpp -o -
> + /usr/lib/llvm/22/bin/FileCheck /var/tmp/portage/llvm-core/clang-22.0.0.9999/work/clang/test/DebugInfo/CXX/structured-binding.cpp '--implicit-check-not=call void @llvm.dbg.declare'
> /var/tmp/portage/llvm-core/clang-22.0.0.9999/work/clang/test/DebugInfo/CXX/structured-binding.cpp:12:11: error: CHECK: expected string not found in input
> // CHECK: #dbg_declare(ptr %v, ![[VAR_8:[0-9]+]], !DIExpression()
>           ^
> <stdin>:152:44: note: scanning from here
>  #dbg_declare(ptr %k, !133, !DIExpression(), !139)
>                                            ^
> <stdin>:163:2: note: possible intended match here
>  #dbg_declare(ptr %v6, !140, !DIExpression(), !145)
>  ^
> 
> Input file: <stdin>
> Check file: /var/tmp/portage/llvm-core/clang-22.0.0.9999/work/clang/test/DebugInfo/CXX/structured-binding.cpp
> 
> -dump-input=help explains the following input dump.
> 
> Input was:
> <<<<<<
>             .
>             .
>             .
>           147:  store <2 x i32> <i32 1, i32 2>, ptr %vctr, align 8, !dbg !126 
>           148:  #dbg_declare(ptr %5, !127, !DIExpression(DW_OP_deref), !128) 
>           149:  #dbg_declare(ptr %5, !129, !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 4), !130) 
>           150:  store ptr %vctr, ptr %5, align 4, !dbg !131 
>           151:  call void @llvm.memcpy.p0.p0.i32(ptr align 4 %6, ptr align 4 @__const._Z1fv..1, i32 12, i1 false), !dbg !132 
>           152:  #dbg_declare(ptr %k, !133, !DIExpression(), !139) 
> check:12'0                                                X~~~~~~~ error: no match found
>           153:  call void @llvm.memcpy.p0.p0.i32(ptr align 4 %agg.tmp, ptr align 4 %6, i32 12, i1 false), !dbg !139 
> check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>           154:  %k4 = getelementptr inbounds nuw %"struct.std::triple", ptr %agg.tmp, i32 0, i32 0, !dbg !139 
> check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>           155:  %9 = load i32, ptr %k4, align 4, !dbg !139 
> check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>           156:  %v = getelementptr inbounds nuw %"struct.std::triple", ptr %agg.tmp, i32 0, i32 1, !dbg !139 
> check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>           157:  %10 = load i32, ptr %v, align 4, !dbg !139 
> check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>           158:  %w = getelementptr inbounds nuw %"struct.std::triple", ptr %agg.tmp, i32 0, i32 2, !dbg !139 
> check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>           159:  %11 = load i32, ptr %w, align 4, !dbg !139 
> check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>           160:  %call5 = call noundef i32 @_ZSt3getILj0EEiSt6triple(i32 %9, i32 %10, i32 %11), !dbg !139 
> check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>           161:  store i32 %call5, ptr %ref.tmp3, align 4, !dbg !139 
> check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>           162:  store ptr %ref.tmp3, ptr %k, align 4, !dbg !139 
> check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>           163:  #dbg_declare(ptr %v6, !140, !DIExpression(), !145) 
> check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> check:12'1      ?                                                   possible intended match
>           164:  call void @llvm.memcpy.p0.p0.i32(ptr align 4 %agg.tmp8, ptr align 4 %6, i32 12, i1 false), !dbg !145 
> check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>           165:  %k9 = getelementptr inbounds nuw %"struct.std::triple", ptr %agg.tmp8, i32 0, i32 0, !dbg !145 
> check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>           166:  %12 = load i32, ptr %k9, align 4, !dbg !145 
> check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>           167:  %v10 = getelementptr inbounds nuw %"struct.std::triple", ptr %agg.tmp8, i32 0, i32 1, !dbg !145 
> check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>           168:  %13 = load i32, ptr %v10, align 4, !dbg !145 
> check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>             .
>             .
>             .
> >>>>>>
> 
> --
> 
> ********************
> ```

Thanks! that was useful. Put up fix here: https://github.com/llvm/llvm-project/pull/160300

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


More information about the cfe-commits mailing list