@@ -91,7 +91,7 @@ impl ExecutionEngine {
91
91
///
92
92
/// assert_eq!(result, 128.);
93
93
/// ```
94
- pub fn add_global_mapping ( & self , value : & AnyValue , addr : usize ) {
94
+ pub fn add_global_mapping ( & mut self , value : & AnyValue , addr : usize ) {
95
95
unsafe {
96
96
LLVMAddGlobalMapping ( * self . execution_engine , value. as_value_ref ( ) , addr as * mut _ )
97
97
}
@@ -114,7 +114,7 @@ impl ExecutionEngine {
114
114
///
115
115
/// assert!(ee.add_module(&module).is_err());
116
116
/// ```
117
- pub fn add_module ( & self , module : & Module ) -> Result < ( ) , ( ) > {
117
+ pub fn add_module ( & mut self , module : & Module ) -> Result < ( ) , ( ) > {
118
118
unsafe {
119
119
LLVMAddModule ( * self . execution_engine , module. module . get ( ) )
120
120
}
@@ -128,7 +128,7 @@ impl ExecutionEngine {
128
128
Ok ( ( ) )
129
129
}
130
130
131
- pub fn remove_module ( & self , module : & Module ) -> Result < ( ) , String > {
131
+ pub fn remove_module ( & mut self , module : & Module ) -> Result < ( ) , String > {
132
132
match * module. owned_by_ee . borrow ( ) {
133
133
Some ( ref ee) if * ee. execution_engine != * self . execution_engine => return Err ( "Module is not owned by this Execution Engine" . into ( ) ) ,
134
134
None => return Err ( "Module is not owned by an Execution Engine" . into ( ) ) ,
@@ -169,7 +169,7 @@ impl ExecutionEngine {
169
169
/// "C"` functions can be retrieved via the `get_function()` method. If you
170
170
/// get funny type errors then it's probably because you have specified the
171
171
/// wrong calling convention or forgotten to specify the retrieved function
172
- /// is `unsafe`.
172
+ /// as `unsafe`.
173
173
///
174
174
/// # Examples
175
175
///
@@ -287,10 +287,10 @@ impl ExecutionEngine {
287
287
288
288
pub fn run_function_as_main ( & self , function : & FunctionValue ) {
289
289
let args = vec ! [ ] ; // TODO: Support argc, argv
290
- let env_p = vec ! [ ] ; // REVIEW: No clue what this is
290
+ let environment_variables = vec ! [ ] ;
291
291
292
292
unsafe {
293
- LLVMRunFunctionAsMain ( * self . execution_engine , function. as_value_ref ( ) , args. len ( ) as u32 , args. as_ptr ( ) , env_p . as_ptr ( ) ) ; // REVIEW: usize to u32 cast ok??
293
+ LLVMRunFunctionAsMain ( * self . execution_engine , function. as_value_ref ( ) , args. len ( ) as u32 , args. as_ptr ( ) , environment_variables . as_ptr ( ) ) ; // REVIEW: usize to u32 cast ok??
294
294
}
295
295
}
296
296
0 commit comments