https://github.com/Sirraide closed
https://github.com/llvm/llvm-project/pull/83063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/AaronBallman approved this pull request.
LGTM, thank you for the fix!
https://github.com/llvm/llvm-project/pull/83063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Sirraide wrote:
Alright, just checking that the AST dump doesn’t contain
`FloatingRealToComplex` seems to work pretty well.
https://github.com/llvm/llvm-project/pull/83063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/
https://github.com/Sirraide updated
https://github.com/llvm/llvm-project/pull/83063
>From 5418bec794ad1df54f49a1c8d317a75d56290239 Mon Sep 17 00:00:00 2001
From: Sirraide
Date: Mon, 26 Feb 2024 19:53:42 +0100
Subject: [PATCH 1/4] [Clang] [Sema] Remove incorrect int-to-complex-float
conversion
@@ -0,0 +1,143 @@
+// RUN: %clang_cc1 %s -O0 -emit-llvm -triple x86_64-unknown-unknown -o - |
FileCheck %s --check-prefix=X86
+
+// Check that for 'F _Complex + int' (F = real floating-point type), we emit an
+// implicit cast from 'int' to 'F', but NOT to 'F _Complex' (i.e. that
@@ -0,0 +1,143 @@
+// RUN: %clang_cc1 %s -O0 -emit-llvm -triple x86_64-unknown-unknown -o - |
FileCheck %s --check-prefix=X86
+
+// Check that for 'F _Complex + int' (F = real floating-point type), we emit an
+// implicit cast from 'int' to 'F', but NOT to 'F _Complex' (i.e. that
Sirraide wrote:
@jcranmer-intel @AaronBallman Do you think there’s anything else that needs to
be done here, or is it fine as-is?
https://github.com/llvm/llvm-project/pull/83063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llv
@@ -0,0 +1,143 @@
+// RUN: %clang_cc1 %s -O0 -emit-llvm -triple x86_64-unknown-unknown -o - |
FileCheck %s --check-prefix=X86
+
+// Check that for 'F _Complex + int' (F = real floating-point type), we emit an
+// implicit cast from 'int' to 'F', but NOT to 'F _Complex' (i.e. that
@@ -1114,8 +1114,6 @@ static bool handleIntegerToComplexFloatConversion(Sema
&S, ExprResult &IntExpr,
if (IntTy->isIntegerType()) {
QualType fpTy = ComplexTy->castAs()->getElementType();
IntExpr = S.ImpCastExprToType(IntExpr.get(), fpTy, CK_IntegralToFloating);
-
https://github.com/Sirraide updated
https://github.com/llvm/llvm-project/pull/83063
>From 5418bec794ad1df54f49a1c8d317a75d56290239 Mon Sep 17 00:00:00 2001
From: Sirraide
Date: Mon, 26 Feb 2024 19:53:42 +0100
Subject: [PATCH 1/3] [Clang] [Sema] Remove incorrect int-to-complex-float
conversion
@@ -0,0 +1,143 @@
+// RUN: %clang_cc1 %s -O0 -emit-llvm -triple x86_64-unknown-unknown -o - |
FileCheck %s --check-prefix=X86
+
+// Check that for 'F _Complex + int' (F = real floating-point type), we emit an
+// implicit cast from 'int' to 'F', but NOT to 'F _Complex' (i.e. that
@@ -1114,8 +1114,6 @@ static bool handleIntegerToComplexFloatConversion(Sema
&S, ExprResult &IntExpr,
if (IntTy->isIntegerType()) {
QualType fpTy = ComplexTy->castAs()->getElementType();
IntExpr = S.ImpCastExprToType(IntExpr.get(), fpTy, CK_IntegralToFloating);
-
@@ -0,0 +1,143 @@
+// RUN: %clang_cc1 %s -O0 -emit-llvm -triple x86_64-unknown-unknown -o - |
FileCheck %s --check-prefix=X86
+
+// Check that for 'F _Complex + int' (F = real floating-point type), we emit an
+// implicit cast from 'int' to 'F', but NOT to 'F _Complex' (i.e. that
@@ -1114,8 +1114,6 @@ static bool handleIntegerToComplexFloatConversion(Sema
&S, ExprResult &IntExpr,
if (IntTy->isIntegerType()) {
QualType fpTy = ComplexTy->castAs()->getElementType();
IntExpr = S.ImpCastExprToType(IntExpr.get(), fpTy, CK_IntegralToFloating);
-
https://github.com/Sirraide updated
https://github.com/llvm/llvm-project/pull/83063
>From 5418bec794ad1df54f49a1c8d317a75d56290239 Mon Sep 17 00:00:00 2001
From: Sirraide
Date: Mon, 26 Feb 2024 19:53:42 +0100
Subject: [PATCH 1/2] [Clang] [Sema] Remove incorrect int-to-complex-float
conversion
Sirraide wrote:
> > Since this is a relatively benign bug, all things considered, does this
> > even warrant a release note?
>
> I think it should have a release note; it changes the layout of the AST which
> may impact folks writing AST matchers (clang-tidy checks, etc). But also, I
> think
AaronBallman wrote:
> Since this is a relatively benign bug, all things considered, does this even
> warrant a release note?
I think it should have a release note; it changes the layout of the AST which
may impact folks writing AST matchers (clang-tidy checks, etc). But also, I
think it does
Sirraide wrote:
>From what I can tell, this also fixes #31205
https://github.com/llvm/llvm-project/pull/83063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Sirraide wrote:
Since this is a relatively benign bug, all things considered, does this even
warrant a release note?
https://github.com/llvm/llvm-project/pull/83063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin
@@ -10,34 +10,32 @@ _Complex float cf;
int volatile vol =10;
void f0() {
const_cast(cf) = const_cast(cf) + 1;
-// CHECK: %cf.real = load volatile float, ptr @cf
-// CHECK: %cf.imag = load volatile float, ptr getelementptr
-// CHECK: %add.r = fadd float %cf.real, 1.00
Sirraide wrote:
CC @AaronBallman
https://github.com/llvm/llvm-project/pull/83063
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: None (Sirraide)
Changes
C23 6.3.1.8 ‘Usual arithmetic conversions’ p1 states (emphasis mine):
> Otherwise, if the corresponding real type of either operand is `float`,
the other operand is converted, *without change of type domain*, to a
https://github.com/Sirraide created
https://github.com/llvm/llvm-project/pull/83063
C23 6.3.1.8 ‘Usual arithmetic conversions’ p1 states (emphasis mine):
> Otherwise, if the corresponding real type of either operand is `float`, the
> other operand is converted, *without change of type domain*,
23 matches
Mail list logo