[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 17:01:26 PST 2026
================
@@ -1106,6 +1106,7 @@ mlir::LogicalResult CIRGenFunction::emitSwitchStmt(const clang::SwitchStmt &s) {
terminateBody(builder, caseOp.getCaseRegion(), caseOp.getLoc());
terminateBody(builder, swop.getBody(), swop.getLoc());
+ swop.setHandlingEnum(s.getCond()->IgnoreParenImpCasts()->getType()->isEnumeralType());
----------------
badumbatish wrote:
this assert should only be added if we're combining the two enum yes? I think a discussion needs to be had on 2 separate enums in https://github.com/llvm/llvm-project/pull/172236#discussion_r2656701499
https://github.com/llvm/llvm-project/pull/172236
More information about the cfe-commits
mailing list