Skip to content

feat: make BasicBlock::new publicly accessible - #601

Merged
TheDan64 merged 4 commits into
TheDan64:masterfrom
fuqiuluo:master
Sep 3, 2025
Merged

feat: make BasicBlock::new publicly accessible#601
TheDan64 merged 4 commits into
TheDan64:masterfrom
fuqiuluo:master

Conversation

@fuqiuluo

Copy link
Copy Markdown
Contributor

Description

Makes the BasicBlock::new method publicly accessible by changing its visibility from pub(crate) to pub.

Motivation

Currently, the BasicBlock::new method is only accessible within the crate, which limits external users' ability to create BasicBlock instances directly from LLVMBasicBlockRef. This change allows users to have more direct control over BasicBlock creation when working with LLVM C API interop scenarios.

Changes

  • Changed visibility of BasicBlock::new from pub(crate) to pub in src/basic_block.rs

Checklist

  • I am basing my changes off master
  • I have run cargo clippy and updated portions of code pertaining to my changes
  • I will keep my code reasonably up to date via rebasing over merging whenever possible

Notes

This is a non-breaking change that only expands the public API surface. The method signature and behavior remain unchanged - it still safely handles null pointer checks and returns Option<Self>.

@TheDan64
TheDan64 self-requested a review September 3, 2025 05:59
@TheDan64

TheDan64 commented Sep 3, 2025

Copy link
Copy Markdown
Owner

Thanks!

@TheDan64

TheDan64 commented Sep 3, 2025

Copy link
Copy Markdown
Owner

@fuqiuluo please add a doc comment to the method; thanks!

@fuqiuluo

fuqiuluo commented Sep 3, 2025

Copy link
Copy Markdown
Contributor Author

done! add a doc comment

@TheDan64
TheDan64 merged commit e29a3d0 into TheDan64:master Sep 3, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants