Implement external function linkage in lib
This commit is contained in:
parent
4eaa365674
commit
067c84e93e
@ -5,7 +5,7 @@
|
|||||||
use std::{collections::HashMap, ffi::CString, ptr::null_mut};
|
use std::{collections::HashMap, ffi::CString, ptr::null_mut};
|
||||||
|
|
||||||
use llvm_sys::{
|
use llvm_sys::{
|
||||||
LLVMIntPredicate,
|
LLVMIntPredicate, LLVMLinkage,
|
||||||
analysis::LLVMVerifyModule,
|
analysis::LLVMVerifyModule,
|
||||||
core::*,
|
core::*,
|
||||||
prelude::*,
|
prelude::*,
|
||||||
@ -204,6 +204,11 @@ impl FunctionHolder {
|
|||||||
unsafe {
|
unsafe {
|
||||||
let own_function = *module.functions.get(&self.value).unwrap();
|
let own_function = *module.functions.get(&self.value).unwrap();
|
||||||
|
|
||||||
|
if self.data.flags.is_extern {
|
||||||
|
LLVMSetLinkage(own_function.value_ref, LLVMLinkage::LLVMExternalLinkage);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for block in &self.blocks {
|
for block in &self.blocks {
|
||||||
if block.data.deleted {
|
if block.data.deleted {
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user