diff options
author | Matheus Izvekov <mizvekov@gmail.com> | 2025-06-08 17:07:36 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-08 17:07:36 -0300 |
commit | 366f48890d643e15e1317ada300f2cc1be437721 (patch) | |
tree | d3cd6d490c747064b4aab5e3d5f9704208d7d5ff /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | b1b84a629d5a6d7ed3d4f05077c1db8b6898115b (diff) | |
download | llvm-366f48890d643e15e1317ada300f2cc1be437721.zip llvm-366f48890d643e15e1317ada300f2cc1be437721.tar.gz llvm-366f48890d643e15e1317ada300f2cc1be437721.tar.bz2 |
[clang] AST: fix dependency calculation for TypedefTypes (#143291)
The dependency from the type sugar of the underlying type of a Typedef
were not being considered for the dependency of the TypedefType itself.
A TypedefType should be instantiation dependent if it involves
non-instantiated template parameters, even if they don't contribute to
the canonical type.
Besides, a TypedefType should be instantiation dependent if it is
declared in a dependent context, but fixing that would have performance
consequences, as otherwise non-dependent typedef declarations would need
to be transformed during instantiation as well.
This removes the workaround added in
https://github.com/llvm/llvm-project/pull/90032
Fixes https://github.com/llvm/llvm-project/issues/89774
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 001b208..ee5e3d6 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -1564,28 +1564,7 @@ llvm::DIType *CGDebugInfo::CreateType(const TemplateSpecializationType *Ty, SourceLocation Loc = AliasDecl->getLocation(); - if (CGM.getCodeGenOpts().DebugTemplateAlias && - // FIXME: This is a workaround for the issue - // https://github.com/llvm/llvm-project/issues/89774 - // The TemplateSpecializationType doesn't contain any instantiation - // information; dependent template arguments can't be resolved. For now, - // fall back to DW_TAG_typedefs for template aliases that are - // instantiation dependent, e.g.: - // ``` - // template <int> - // using A = int; - // - // template<int I> - // struct S { - // using AA = A<I>; // Instantiation dependent. - // AA aa; - // }; - // - // S<0> s; - // ``` - // S::AA's underlying type A<I> is dependent on I so will be emitted as a - // DW_TAG_typedef. - !Ty->isInstantiationDependentType()) { + if (CGM.getCodeGenOpts().DebugTemplateAlias) { auto ArgVector = ::GetTemplateArgs(TD, Ty); TemplateArgs Args = {TD->getTemplateParameters(), ArgVector}; |