From 0cf54b4f77ccf8376341950b02ceb7c1d1268ed7 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Fri, 30 Oct 2026 14:31:07 +0000 Subject: refactor(strings): construct string values implicitly from raw literals Keep double-quoted literals and text constants as C_STRING values. Use marked STRING constructors for text and CHAR conversion, preserving string operations and I/O through the existing class machinery. Co-Authored-By: Claude Opus 5.5 --- lib/CodeGen/ControlFlowGen.cc | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'lib/CodeGen/ControlFlowGen.cc') diff --git a/lib/CodeGen/ControlFlowGen.cc b/lib/CodeGen/ControlFlowGen.cc index fe9a954..3d16098 100644 --- a/lib/CodeGen/ControlFlowGen.cc +++ b/lib/CodeGen/ControlFlowGen.cc @@ -216,18 +216,7 @@ void CodeGen::emitCaseStmt(CaseStmtAST *Stmt) { Value *LabelValue = emitExpr(Label); Value *LeftValue = Selected; const TypeInfo *LeftType = SelectorType; - bool LabelConverted = false; - // CHAR and STRING compare as STRING. - if (SelectorType->isString() && LabelType->Kind == TypeKind::Char) { - LabelValue = emitStringFromChar(LabelValue); - LabelType = SelectorType; - LabelConverted = true; - } else if (SelectorType->Kind == TypeKind::Char && LabelType->isString()) { - LeftValue = emitStringFromChar(Selected); - if (LeftValue) materializeOperatorReceiver(LeftValue, LabelType); - LeftType = LabelType; - } - if (containsString(LabelType) && (LabelConverted || !isObjectLValue(Label))) + if (containsString(LabelType) && !isObjectLValue(Label)) materializeOperatorReceiver(LabelValue, LabelType); ResultContext BoolContext{resolveType("BOOLEAN"), true}; auto Overload = resolveOperator(Op, LeftType, LabelType, &BoolContext); -- cgit v1.3.1-4-g156e