Skip to content

Conversation

@mlechu
Copy link
Member

@mlechu mlechu commented Feb 12, 2026

Given that @ast is the main way we build trees, we can do a neat trick: store the calling line in the tree it created. I've been using this locally, and it's been helpful for debugging.

Also refactor our use of ensure_attributes so new ones don't need to be added in many separate places.

@topolarity
Copy link
Member

Nice utility!

Should this be put behind a compile-time flag, so that we can disable it for profiling / public releases?

@mlechu
Copy link
Member Author

mlechu commented Feb 12, 2026

Sure, though I'd like to not require a debug build to use it at the moment. Is there an existing flag I can use, or should I make a lowering-specific one?

@topolarity
Copy link
Member

Sure, though I'd like to not require a debug build to use it at the moment. Is there an existing flag I can use, or should I make a lowering-specific one?

Yep, fine by me if it's on almost all the time for now.

There is Core.Compiler.is_asserts(), but it sounds like you'll want a lowering-specific flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants