https://github.com/kuilpd created
https://github.com/llvm/llvm-project/pull/115005
The information about an enum's best promotion type is discarded after
compilation and is not present in debug info. This patch repeats the same
analysis of each enum value as in the front-end to determine the b
kuilpd wrote:
My thought process for this patch:
https://github.com/llvm/llvm-project/issues/86989#issuecomment-2438116468
https://github.com/llvm/llvm-project/pull/115005
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/
https://github.com/kuilpd updated
https://github.com/llvm/llvm-project/pull/115005
>From 5290832b802d98b9d293b6910c0837911ec490c4 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin
Date: Mon, 4 Nov 2024 14:33:45 +0500
Subject: [PATCH 1/4] [lldb] Analyze enum promotion type during parsing
---
clang/in
https://github.com/kuilpd updated
https://github.com/llvm/llvm-project/pull/115005
>From 5290832b802d98b9d293b6910c0837911ec490c4 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin
Date: Mon, 4 Nov 2024 14:33:45 +0500
Subject: [PATCH 1/4] [lldb] Analyze enum promotion type during parsing
---
clang/in
kuilpd wrote:
> Not that this shouldn't be fixed, just weighing of the amount of complexity
> added here versus the benefit.
I don't really know how useful it is in general to know the actual promotion
type of the enum, I guess only for using enum values in expressions without
explicit castin
kuilpd wrote:
Ping
https://github.com/llvm/llvm-project/pull/115005
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
kuilpd wrote:
So, is this patch worth pursuing or is it too much code for a too specific use
case?
https://github.com/llvm/llvm-project/pull/115005
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo
@@ -20008,6 +20008,87 @@ bool Sema::IsValueInFlagEnum(const EnumDecl *ED, const
llvm::APInt &Val,
return !(FlagMask & Val) || (AllowMask && !(FlagMask & ~Val));
}
+bool Sema::ComputeBestEnumProperties(ASTContext &Context, EnumDecl *Enum,
+
kuilpd wrote:
> > This is just moving stuff around so that seems fine. Though, I wonder,
> > could we just pass e.g. an `ArrayRef` to `computeEnumBits()`? The
> > LLDB pr you linked seems to have an `SmallVector`, so
> > that should be possible (I think it does require a `reinterpret_cast` fro
kuilpd wrote:
The code needs to be called from LLDB as well (#115005), so this is an NFC
patch to move it to `ASTContext.h`, plus this cleans up a bit the code in
`Sema::ActOnEnumBody`.
`isRepresentableIntegerValue` also had to be moved to `ASTContext.h`, but since
it requires `ASTContext` as
https://github.com/kuilpd created
https://github.com/llvm/llvm-project/pull/126096
Move the code that computes `NumNegativeBits` and `NumPositiveBits` for an enum
to a separate function in `ASTContext.h`
>From bf58b01066421af318a7a69a3ac1632e69b29301 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin
https://github.com/kuilpd edited
https://github.com/llvm/llvm-project/pull/126096
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kuilpd closed
https://github.com/llvm/llvm-project/pull/126096
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kuilpd updated
https://github.com/llvm/llvm-project/pull/115005
>From 4d797371598960baf7729d05590aa1a8c7077694 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin
Date: Mon, 4 Nov 2024 14:33:45 +0500
Subject: [PATCH 01/10] [lldb] Analyze enum promotion type during parsing
---
clang/
@@ -2367,11 +2369,38 @@ size_t DWARFASTParserClang::ParseChildEnumerators(
}
if (name && name[0] && got_value) {
- m_ast.AddEnumerationValueToEnumerationType(
+ auto ECD = m_ast.AddEnumerationValueToEnumerationType(
clang_type, decl, name, enum_val
@@ -2367,11 +2369,36 @@ size_t DWARFASTParserClang::ParseChildEnumerators(
}
if (name && name[0] && got_value) {
- m_ast.AddEnumerationValueToEnumerationType(
+ auto ECD = m_ast.AddEnumerationValueToEnumerationType(
kuilpd wrote:
Alright, wi
@@ -2367,11 +2369,36 @@ size_t DWARFASTParserClang::ParseChildEnumerators(
}
if (name && name[0] && got_value) {
- m_ast.AddEnumerationValueToEnumerationType(
+ auto ECD = m_ast.AddEnumerationValueToEnumerationType(
kuilpd wrote:
It's used i
https://github.com/kuilpd updated
https://github.com/llvm/llvm-project/pull/115005
>From 4d797371598960baf7729d05590aa1a8c7077694 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin
Date: Mon, 4 Nov 2024 14:33:45 +0500
Subject: [PATCH 01/12] [lldb] Analyze enum promotion type during parsing
---
clang/
@@ -2367,11 +2369,36 @@ size_t DWARFASTParserClang::ParseChildEnumerators(
}
if (name && name[0] && got_value) {
- m_ast.AddEnumerationValueToEnumerationType(
+ auto ECD = m_ast.AddEnumerationValueToEnumerationType(
kuilpd wrote:
Well... I t
@@ -2367,11 +2369,36 @@ size_t DWARFASTParserClang::ParseChildEnumerators(
}
if (name && name[0] && got_value) {
- m_ast.AddEnumerationValueToEnumerationType(
+ auto ECD = m_ast.AddEnumerationValueToEnumerationType(
kuilpd wrote:
> > Iterati
@@ -2367,11 +2369,36 @@ size_t DWARFASTParserClang::ParseChildEnumerators(
}
if (name && name[0] && got_value) {
- m_ast.AddEnumerationValueToEnumerationType(
+ auto ECD = m_ast.AddEnumerationValueToEnumerationType(
kuilpd wrote:
Yes, but I
https://github.com/kuilpd updated
https://github.com/llvm/llvm-project/pull/115005
>From 5290832b802d98b9d293b6910c0837911ec490c4 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin
Date: Mon, 4 Nov 2024 14:33:45 +0500
Subject: [PATCH 1/6] [lldb] Analyze enum promotion type during parsing
---
clang/in
@@ -2299,11 +2301,103 @@ size_t DWARFASTParserClang::ParseChildEnumerators(
}
if (name && name[0] && got_value) {
- m_ast.AddEnumerationValueToEnumerationType(
+ auto ECD = m_ast.AddEnumerationValueToEnumerationType(
clang_type, decl, name, enum_va
@@ -8544,7 +8524,8 @@ clang::EnumConstantDecl
*TypeSystemClang::AddEnumerationValueToEnumerationType(
bool is_signed = false;
underlying_type.IsIntegerType(is_signed);
- llvm::APSInt value(enum_value_bit_size, is_signed);
+ // APSInt constructor's sign argument is isUns
https://github.com/kuilpd updated
https://github.com/llvm/llvm-project/pull/115005
>From 4d797371598960baf7729d05590aa1a8c7077694 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin
Date: Mon, 4 Nov 2024 14:33:45 +0500
Subject: [PATCH 1/6] [lldb] Analyze enum promotion type during parsing
---
clang/in
@@ -2367,11 +2369,38 @@ size_t DWARFASTParserClang::ParseChildEnumerators(
}
if (name && name[0] && got_value) {
- m_ast.AddEnumerationValueToEnumerationType(
+ auto ECD = m_ast.AddEnumerationValueToEnumerationType(
clang_type, decl, name, enum_val
https://github.com/kuilpd edited
https://github.com/llvm/llvm-project/pull/115005
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kuilpd updated
https://github.com/llvm/llvm-project/pull/115005
>From 4d797371598960baf7729d05590aa1a8c7077694 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin
Date: Mon, 4 Nov 2024 14:33:45 +0500
Subject: [PATCH 1/7] [lldb] Analyze enum promotion type during parsing
---
clang/in
@@ -2367,11 +2369,38 @@ size_t DWARFASTParserClang::ParseChildEnumerators(
}
if (name && name[0] && got_value) {
- m_ast.AddEnumerationValueToEnumerationType(
+ auto ECD = m_ast.AddEnumerationValueToEnumerationType(
clang_type, decl, name, enum_val
kuilpd wrote:
@Michael137
Reused the code I merged in #120965 to get the best promotion type.
https://github.com/llvm/llvm-project/pull/115005
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-
https://github.com/kuilpd updated
https://github.com/llvm/llvm-project/pull/115005
>From 4d797371598960baf7729d05590aa1a8c7077694 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin
Date: Mon, 4 Nov 2024 14:33:45 +0500
Subject: [PATCH 1/8] [lldb] Analyze enum promotion type during parsing
---
clang/in
@@ -3903,6 +3903,7 @@ class EnumDecl : public TagDecl {
void setInstantiationOfMemberEnum(ASTContext &C, EnumDecl *ED,
TemplateSpecializationKind TSK);
+public:
kuilpd wrote:
I left this in so that that I could simply do
https://github.com/kuilpd updated
https://github.com/llvm/llvm-project/pull/120965
>From ab8dcaef120233d0145508aaa4bf45eec22cadf1 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin
Date: Mon, 23 Dec 2024 17:49:32 +0500
Subject: [PATCH 1/4] [clang][Sema] Move calculating enum width and type to a
separa
kuilpd wrote:
Tried moving the code to `EnumDecl`, but it didn't work as well as I thought,
so moved it to `ASTContext` after all. Don't really know where exactly to place
it inside `ASTContext.h`, though.
https://github.com/llvm/llvm-project/pull/120965
___
kuilpd wrote:
As of now LLDB doesn't calculate enum's best promotion type when reading it
from DWARF info. This change would allow to reuse the code from Sema without
copying it to LLDB, which I'm working on in #115005
This function however has too many arguments right now, and also needs to
https://github.com/kuilpd created
https://github.com/llvm/llvm-project/pull/120965
Move the code that calculates BestWidth, BestType and BestPromotionType for an
enum to a separate function which can be called from outside of Sema.
>From ab8dcaef120233d0145508aaa4bf45eec22cadf1 Mon Sep 17 00:
https://github.com/kuilpd updated
https://github.com/llvm/llvm-project/pull/120965
>From ab8dcaef120233d0145508aaa4bf45eec22cadf1 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin
Date: Mon, 23 Dec 2024 17:49:32 +0500
Subject: [PATCH 1/2] [clang][Sema] Move calculating enum width and type to a
separa
https://github.com/kuilpd updated
https://github.com/llvm/llvm-project/pull/120965
>From ab8dcaef120233d0145508aaa4bf45eec22cadf1 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin
Date: Mon, 23 Dec 2024 17:49:32 +0500
Subject: [PATCH 1/2] [clang][Sema] Move calculating enum width and type to a
separa
@@ -20008,6 +20008,87 @@ bool Sema::IsValueInFlagEnum(const EnumDecl *ED, const
llvm::APInt &Val,
return !(FlagMask & Val) || (AllowMask && !(FlagMask & ~Val));
}
+bool Sema::ComputeBestEnumProperties(ASTContext &Context, EnumDecl *Enum,
+
https://github.com/kuilpd updated
https://github.com/llvm/llvm-project/pull/120965
>From ab8dcaef120233d0145508aaa4bf45eec22cadf1 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin
Date: Mon, 23 Dec 2024 17:49:32 +0500
Subject: [PATCH 1/5] [clang][Sema] Move calculating enum width and type to a
separa
kuilpd wrote:
Updated code, fixed nits.
@Fznamznon Does this look good to you too?
https://github.com/llvm/llvm-project/pull/120965
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -20008,6 +20008,87 @@ bool Sema::IsValueInFlagEnum(const EnumDecl *ED, const
llvm::APInt &Val,
return !(FlagMask & Val) || (AllowMask && !(FlagMask & ~Val));
}
+bool Sema::ComputeBestEnumProperties(ASTContext &Context, EnumDecl *Enum,
+
https://github.com/kuilpd closed
https://github.com/llvm/llvm-project/pull/120965
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kuilpd edited
https://github.com/llvm/llvm-project/pull/120965
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kuilpd edited
https://github.com/llvm/llvm-project/pull/120965
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kuilpd updated
https://github.com/llvm/llvm-project/pull/115005
>From dd65babbf4c73a0b2fc2e4aa47a9a346bd5a9adf Mon Sep 17 00:00:00 2001
From: Ilia Kuklin
Date: Mon, 4 Nov 2024 14:33:45 +0500
Subject: [PATCH 01/14] [lldb] Analyze enum promotion type during parsing
---
clang/
https://github.com/kuilpd updated
https://github.com/llvm/llvm-project/pull/115005
>From dd65babbf4c73a0b2fc2e4aa47a9a346bd5a9adf Mon Sep 17 00:00:00 2001
From: Ilia Kuklin
Date: Mon, 4 Nov 2024 14:33:45 +0500
Subject: [PATCH 01/15] [lldb] Analyze enum promotion type during parsing
---
clang/
kuilpd wrote:
@Michael137
Thank you for seeing this through!
https://github.com/llvm/llvm-project/pull/115005
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/kuilpd updated
https://github.com/llvm/llvm-project/pull/115005
>From 4d797371598960baf7729d05590aa1a8c7077694 Mon Sep 17 00:00:00 2001
From: Ilia Kuklin
Date: Mon, 4 Nov 2024 14:33:45 +0500
Subject: [PATCH 01/13] [lldb] Analyze enum promotion type during parsing
---
clang/
kuilpd wrote:
@Michael137
Changed the first argument of `computeEnumBits` to an `ArrayRef` to avoid the
template and so it can be still seamlessly used from Sema.
On LLDB side, I had to create a `SmallVector` and put enum constants there at
the point of their creation (`AddEnumerationValueToEn
https://github.com/kuilpd closed
https://github.com/llvm/llvm-project/pull/115005
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
kuilpd wrote:
> But only for dSYMs. Looking at the `dSYM`, none of the enums are actually
> preserved in the debug-info. You have to actually use the enum types in
> source to get dsymutil to preserve them. I'll fix it
Ah, I see. Thank you for handling this!
https://github.com/llvm/llvm-proje
52 matches
Mail list logo