DebugInfo: Disable simplified template names for -gmlt and below

Since -gmlt doesn't carry any type information necessary to rebuild
template names.
This commit is contained in:
David Blaikie 2022-02-15 11:26:15 -08:00
parent 1ea326634b
commit 9980a3f831
3 changed files with 15 additions and 3 deletions

View File

@ -5086,6 +5086,10 @@ std::string CGDebugInfo::GetName(const Decl *D, bool Qualified) const {
return Name;
codegenoptions::DebugTemplateNamesKind TemplateNamesKind =
CGM.getCodeGenOpts().getDebugSimpleTemplateNames();
if (!CGM.getCodeGenOpts().hasReducedDebugInfo())
TemplateNamesKind = codegenoptions::DebugTemplateNamesKind::Full;
Optional<TemplateArgs> Args;
bool IsOperatorOverload = false; // isa<CXXConversionDecl>(ND);

View File

@ -1,6 +1,11 @@
// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown_unknown -debug-info-kind=limited -gsimple-template-names=mangled %s -o - -w -std=c++17 | FileCheck %s
// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown_unknown -debug-info-kind=limited -gsimple-template-names=simple %s -o - -w -std=c++17 | FileCheck --check-prefix=SIMPLE --implicit-check-not=_STN %s
// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown_unknown -debug-info-kind=limited %s -o - -w -std=c++17 | FileCheck --check-prefix=FULL --implicit-check-not=_STN %s
// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown_unknown -std=c++17 %s -o - -w -debug-info-kind=limited -gsimple-template-names=mangled \
// RUN: | FileCheck %s
// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown_unknown -std=c++17 %s -o - -w -debug-info-kind=limited -gsimple-template-names=simple \
// RUN: | FileCheck %s --implicit-check-not=_STN --check-prefix=SIMPLE
// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown_unknown -std=c++17 %s -o - -w -debug-info-kind=limited \
// RUN: | FileCheck %s --implicit-check-not=_STN --check-prefix=FULL
// RUN: %clang_cc1 -emit-llvm -triple x86_64-unknown_unknown -std=c++17 %s -o - -w -debug-info-kind=line-tables-only -gsimple-template-names=mangled -fdebug-info-for-profiling \
// RUN: | FileCheck %s --implicit-check-not=_STN --check-prefix=FULL
template <typename... T>
void f1() {}

View File

@ -1,9 +1,12 @@
// RUN: %clang %target_itanium_abi_host_triple %s -c -o - -gdwarf-4 -Xclang -gsimple-template-names=mangled -Xclang -debug-forward-template-params -std=c++20 \
// RUN: | llvm-dwarfdump --verify -
// RUN: %clang %target_itanium_abi_host_triple %s -c -o - -gdwarf-4 -Xclang -gsimple-template-names=mangled -Xclang -debug-forward-template-params -std=c++20 -gmlt -fdebug-info-for-profiling \
// RUN: | llvm-dwarfdump --verify -
// RUN: %clang %target_itanium_abi_host_triple %s -c -o - -gdwarf-4 -Xclang -gsimple-template-names=mangled -Xclang -debug-forward-template-params -std=c++20 -fdebug-types-section \
// RUN: | llvm-dwarfdump --verify -
// RUN: %clang %target_itanium_abi_host_triple %s -c -o - -gdwarf-5 -Xclang -gsimple-template-names=mangled -Xclang -debug-forward-template-params -std=c++20 -fdebug-types-section \
// RUN: | llvm-dwarfdump --verify -
#include <cstdint>
template<typename ...Ts>
struct t1 {