Michael137 wrote:
> @Michael137 said:
>
> > Btw, as a follow-up to this patch should we check that this is compatible
> > with dsymutil (i.e., running dsymutil --verify)? I suspect it might need a
> > fixup (given LLDB doesn't even support this tag)
Yup, dsymutil looks good now, thanks
>
OCHyams wrote:
@Michael137 said:
> Btw, as a follow-up to this patch should we check that this is compatible
> with dsymutil (i.e., running dsymutil --verify)? I suspect it might need a
> fixup (given LLDB doesn't even support this tag)
`dsymutil --verify` seems to be happy with the tag.
OCHyams wrote:
Dependent expressions strike again - https://godbolt.org/z/W381837vr
```
template
using A = int;
template
struct S {
using AA = A;
AA aa;
};
S<0> s;
```
` clang++ -c test.cpp -g -gtemplate-alias`
`clang/lib/AST/ExprConstant.cpp:15721: bool
https://github.com/OCHyams closed
https://github.com/llvm/llvm-project/pull/87623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
OCHyams wrote:
Thanks everyone. I'll land this now then to see what the bots have to say about
it.
https://github.com/llvm/llvm-project/pull/87623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
pogo59 wrote:
Yes, driver part LGTM.
https://github.com/llvm/llvm-project/pull/87623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -triple x86_64-unk-unk -o - -emit-llvm
-debug-info-kind=standalone -gtemplate-alias %s -gsimple-template-names=simple \
+// RUN: | FileCheck %s
+
+ Check that -gtemplate-alias causes DW_TAG_template_alias emission for
+ template
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -triple x86_64-unk-unk -o - -emit-llvm
-debug-info-kind=standalone -gtemplate-alias %s -gsimple-template-names=simple \
+// RUN: | FileCheck %s
+
+ Check that -gtemplate-alias causes DW_TAG_template_alias emission for
+ template
https://github.com/Michael137 approved this pull request.
LGTM, if @pogo59 and @dwblaikie are happy with the driver changes
https://github.com/llvm/llvm-project/pull/87623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -triple x86_64-unk-unk -o - -emit-llvm
-debug-info-kind=standalone -gtemplate-alias %s -gsimple-template-names=simple \
+// RUN: | FileCheck %s
+
+ Check that -gtemplate-alias causes DW_TAG_template_alias emission for
+ template
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
OCHyams wrote:
I've rebased this so now this pull request contains only the Clang changes
(LLVM side is here #88943).
There's a discussion starting
[here](https://github.com/llvm/llvm-project/pull/87623#discussion_r1567968127)
that discusses whether or not we should include defaulted
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
https://github.com/Michael137 edited
https://github.com/llvm/llvm-project/pull/87623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
@@ -1313,6 +1313,61 @@ llvm::DIType *CGDebugInfo::CreateType(const
BlockPointerType *Ty,
return DBuilder.createPointerType(EltTy, Size);
}
+static llvm::SmallVector
+GetTemplateArgs(const TemplateDecl *TD, const TemplateSpecializationType *Ty) {
+
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
@@ -310,6 +310,24 @@ namespace llvm {
DINode::DIFlags Flags = DINode::FlagZero,
DINodeArray Annotations = nullptr);
+/// Create debugging information entry for a template alias.
+/// \param Ty
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 -triple x86_64-unk-unk -o - -emit-llvm
-debug-info-kind=standalone -gtemplate-alias %s -gsimple-template-names=simple \
+// RUN: | FileCheck %s
+
+ Check that -gtemplate-alias causes DW_TAG_template_alias emission for
+ template
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
https://github.com/Michael137 edited
https://github.com/llvm/llvm-project/pull/87623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
@@ -310,6 +310,24 @@ namespace llvm {
DINode::DIFlags Flags = DINode::FlagZero,
DINodeArray Annotations = nullptr);
+/// Create debugging information entry for a template alias.
+/// \param Ty
https://github.com/OCHyams commented:
(oops, didn't submit my inline replies...)
https://github.com/llvm/llvm-project/pull/87623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
https://github.com/OCHyams edited
https://github.com/llvm/llvm-project/pull/87623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Michael137 wrote:
Btw, as a follow-up to this patch should we check that this is compatible with
dsymutil (i.e., running `dsymutil --verify`)? I suspect it might need a fixup
(given LLDB doesn't even support this tag)
https://github.com/llvm/llvm-project/pull/87623
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
@@ -310,6 +310,24 @@ namespace llvm {
DINode::DIFlags Flags = DINode::FlagZero,
DINodeArray Annotations = nullptr);
+/// Create debugging information entry for a template alias.
+/// \param Ty
@@ -465,3 +465,15 @@
// MANGLED_TEMP_NAMES: error: unknown argument
'-gsimple-template-names=mangled'; did you mean '-Xclang
-gsimple-template-names=mangled'
// RUN: %clang -### -target x86_64 -c -g %s 2>&1 | FileCheck
--check-prefix=FULL_TEMP_NAMES
https://github.com/pogo59 edited https://github.com/llvm/llvm-project/pull/87623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1332,6 +1332,54 @@ llvm::DIType *CGDebugInfo::CreateType(const
TemplateSpecializationType *Ty,
auto PP = getPrintingPolicy();
Ty->getTemplateName().print(OS, PP, TemplateName::Qualified::None);
+ SourceLocation Loc = AliasDecl->getLocation();
+
+ if
https://github.com/pogo59 commented:
The flag situation is good. Tuning influences the default for the new option,
which is how we want that to work.
I'm happy, a couple of nits left. I'll leave it to others to do the final
approval.
https://github.com/llvm/llvm-project/pull/87623
@@ -1,4 +1,4 @@
-// RUN: %clang -g -std=c++11 -S -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang -ggdb -std=c++11 -S -emit-llvm %s -o - | FileCheck %s
OCHyams wrote:
Agreed, done
https://github.com/llvm/llvm-project/pull/87623
@@ -465,3 +465,15 @@
// MANGLED_TEMP_NAMES: error: unknown argument
'-gsimple-template-names=mangled'; did you mean '-Xclang
-gsimple-template-names=mangled'
// RUN: %clang -### -target x86_64 -c -g %s 2>&1 | FileCheck
--check-prefix=FULL_TEMP_NAMES
@@ -4584,6 +4584,32 @@ renderDebugOptions(const ToolChain , const Driver ,
const llvm::Triple ,
}
}
+ // Emit DW_TAG_template_alias for template aliases? True by default for SCE.
+ const auto *DebugTemplateAlias = Args.getLastArg(
+ options::OPT_gtemplate_alias,
@@ -5361,7 +5383,56 @@ static bool IsReconstitutableType(QualType QT) {
return T.Reconstitutable;
}
-std::string CGDebugInfo::GetName(const Decl *D, bool Qualified) const {
+bool CGDebugInfo::HasReconstitutableArgs(
+ArrayRef Args) const {
+ return llvm::all_of(Args,
OCHyams wrote:
> But perhaps at least you could add named accessors to DIDerivedType for the
> template params, same as DIGlobalVariable/DICompositeType have?
Done. I couldn't add an assert (`getTag() == dwarf::DW_TAG_template_alias`)
without including `Dwarf.h`. I've chosen to not do that as
@@ -465,3 +465,15 @@
// MANGLED_TEMP_NAMES: error: unknown argument
'-gsimple-template-names=mangled'; did you mean '-Xclang
-gsimple-template-names=mangled'
// RUN: %clang -### -target x86_64 -c -g %s 2>&1 | FileCheck
--check-prefix=FULL_TEMP_NAMES
@@ -5361,7 +5383,56 @@ static bool IsReconstitutableType(QualType QT) {
return T.Reconstitutable;
}
-std::string CGDebugInfo::GetName(const Decl *D, bool Qualified) const {
+bool CGDebugInfo::HasReconstitutableArgs(
+ArrayRef Args) const {
+ return llvm::all_of(Args,
@@ -4584,6 +4584,32 @@ renderDebugOptions(const ToolChain , const Driver ,
const llvm::Triple ,
}
}
+ // Emit DW_TAG_template_alias for template aliases? True by default for SCE.
+ const auto *DebugTemplateAlias = Args.getLastArg(
+ options::OPT_gtemplate_alias,
https://github.com/pogo59 deleted
https://github.com/llvm/llvm-project/pull/87623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4584,6 +4584,32 @@ renderDebugOptions(const ToolChain , const Driver ,
const llvm::Triple ,
}
}
+ // Emit DW_TAG_template_alias for template aliases? True by default for SCE.
+ const auto *DebugTemplateAlias = Args.getLastArg(
+ options::OPT_gtemplate_alias,
dwblaikie wrote:
> Thanks @dwblaikie
>
> > Bit unfortunate to store template parameters in different ways (in the
> > extraData for the alias template, but in the templateParams for the
> > composite types) - but I guess it'd be more invasive to try to represent
> > alias templates as
OCHyams wrote:
Thanks @dwblaikie
> Bit unfortunate to store template parameters in different ways (in the
> extraData for the alias template, but in the templateParams for the composite
> types) - but I guess it'd be more invasive to try to represent alias
> templates as composite types?
I
pogo59 wrote:
> @pogo59 Hmm - I thought you held a strong preference that debugger tuning
> never be the only way to access a certain feature, and that we should always
> have direct control of these features via flags (but with default (or
> explicit) debugger tuning setting some of these
@@ -5361,7 +5383,56 @@ static bool IsReconstitutableType(QualType QT) {
return T.Reconstitutable;
}
-std::string CGDebugInfo::GetName(const Decl *D, bool Qualified) const {
+bool CGDebugInfo::HasReconstitutableArgs(
+ArrayRef Args) const {
+ return llvm::all_of(Args,
dwblaikie wrote:
Re: code: Looks about right.
Bit unfortunate to store template parameters in different ways (in the
`extraData` for the alias template, but in the `templateParams` for the
composite types) - but I guess it'd be more invasive to try to represent alias
templates as composite
dwblaikie wrote:
> > I'm a little uncomfortable with adding a new user-facing option for
> > template aliases. Even with that in place, we should not warn and refuse to
> > do what the user asked for, based on DWARF version. -gdwarf-2 -gsplit-dwarf
> > generates a .dwo file claiming to be v2,
OCHyams wrote:
Fixed
https://github.com/llvm/llvm-project/pull/87623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -152,9 +152,11 @@ uint64_t DebugHandlerBase::getBaseTypeSize(const DIType
*Ty) {
unsigned Tag = DDTy->getTag();
if (Tag != dwarf::DW_TAG_member && Tag != dwarf::DW_TAG_typedef &&
- Tag != dwarf::DW_TAG_const_type && Tag != dwarf::DW_TAG_volatile_type &&
+
@@ -5361,7 +5383,56 @@ static bool IsReconstitutableType(QualType QT) {
return T.Reconstitutable;
}
-std::string CGDebugInfo::GetName(const Decl *D, bool Qualified) const {
+bool CGDebugInfo::HasReconstitutableArgs(
+ArrayRef Args) const {
+ return llvm::all_of(Args,
@@ -310,6 +310,23 @@ namespace llvm {
DINode::DIFlags Flags = DINode::FlagZero,
DINodeArray Annotations = nullptr);
+/// Create debugging information entry for a typedef.
+/// \param Ty
@@ -5361,7 +5383,56 @@ static bool IsReconstitutableType(QualType QT) {
return T.Reconstitutable;
}
-std::string CGDebugInfo::GetName(const Decl *D, bool Qualified) const {
+bool CGDebugInfo::HasReconstitutableArgs(
+ArrayRef Args) const {
+ return llvm::all_of(Args,
@@ -1,4 +1,4 @@
-// RUN: %clang -g -std=c++11 -S -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang -ggdb -std=c++11 -S -emit-llvm %s -o - | FileCheck %s
Michael137 wrote:
Do we now lose a tiny bit of coverage for `-glldb`? I assume this change is to
make sure
OCHyams wrote:
> LLVM IR parts look good to me.
Thanks!
@pogo59 said:
> Converting frame-types.s from v4 to v5 should be done as a separate commit.
> Then adding the alias would be a simpler change to review.
I've split that into two commits in this PR: upgrade to v5:
66 matches
Mail list logo