[clang] [libclang/python] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-22 Thread Dmitry Fursov via cfe-commits
@@ -1952,6 +1952,8 @@ def enum_value(self): underlying_type = self.type if underlying_type.kind == TypeKind.ENUM: underlying_type = underlying_type.get_declaration().enum_type +if underlying_type.kind == TypeKind.ELABORATED: -

[clang] [libclang/python] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-22 Thread Dmitry Fursov via cfe-commits
@@ -1952,6 +1952,8 @@ def enum_value(self): underlying_type = self.type if underlying_type.kind == TypeKind.ENUM: underlying_type = underlying_type.get_declaration().enum_type +if underlying_type.kind == TypeKind.ELABORATED: -

[clang] [libclang/python] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-21 Thread Dmitry Fursov via cfe-commits
https://github.com/fursov edited https://github.com/llvm/llvm-project/pull/108769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [libclang/python] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-21 Thread Dmitry Fursov via cfe-commits
@@ -1952,6 +1952,8 @@ def enum_value(self): underlying_type = self.type if underlying_type.kind == TypeKind.ENUM: underlying_type = underlying_type.get_declaration().enum_type +if underlying_type.kind == TypeKind.ELABORATED: -

[clang] [libclang/python] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-18 Thread Dmitry Fursov via cfe-commits
fursov wrote: Sorry, I'm not familiar with the process (this is my first PR on github) - how the change gets now to the repo? Someone from llvm-project should push it? https://github.com/llvm/llvm-project/pull/108769 ___ cfe-commits mailing list cfe-c

[clang] [libclang/python] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-18 Thread Dmitry Fursov via cfe-commits
https://github.com/fursov updated https://github.com/llvm/llvm-project/pull/108769 >From 4d9f2e2e9ac57b4279a4aafc078a3b4fb3ff646f Mon Sep 17 00:00:00 2001 From: Dmitry Fursov Date: Sun, 15 Sep 2024 18:14:48 +0300 Subject: [PATCH 1/2] Fix evaluation of the unsigned enumeration values If the typ

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-17 Thread Dmitry Fursov via cfe-commits
fursov wrote: @DeinAlptraum, thank you for the review. The findings are fixed now. Could you say if the fix to be backported to other relelases, like 18.x or 19rc? If yes, how this is done? https://github.com/llvm/llvm-project/pull/108769 ___ cfe-comm

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-17 Thread Dmitry Fursov via cfe-commits
https://github.com/fursov updated https://github.com/llvm/llvm-project/pull/108769 >From 4d9f2e2e9ac57b4279a4aafc078a3b4fb3ff646f Mon Sep 17 00:00:00 2001 From: Dmitry Fursov Date: Sun, 15 Sep 2024 18:14:48 +0300 Subject: [PATCH] Fix evaluation of the unsigned enumeration values If the type of

[clang] Fix evaluation of the unsigned enumeration values, #108766 (PR #108769)

2024-09-15 Thread Dmitry Fursov via cfe-commits
https://github.com/fursov created https://github.com/llvm/llvm-project/pull/108769 If the type of an enumeration is not native (e.g. uint8_t) but is unsigned then evaluation of the value might get wrong: for values bigger than half of type range the return value will be negative. This happens