Skip to content

Commit e3a6f54

Browse files
committed
Added deny on missing_docs for basic_block.rs
1 parent c040d48 commit e3a6f54

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/basic_block.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! A `BasicBlock` is a container of instructions.
2+
13
use llvm_sys::core::{LLVMGetBasicBlockParent, LLVMGetBasicBlockTerminator, LLVMGetNextBasicBlock, LLVMInsertBasicBlock, LLVMIsABasicBlock, LLVMIsConstant, LLVMMoveBasicBlockAfter, LLVMMoveBasicBlockBefore, LLVMPrintTypeToString, LLVMPrintValueToString, LLVMTypeOf, LLVMDeleteBasicBlock, LLVMGetPreviousBasicBlock, LLVMRemoveBasicBlockFromParent, LLVMGetFirstInstruction, LLVMGetLastInstruction, LLVMGetTypeContext, LLVMBasicBlockAsValue};
24
use llvm_sys::prelude::{LLVMValueRef, LLVMBasicBlockRef};
35

@@ -8,8 +10,13 @@ use std::fmt;
810
use std::ffi::{CStr, CString};
911
use std::rc::Rc;
1012

11-
// Apparently BasicBlocks count as LabelTypeKinds, which is
12-
// why they're allow to be casted to values?
13+
/// A `BasicBlock` is a container of instructions.
14+
///
15+
/// `BasicBlock`s are values because they can be referenced by instructions (ie branching and switches).
16+
///
17+
/// A well formed `BasicBlock` is a list of non terminating instructions followed by a single terminating
18+
/// instruction. `BasicBlock`s are allowed to be malformed prior to running validation because it may be useful
19+
/// when constructing or modifying a program.
1320
#[derive(PartialEq, Eq)]
1421
pub struct BasicBlock {
1522
pub(crate) basic_block: LLVMBasicBlockRef,

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ extern crate enum_methods;
55
extern crate libc;
66
extern crate llvm_sys;
77

8+
#[deny(missing_docs)]
89
pub mod basic_block;
910
pub mod builder;
1011
pub mod context;

0 commit comments

Comments
 (0)