[all-commits] [llvm/llvm-project] 45bddc: [CIR] Fix insertion point tracking for switch with...

Andy Kaylor via All-commits all-commits at lists.llvm.org
Tue Jun 2 18:24:19 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 45bddca21c65106b41fa47a485a30c863e75da53
      https://github.com/llvm/llvm-project/commit/45bddca21c65106b41fa47a485a30c863e75da53
  Author: Andy Kaylor <akaylor at nvidia.com>
  Date:   2026-06-02 (Tue, 02 Jun 2026)

  Changed paths:
    M clang/lib/CIR/CodeGen/CIRGenCleanup.cpp
    M clang/lib/CIR/CodeGen/CIRGenStmt.cpp
    A clang/test/CIR/CodeGen/switch-cleanup.cpp

  Log Message:
  -----------
  [CIR] Fix insertion point tracking for switch with cleanups (#201210)

We had some problems where we would incorrectly maintain the insertion
point for switch statements that contained cleanup scopes. This resulted
in cir.scope statements without a terminator, tripping a verification
error.

This change adds a RunCleanupsScope RAII object for the switch statement
and adds a check inside popCleanup() to avoid moving the insertion point
to the point after the now-closed cleanup scope if the insertion point
had previously been somewhere other than inside the cleanup scope.

Assisted-by: Cursor / claude-opus-4.8



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list