Skip to content

Conversation

@dkolsen-pgi
Copy link
Contributor

Fix a compiler warning in CIRGenConsumer::HandleTranslationUnit in clang/lib/CIR/FrontendAction/CIRGenAction.cpp. The warning was about a default: section in a switch statement that already covered all the values of an enum. Delete the default: section.

Fix a compiler warning in `CIRGenConsumer::HandleTranslationUnit` in
`clang/lib/CIR/FrontendAction/CIRGenAction.cpp`.  The warning was about a
`default:` section in a switch statement that already covered all the
values of an enum.  Delete the `default:` section.
@llvmbot llvmbot added clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project labels Dec 2, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 2, 2024

@llvm/pr-subscribers-clang

Author: David Olsen (dkolsen-pgi)

Changes

Fix a compiler warning in CIRGenConsumer::HandleTranslationUnit in clang/lib/CIR/FrontendAction/CIRGenAction.cpp. The warning was about a default: section in a switch statement that already covered all the values of an enum. Delete the default: section.


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

1 Files Affected:

  • (modified) clang/lib/CIR/FrontendAction/CIRGenAction.cpp (-3)
diff --git a/clang/lib/CIR/FrontendAction/CIRGenAction.cpp b/clang/lib/CIR/FrontendAction/CIRGenAction.cpp
index 5a31e207081936..21b6bc56ed0503 100644
--- a/clang/lib/CIR/FrontendAction/CIRGenAction.cpp
+++ b/clang/lib/CIR/FrontendAction/CIRGenAction.cpp
@@ -66,9 +66,6 @@ class CIRGenConsumer : public clang::ASTConsumer {
         MlirModule->print(*OutputStream, Flags);
       }
       break;
-    default:
-      llvm_unreachable("NYI: CIRGenAction other than EmitCIR");
-      break;
     }
   }
 };

@llvmbot
Copy link
Member

llvmbot commented Dec 2, 2024

@llvm/pr-subscribers-clangir

Author: David Olsen (dkolsen-pgi)

Changes

Fix a compiler warning in CIRGenConsumer::HandleTranslationUnit in clang/lib/CIR/FrontendAction/CIRGenAction.cpp. The warning was about a default: section in a switch statement that already covered all the values of an enum. Delete the default: section.


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

1 Files Affected:

  • (modified) clang/lib/CIR/FrontendAction/CIRGenAction.cpp (-3)
diff --git a/clang/lib/CIR/FrontendAction/CIRGenAction.cpp b/clang/lib/CIR/FrontendAction/CIRGenAction.cpp
index 5a31e207081936..21b6bc56ed0503 100644
--- a/clang/lib/CIR/FrontendAction/CIRGenAction.cpp
+++ b/clang/lib/CIR/FrontendAction/CIRGenAction.cpp
@@ -66,9 +66,6 @@ class CIRGenConsumer : public clang::ASTConsumer {
         MlirModule->print(*OutputStream, Flags);
       }
       break;
-    default:
-      llvm_unreachable("NYI: CIRGenAction other than EmitCIR");
-      break;
     }
   }
 };

Copy link
Collaborator

@erichkeane erichkeane left a comment

Choose a reason for hiding this comment

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

LGTM!

@dkolsen-pgi dkolsen-pgi merged commit eaa4eb2 into llvm:main Dec 2, 2024
11 checks passed
@dkolsen-pgi dkolsen-pgi deleted the bug/warning-switch-CIRGenAction branch December 2, 2024 21:20
bcardosolopes pushed a commit to bcardosolopes/llvm-project that referenced this pull request Mar 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants