Skip to content

Commit 293cda1

Browse files
committed
Make sure to override source info
1 parent cc0bdd7 commit 293cda1

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/kirin/rewrite/inline.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,12 @@ def inline_call_like(
9898
# NOTE: we cannot change region because it may be used elsewhere
9999
inline_region: ir.Region = region.clone()
100100

101-
# Preserve source information by attributing inlined code to the call site
101+
# Override source information with the inlined code source
102102
if call_like.source is not None:
103103
for block in inline_region.blocks:
104-
if block.source is None:
105-
block.source = call_like.source
104+
block.source = call_like.source
106105
for stmt in block.stmts:
107-
if stmt.source is None:
108-
stmt.source = call_like.source
106+
stmt.source = call_like.source
109107

110108
parent_block: ir.Block = call_like.parent_block
111109
parent_region: ir.Region = call_like.parent_region

0 commit comments

Comments
 (0)