You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/context.rs
+46-4Lines changed: 46 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,22 @@
1
1
//! A `Context` is an opaque owner and manager of core global data.
2
2
3
-
use llvm_sys::core::{LLVMAppendBasicBlockInContext,LLVMContextCreate,LLVMContextDispose,LLVMCreateBuilderInContext,LLVMDoubleTypeInContext,LLVMFloatTypeInContext,LLVMFP128TypeInContext,LLVMInsertBasicBlockInContext,LLVMInt16TypeInContext,LLVMInt1TypeInContext,LLVMInt32TypeInContext,LLVMInt64TypeInContext,LLVMInt8TypeInContext,LLVMIntTypeInContext,LLVMModuleCreateWithNameInContext,LLVMStructCreateNamed,LLVMStructTypeInContext,LLVMVoidTypeInContext,LLVMHalfTypeInContext,LLVMGetGlobalContext,LLVMPPCFP128TypeInContext,LLVMConstStructInContext,LLVMMDNodeInContext,LLVMMDStringInContext,LLVMGetMDKindIDInContext,LLVMX86FP80TypeInContext,LLVMConstStringInContext,LLVMContextSetDiagnosticHandler,LLVMGetInlineAsm};
3
+
use llvm_sys::core::{LLVMAppendBasicBlockInContext,LLVMContextCreate,LLVMContextDispose,LLVMCreateBuilderInContext,LLVMDoubleTypeInContext,LLVMFloatTypeInContext,LLVMFP128TypeInContext,LLVMInsertBasicBlockInContext,LLVMInt16TypeInContext,LLVMInt1TypeInContext,LLVMInt32TypeInContext,LLVMInt64TypeInContext,LLVMInt8TypeInContext,LLVMIntTypeInContext,LLVMModuleCreateWithNameInContext,LLVMStructCreateNamed,LLVMStructTypeInContext,LLVMVoidTypeInContext,LLVMHalfTypeInContext,LLVMGetGlobalContext,LLVMPPCFP128TypeInContext,LLVMConstStructInContext,LLVMMDNodeInContext,LLVMMDStringInContext,LLVMGetMDKindIDInContext,LLVMX86FP80TypeInContext,LLVMConstStringInContext,LLVMContextSetDiagnosticHandler};
4
4
#[llvm_versions(4.0..=latest)]
5
5
use llvm_sys::core::{LLVMCreateEnumAttribute,LLVMCreateStringAttribute};
6
+
#[llvm_versions(3.6..7.0)]
7
+
use llvm_sys::core::{LLVMConstInlineAsm};
8
+
#[llvm_versions(7.0..=latest)]
9
+
use llvm_sys::core::{LLVMGetInlineAsm};
10
+
#[llvm_versions(7.0..=latest)]
11
+
usecrate::InlineAsmDialect;
6
12
use llvm_sys::prelude::{LLVMContextRef,LLVMTypeRef,LLVMValueRef,LLVMDiagnosticInfoRef};
7
13
use llvm_sys::ir_reader::LLVMParseIRInContext;
8
14
use llvm_sys::target::{LLVMIntPtrTypeForASInContext,LLVMIntPtrTypeInContext};
9
15
use libc::c_void;
10
16
use once_cell::sync::Lazy;
11
17
use parking_lot::{Mutex,MutexGuard};
12
18
13
-
usecrate::{AddressSpace,InlineAsmDialect};
19
+
usecrate::AddressSpace;
14
20
#[llvm_versions(4.0..=latest)]
15
21
usecrate::attributes::Attribute;
16
22
usecrate::basic_block::BasicBlock;
@@ -207,10 +213,11 @@ impl Context {
207
213
///
208
214
/// builder.position_at_end(basic_block);
209
215
/// let asm_fn = context.i64_type().fn_type(&[context.i64_type().into(), context.i64_type().into()], false);
210
-
/// let asm = context.create_inline_asm(asm_fn, "syscall", "=r,{rax},{rdi}", true, false, None);
211
-
/// let params = &[context.i64_type().const_int(60).into(), context.i64_type().const_int(1).into()];
216
+
/// let asm = context.create_inline_asm(asm_fn, "syscall".to_string(), "=r,{rax},{rdi}".to_string(), true, false, None);
217
+
/// let params = &[context.i64_type().const_int(60, false).into(), context.i64_type().const_int(1, false).into()];
Copy file name to clipboardExpand all lines: src/lib.rs
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,10 @@ pub mod targets;
39
39
pubmod types;
40
40
pubmod values;
41
41
42
-
use llvm_sys::{LLVMIntPredicate,LLVMRealPredicate,LLVMVisibility,LLVMThreadLocalMode,LLVMDLLStorageClass,LLVMAtomicOrdering,LLVMAtomicRMWBinOp,LLVMInlineAsmDialect};
42
+
use llvm_sys::{LLVMIntPredicate,LLVMRealPredicate,LLVMVisibility,LLVMThreadLocalMode,LLVMDLLStorageClass,LLVMAtomicOrdering,LLVMAtomicRMWBinOp};
43
+
44
+
#[llvm_versions(7.0..=latest)]
45
+
use llvm_sys::LLVMInlineAsmDialect;
43
46
44
47
use std::convert::TryFrom;
45
48
@@ -386,6 +389,7 @@ impl Default for DLLStorageClass {
0 commit comments