Skip to content

Commit c60f0f3

Browse files
committed
Add undefined value support
1 parent 344b29a commit c60f0f3

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/value.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ impl Value {
2929
core::LLVMConstStringInContext(context.into(), ptr, len, rust_style as c_int).into()
3030
}
3131
}
32+
/// Create a new constant undefined value of the given type.
33+
pub fn new_undef<'a>(ty: &'a Type) -> &'a Value {
34+
unsafe { core::LLVMGetUndef(ty.into()).into() }
35+
}
3236
/// Returns the name of this value, or `None` if itlacks a name
3337
pub fn get_name(&self) -> Option<&str> {
3438
unsafe {

0 commit comments

Comments
 (0)