[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (yronglin) Changes This PR fix the issue reported by @alexfh PR https://github.com/llvm/llvm-project/pull/89567 fix the `#pragma unroll N` crash issue in dependent context, but it's introduce an new issue: If `N` is value dependent

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-26 Thread via cfe-commits
https://github.com/yronglin updated https://github.com/llvm/llvm-project/pull/90240 >From 131783211a23d007b5b6f1d5691306df4dec716b Mon Sep 17 00:00:00 2001 From: yronglin Date: Sat, 27 Apr 2024 01:38:34 +0800 Subject: [PATCH 1/2] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in depe

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-26 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff bf67610a8ac07ec143f243f129eecd456aa63383 131783211a23d007b5b6f1d5691306df4dec716b --

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-26 Thread via cfe-commits
https://github.com/yronglin created https://github.com/llvm/llvm-project/pull/90240 This PR fix the issue reported by @alexfh PR https://github.com/llvm/llvm-project/pull/89567 fix the `#pragma unroll N` crash issue in dependent context, but it's introduce an new issue: If `N` is value depen

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-26 Thread via cfe-commits
yronglin wrote: I'd like to add more test to check CodeGen works well. https://github.com/llvm/llvm-project/pull/90240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -109,16 +109,20 @@ static Attr *handleLoopHintAttr(Sema &S, Stmt *St, const ParsedAttr &A, SetHints(LoopHintAttr::Unroll, LoopHintAttr::Disable); } else if (PragmaName == "unroll") { // #pragma unroll N -if (ValueExpr && !ValueExpr->isValueDependent()) { -

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -109,16 +109,20 @@ static Attr *handleLoopHintAttr(Sema &S, Stmt *St, const ParsedAttr &A, SetHints(LoopHintAttr::Unroll, LoopHintAttr::Disable); } else if (PragmaName == "unroll") { // #pragma unroll N -if (ValueExpr && !ValueExpr->isValueDependent()) { -

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-26 Thread Erich Keane via cfe-commits
@@ -124,3 +124,40 @@ void test(int *List, int Length) { #pragma unroll /* expected-error {{expected statement}} */ } + +using size_t = unsigned long long; + +template erichkeane wrote: This test isn't particularly good, since it is validating that it 'parses

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-27 Thread via cfe-commits
@@ -124,3 +124,40 @@ void test(int *List, int Length) { #pragma unroll /* expected-error {{expected statement}} */ } + +using size_t = unsigned long long; + +template yronglin wrote: Agree! https://github.com/llvm/llvm-project/pull/90240 ___

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-27 Thread via cfe-commits
@@ -109,16 +109,20 @@ static Attr *handleLoopHintAttr(Sema &S, Stmt *St, const ParsedAttr &A, SetHints(LoopHintAttr::Unroll, LoopHintAttr::Disable); } else if (PragmaName == "unroll") { // #pragma unroll N -if (ValueExpr && !ValueExpr->isValueDependent()) { -

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-27 Thread via cfe-commits
@@ -109,16 +109,20 @@ static Attr *handleLoopHintAttr(Sema &S, Stmt *St, const ParsedAttr &A, SetHints(LoopHintAttr::Unroll, LoopHintAttr::Disable); } else if (PragmaName == "unroll") { // #pragma unroll N -if (ValueExpr && !ValueExpr->isValueDependent()) { -

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-27 Thread via cfe-commits
yronglin wrote: I have question, for the case `#pragma unroll {0|1}`, which AST attribute node make sense? 1. ``` LoopHintAttr 0x14b0bae08 Implicit unroll Unroll Disable ``` or 2. ``` LoopHintAttr 0x15780a408 Implicit unroll UnrollCount Numeric ``` Do we need accurate AST or real semantics

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-27 Thread via cfe-commits
https://github.com/yronglin updated https://github.com/llvm/llvm-project/pull/90240 >From 131783211a23d007b5b6f1d5691306df4dec716b Mon Sep 17 00:00:00 2001 From: yronglin Date: Sat, 27 Apr 2024 01:38:34 +0800 Subject: [PATCH 1/3] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in depe

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-27 Thread via cfe-commits
https://github.com/yronglin updated https://github.com/llvm/llvm-project/pull/90240 >From 131783211a23d007b5b6f1d5691306df4dec716b Mon Sep 17 00:00:00 2001 From: yronglin Date: Sat, 27 Apr 2024 01:38:34 +0800 Subject: [PATCH 1/4] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in depe

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-27 Thread via cfe-commits
@@ -124,3 +124,40 @@ void test(int *List, int Length) { #pragma unroll /* expected-error {{expected statement}} */ } + +using size_t = unsigned long long; + +template yronglin wrote: I've keep test case in this file, because clang currently has this issue h

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-27 Thread via cfe-commits
https://github.com/yronglin updated https://github.com/llvm/llvm-project/pull/90240 >From 131783211a23d007b5b6f1d5691306df4dec716b Mon Sep 17 00:00:00 2001 From: yronglin Date: Sat, 27 Apr 2024 01:38:34 +0800 Subject: [PATCH 1/5] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in depe

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-27 Thread via cfe-commits
https://github.com/yronglin edited https://github.com/llvm/llvm-project/pull/90240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-28 Thread via cfe-commits
https://github.com/yronglin updated https://github.com/llvm/llvm-project/pull/90240 >From 131783211a23d007b5b6f1d5691306df4dec716b Mon Sep 17 00:00:00 2001 From: yronglin Date: Sat, 27 Apr 2024 01:38:34 +0800 Subject: [PATCH 1/5] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in depe

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-29 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/90240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-29 Thread via cfe-commits
yronglin wrote: Thanks for your review! https://github.com/llvm/llvm-project/pull/90240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Fix incorrect handling of #pragma {GCC} unroll N in dependent context (PR #90240)

2024-04-29 Thread via cfe-commits
https://github.com/yronglin closed https://github.com/llvm/llvm-project/pull/90240 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits