[clang] [clang][Interp] Implement ComplexToReal casts (PR #77294)

2024-01-18 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr closed https://github.com/llvm/llvm-project/pull/77294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[clang] [clang][Interp] Implement ComplexToReal casts (PR #77294)

2024-01-15 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= , Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/77294 >From 5f6a91cd7f709a3c94c65dc4ea41b5967b9fe343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 8 Jan 2024 11:14

[clang] [clang][Interp] Implement ComplexToReal casts (PR #77294)

2024-01-15 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: @@ -37,6 +37,18 @@ constexpr _Complex int I2 = {}; static_assert(__real(I2) == 0, ""); static_assert(__imag(I2) == 0, ""); +constexpr int ignoredCast() { + I2; + (int)I2; + (float)I2; + D1; + (int)D1; + (double)D1;

[clang] [clang][Interp] Implement ComplexToReal casts (PR #77294)

2024-01-15 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?B=C3=A4der?= Message-ID: In-Reply-To: https://github.com/AaronBallman approved this pull request. LGTM with a testing request https://github.com/llvm/llvm-project/pull/77294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[clang] [clang][Interp] Implement ComplexToReal casts (PR #77294)

2024-01-15 Thread Aaron Ballman via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/77294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement ComplexToReal casts (PR #77294)

2024-01-15 Thread Timm Baeder via cfe-commits
Timm =?utf-8?q?Bäder?= Message-ID: In-Reply-To: https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/77294 >From 4c9d611f5ae8cbad083811261e08954d92b0ca41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Mon, 8 Jan 2024 11:14:41 +0100 Subject: [PATCH

[clang] [clang][Interp] Implement ComplexToReal casts (PR #77294)

2024-01-15 Thread Timm Baeder via cfe-commits
tbaederr wrote: Ping https://github.com/llvm/llvm-project/pull/77294 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Interp] Implement ComplexToReal casts (PR #77294)

2024-01-08 Thread Timm Baeder via cfe-commits
@@ -37,6 +37,18 @@ constexpr _Complex int I2 = {}; static_assert(__real(I2) == 0, ""); static_assert(__imag(I2) == 0, ""); +constexpr int ignoredCast() { + I2; + (int)I2; + /* (float)I2; FIXME*/ + D1; + /* (int)D1; FIXME*/ tbaederr wrote: The commented-o

[clang] [clang][Interp] Implement ComplexToReal casts (PR #77294)

2024-01-08 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Timm Baeder (tbaederr) Changes Add a new emitComplexReal() helper function and use that for the new casts as well as the old __real implementation. --- Full diff: https://github.com/llvm/llvm-project/pull/77294.diff 3 Files Affected: -

[clang] [clang][Interp] Implement ComplexToReal casts (PR #77294)

2024-01-08 Thread Timm Baeder via cfe-commits
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/77294 Add a new emitComplexReal() helper function and use that for the new casts as well as the old __real implementation. >From 1d657e65f69f3b6d4be3ce08c5f39f73d8fc04b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=