[clang] [CIR] Add the ability to detect enum argument for switch op (PR #172236)

Jasmine Tang via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 1 16:42:18 PST 2026


================
@@ -1282,7 +1282,7 @@ void testSwitchCoverAllCase(M m) {
     break;
   }
 }
-// CIR: cir.switch(%[[ARG:.*]] : !s32i) allEnumCasesCovered {
+// CIR: cir.switch(%[[ARG:.*]] : !s32i) allEnumCasesCovered handling_enum {
----------------
badumbatish wrote:

I think the problem is what if we're handling enum but then not all enum cases are covered? then using a single boolean we wouldn't be able to tell if the switch argument is an enum or not

https://github.com/llvm/llvm-project/pull/172236


More information about the cfe-commits mailing list