Skip to content

[Sema] Remove an unnecessary cast (NFC) #147203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kazutakahirata
Copy link
Contributor

StorageClass is already of spirv::StorageClass.

StorageClass is already of spirv::StorageClass.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" backend:SPIR-V labels Jul 6, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 6, 2025

@llvm/pr-subscribers-clang

Author: Kazu Hirata (kazutakahirata)

Changes

StorageClass is already of spirv::StorageClass.


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

1 Files Affected:

  • (modified) clang/lib/Sema/SemaSPIRV.cpp (+1-1)
diff --git a/clang/lib/Sema/SemaSPIRV.cpp b/clang/lib/Sema/SemaSPIRV.cpp
index c27d3fed2b990..76d3cff908b37 100644
--- a/clang/lib/Sema/SemaSPIRV.cpp
+++ b/clang/lib/Sema/SemaSPIRV.cpp
@@ -116,7 +116,7 @@ static bool checkGenericCastToPtr(Sema &SemaRef, CallExpr *Call) {
   RT = RT->getPointeeType();
   auto Qual = RT.getQualifiers();
   LangAS AddrSpace;
-  switch (static_cast<spirv::StorageClass>(StorageClass)) {
+  switch (StorageClass) {
   case spirv::StorageClass::CrossWorkgroup:
     AddrSpace =
         SemaRef.LangOpts.isSYCL() ? LangAS::sycl_global : LangAS::opencl_global;

@llvmbot
Copy link
Member

llvmbot commented Jul 6, 2025

@llvm/pr-subscribers-backend-spir-v

Author: Kazu Hirata (kazutakahirata)

Changes

StorageClass is already of spirv::StorageClass.


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

1 Files Affected:

  • (modified) clang/lib/Sema/SemaSPIRV.cpp (+1-1)
diff --git a/clang/lib/Sema/SemaSPIRV.cpp b/clang/lib/Sema/SemaSPIRV.cpp
index c27d3fed2b990..76d3cff908b37 100644
--- a/clang/lib/Sema/SemaSPIRV.cpp
+++ b/clang/lib/Sema/SemaSPIRV.cpp
@@ -116,7 +116,7 @@ static bool checkGenericCastToPtr(Sema &SemaRef, CallExpr *Call) {
   RT = RT->getPointeeType();
   auto Qual = RT.getQualifiers();
   LangAS AddrSpace;
-  switch (static_cast<spirv::StorageClass>(StorageClass)) {
+  switch (StorageClass) {
   case spirv::StorageClass::CrossWorkgroup:
     AddrSpace =
         SemaRef.LangOpts.isSYCL() ? LangAS::sycl_global : LangAS::opencl_global;

@kazutakahirata kazutakahirata merged commit 9d8a1be into llvm:main Jul 7, 2025
13 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250706_cast_clang_Sema branch July 7, 2025 04:06
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 7, 2025

LLVM Buildbot has detected a new failure on builder lldb-x86_64-win running on as-builder-10 while building clang at step 8 "test-check-lldb-unit".

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

Here is the relevant piece of the build log for the reference
Step 8 (test-check-lldb-unit) failure: Test just built components: check-lldb-unit completed (failure)
******************** TEST 'lldb-unit :: Host/./HostTests.exe/31/87' FAILED ********************
Script(shard):
--
GTEST_OUTPUT=json:C:\buildbot\as-builder-10\lldb-x86-64\build\tools\lldb\unittests\Host\.\HostTests.exe-lldb-unit-14604-31-87.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=87 GTEST_SHARD_INDEX=31 C:\buildbot\as-builder-10\lldb-x86-64\build\tools\lldb\unittests\Host\.\HostTests.exe
--

Script:
--
C:\buildbot\as-builder-10\lldb-x86-64\build\tools\lldb\unittests\Host\.\HostTests.exe --gtest_filter=MainLoopTest.NoSpuriousPipeReads
--
C:\buildbot\as-builder-10\lldb-x86-64\llvm-project\lldb\unittests\Host\MainLoopTest.cpp(141): error: Expected equality of these values:
  1u
    Which is: 1
  callback_count
    Which is: 2


C:\buildbot\as-builder-10\lldb-x86-64\llvm-project\lldb\unittests\Host\MainLoopTest.cpp:141
Expected equality of these values:
  1u
    Which is: 1
  callback_count
    Which is: 2



********************


@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 7, 2025

LLVM Buildbot has detected a new failure on builder lldb-aarch64-windows running on linaro-armv8-windows-msvc-05 while building clang at step 6 "test".

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

Here is the relevant piece of the build log for the reference
Step 6 (test) failure: build (failure)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:SPIR-V clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants