Skip to content

Conversation

@kkwli
Copy link
Collaborator

@kkwli kkwli commented Oct 10, 2025

Fix the compile error:

llvm-project/flang/lib/Lower/OpenMP/OpenMP.cpp:3386:32: error: variable 'dir' set but not used [-Werror,-Wunused-but-set-variable]
 3386 |   switch (llvm::omp::Directive dir = item->id) {
      |                                ^
1 error generated.

@kkwli kkwli requested a review from kparzysz October 10, 2025 17:32
@kkwli kkwli self-assigned this Oct 10, 2025
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:fir-hlfir labels Oct 10, 2025
@llvmbot
Copy link
Member

llvmbot commented Oct 10, 2025

@llvm/pr-subscribers-flang-fir-hlfir

Author: Kelvin Li (kkwli)

Changes

Fix the compile error:

llvm-project/flang/lib/Lower/OpenMP/OpenMP.cpp:3386:32: error: variable 'dir' set but not used [-Werror,-Wunused-but-set-variable]
 3386 |   switch (llvm::omp::Directive dir = item->id) {
      |                                ^
1 error generated.

Full diff: https://github.com/llvm/llvm-project/pull/162894.diff

1 Files Affected:

  • (modified) flang/lib/Lower/OpenMP/OpenMP.cpp (+2-1)
diff --git a/flang/lib/Lower/OpenMP/OpenMP.cpp b/flang/lib/Lower/OpenMP/OpenMP.cpp
index bd94651919960..444f27471020b 100644
--- a/flang/lib/Lower/OpenMP/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP/OpenMP.cpp
@@ -3383,7 +3383,8 @@ static void genOMPDispatch(lower::AbstractConverter &converter,
     }
   }
 
-  switch (llvm::omp::Directive dir = item->id) {
+  llvm::omp::Directive dir = item->id;
+  switch (dir) {
   case llvm::omp::Directive::OMPD_barrier:
     newOp = genBarrierOp(converter, symTable, semaCtx, eval, loc, queue, item);
     break;

@kkwli kkwli requested a review from DanielCChen October 10, 2025 17:41
Copy link
Contributor

@DanielCChen DanielCChen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@kkwli kkwli merged commit 7eee672 into llvm:main Oct 11, 2025
13 checks passed
@kkwli kkwli deleted the fix-bld branch October 11, 2025 13:48
DharuniRAcharya pushed a commit to DharuniRAcharya/llvm-project that referenced this pull request Oct 13, 2025
akadutta pushed a commit to akadutta/llvm-project that referenced this pull request Oct 14, 2025
@llvm-ci
Copy link
Collaborator

llvm-ci commented Oct 22, 2025

LLVM Buildbot has detected a new failure on builder ppc64le-flang-rhel-clang running on ppc64le-flang-rhel-test while building flang at step 6 "test-build-unified-tree-check-flang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/157/builds/41660

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-flang) failure: 1200 seconds without output running [b'ninja', b'check-flang'], attempting to kill
...
PASS: Flang :: Semantics/typeinfo09.f90 (3876 of 3886)
PASS: Flang :: Transforms/constant-argument-globalisation.fir (3877 of 3886)
PASS: Flang :: Transforms/tbaa4.fir (3878 of 3886)
PASS: Flang :: Transforms/stack-arrays.f90 (3879 of 3886)
PASS: Flang :: Transforms/tbaa3.fir (3880 of 3886)
PASS: Flang :: Transforms/debug-dwarf-version.fir (3881 of 3886)
PASS: Flang :: Transforms/tbaa-local-alloc-threshold.fir (3882 of 3886)
PASS: Flang :: Driver/omp-driver-offload.f90 (3883 of 3886)
PASS: Flang :: Lower/OpenMP/rtl-flags.f90 (3884 of 3886)
PASS: Flang :: Intrinsics/math-codegen.fir (3885 of 3886)
command timed out: 1200 seconds without output running [b'ninja', b'check-flang'], attempting to kill
process killed by signal 9
program finished with exit code -1
elapsedTime=3398.921574

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flang:fir-hlfir flang Flang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants