DebugInfo: Add (initially no-op) -gsimple-template-names={simple,mangled}
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 22 Sep 2021 03:25:13 +0000 (20:25 -0700)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 22 Sep 2021 18:11:49 +0000 (11:11 -0700)
commit38c09ea2d279eddddabe3602e2002f8cdfcc5380
tree7688d1f0a7b739e1523b2e5198b108b16e23c4e5
parent43552651319e1c39c09ce0f61b588813414cebda
DebugInfo: Add (initially no-op) -gsimple-template-names={simple,mangled}

This is to build the foundation of a new debug info feature to use only
the base name of template as its debug info name (eg: "t1" instead of
the full "t1<int>"). The intent being that a consumer can still retrieve
all that information from the DW_TAG_template_*_parameters.

So gno-simple-template-names is business as usual/previously ("t1<int>")
   =simple is the simplified name ("t1")
   =mangled is a special mode to communicate the full information, but
   also indicate that the name should be able to be simplified. The data
   is encoded as "_STNt1|<int>" which will be matched with an
   llvm-dwarfdump --verify feature to deconstruct this name, rebuild the
   original name, and then try to rebuild the simple name via the DWARF
   tags - then compare the latter and the former to ensure that all the
   data necessary to fully rebuild the name is present.
clang/include/clang/Basic/CodeGenOptions.def
clang/include/clang/Basic/DebugInfoOptions.h
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/Driver/debug-options.c