Treat undef bytes as equal to any other byte
This commit is contained in:
@@ -126,6 +126,10 @@ impl<'ll, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> {
|
||||
unsafe { llvm::LLVMGetUndef(t) }
|
||||
}
|
||||
|
||||
fn is_undef(&self, v: &'ll Value) -> bool {
|
||||
unsafe { llvm::LLVMIsUndef(v) == True }
|
||||
}
|
||||
|
||||
fn const_poison(&self, t: &'ll Type) -> &'ll Value {
|
||||
unsafe { llvm::LLVMGetPoison(t) }
|
||||
}
|
||||
|
||||
@@ -918,6 +918,7 @@ unsafe extern "C" {
|
||||
pub fn LLVMMetadataTypeInContext(C: &Context) -> &Type;
|
||||
|
||||
// Operations on all values
|
||||
pub fn LLVMIsUndef(Val: &Value) -> Bool;
|
||||
pub fn LLVMTypeOf(Val: &Value) -> &Type;
|
||||
pub fn LLVMGetValueName2(Val: &Value, Length: *mut size_t) -> *const c_char;
|
||||
pub fn LLVMSetValueName2(Val: &Value, Name: *const c_char, NameLen: size_t);
|
||||
|
||||
Reference in New Issue
Block a user