This is an archive of the discontinued LLVM Phabricator instance.

[gmodules] Skip CXXDeductionGuideDecls when visiting FunctionDecls in DebugTypeVisitor
ClosedPublic

Authored by ahatanak on May 17 2022, 3:03 PM.

Diff Detail

Event Timeline

ahatanak created this revision.May 17 2022, 3:03 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2022, 3:03 PM
ahatanak requested review of this revision.May 17 2022, 3:03 PM

Without this fix, CXXNameMangler::mangleUnresolvedName crashes when it tries to mangle the name of a CXXDeductionGuideDecl.

ping.

Does debug info need information on deduction guides? I think it's safe to skip deduction guides as they are used only for template argument deduction.

aprantl accepted this revision.May 31 2022, 1:32 PM
aprantl added a project: debug-info.

Adding the debug-info group. I don't really know enough about deduction guides to comment on the implications, but if it fixes the crash it seems to be a strict improvement. Maybe wait another day to see if someone else has an opinion on this.

This revision is now accepted and ready to land.May 31 2022, 1:33 PM
This revision was landed with ongoing or failed builds.Jun 6 2022, 12:52 PM
This revision was automatically updated to reflect the committed changes.
kaz7 added a subscriber: kaz7.Jun 6 2022, 6:37 PM

Hi, after this patch, our buildbot for VE having errors like https://lab.llvm.org/buildbot/#/builders/91/builds/9984.

When I run a test script by hand, it shows following errors. Please investigate them. Thank you.

$ cd build
$ /home/marukawa/llvm-upstream/build/bin/clang -cc1 -internal-isystem /home/marukawa/llvm-upstream/build/lib/clang/15.0.0/include -nostdsysteminc -std=c++2b -x c++-header -emit-pch -fmodule-format=obj -I /home/marukawa/llvm-upstream/llvm-project/clang/test/Modules/Inputs    -o /home/marukawa/llvm-upstream/build/tools/clang/test/Modules/Output/gmodules-deduction-guide.cpp.tmp.pch /home/marukawa/llvm-upstream/llvm-project/clang/test/Modules/Inputs/gmodules-deduction-guide.h    -mllvm -debug-only=pchcontainer &>/home/marukawa/llvm-upstream/build/tools/clang/test/Modules/Output/gmodules-deduction-guide.cpp.tmp-pch.ll
$ echo $?
1
$ cat /home/marukawa/llvm-upstream/build/tools/clang/test/Modules/Output/gmodules-deduction-guide.cpp.tmp-pch.ll | /home/marukawa/llvm-upstream/build/bin/FileCheck /home/marukawa/llvm-upstream/llvm-project/clang/test/Modules/gmodules-deduction-guide.cpp
/home/marukawa/llvm-upstream/llvm-project/clang/test/Modules/gmodules-deduction-guide.cpp:6:11: error: CHECK: expected string not found in input
// CHECK: ![[V0:.*]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S<A>",
          ^
<stdin>:1:1: note: scanning from here
clang (LLVM option parsing): Unknown command line argument '-debug-only=pchcontainer'. Try: 'clang (LLVM option parsing) --help'
^

Input file: <stdin>
Check file: /home/marukawa/llvm-upstream/llvm-project/clang/test/Modules/gmodules-deduction-guide.cpp

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

Input was:
<<<<<<
         1: clang (LLVM option parsing): Unknown command line argument '-debug-only=pchcontainer'. Try: 'clang (LLVM option parsing) --help'
check:6     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
         2: clang (LLVM option parsing): Did you mean '--debug-pass=pchcontainer'?
check:6     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>
chapuni added a subscriber: chapuni.Jun 6 2022, 6:55 PM
chapuni added inline comments.
clang/test/Modules/gmodules-deduction-guide.cpp
3

FYI, it is unavailable with -Asserts

ahatanak added inline comments.Jun 6 2022, 7:00 PM
clang/test/Modules/gmodules-deduction-guide.cpp
3

Ah, right. Thank you!

kaz7 added a comment.Jun 6 2022, 8:15 PM

Thank you, @chapuni and @ahatanak, for quick fixing.