aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/ControlFlowGen.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/CodeGen/ControlFlowGen.cc')
-rw-r--r--lib/CodeGen/ControlFlowGen.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/ControlFlowGen.cc b/lib/CodeGen/ControlFlowGen.cc
index d34f640..17f43f2 100644
--- a/lib/CodeGen/ControlFlowGen.cc
+++ b/lib/CodeGen/ControlFlowGen.cc
@@ -190,6 +190,7 @@ void CodeGen::emitCaseStmt(CaseStmtAST *Stmt) {
auto *After = BasicBlock::Create(*TheContext, "case_cont", F);
auto SavedArrays = Arrays->snapshotTable();
for (const auto &Branch : Stmt->getBranches()) {
+ SaveAndRestore<int> Location(DiagnosticLine, Branch.Line);
auto *Body = BasicBlock::Create(*TheContext, "case_body", F);
auto *Next = BasicBlock::Create(*TheContext, "case_next", F);
auto Compare = [&](int Op, ExprAST *Label) -> Value * {
@@ -199,7 +200,7 @@ void CodeGen::emitCaseStmt(CaseStmtAST *Stmt) {
}
const TypeInfo *LabelType = getExprTypeInfo(Label);
if (!LabelType) {
- reportError("Cannot determine CASE label type at line %d", Branch.Line);
+ reportError("Cannot determine CASE label type");
return nullptr;
}
Value *LabelValue = emitExpr(Label);