[artiq] Set private linkage for constants #499
|
@ -1,4 +1,6 @@
|
||||||
|
use crate::PrimitivePythonId;
|
||||||
use inkwell::{
|
use inkwell::{
|
||||||
|
module::Linkage,
|
||||||
types::{BasicType, BasicTypeEnum},
|
types::{BasicType, BasicTypeEnum},
|
||||||
values::BasicValueEnum,
|
values::BasicValueEnum,
|
||||||
AddressSpace,
|
AddressSpace,
|
||||||
|
@ -34,8 +36,6 @@ use std::{
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::PrimitivePythonId;
|
|
||||||
|
|
||||||
pub enum PrimitiveValue {
|
pub enum PrimitiveValue {
|
||||||
I32(i32),
|
I32(i32),
|
||||||
I64(i64),
|
I64(i64),
|
||||||
|
@ -133,6 +133,8 @@ impl StaticValue for PythonValue {
|
||||||
format!("{}_const", self.id).as_str(),
|
format!("{}_const", self.id).as_str(),
|
||||||
);
|
);
|
||||||
global.set_constant(true);
|
global.set_constant(true);
|
||||||
|
// Set linkage of global to private to avoid name collisions
|
||||||
|
global.set_linkage(Linkage::Private);
|
||||||
global.set_initializer(&ctx.ctx.const_struct(
|
global.set_initializer(&ctx.ctx.const_struct(
|
||||||
&[ctx.ctx.i32_type().const_int(u64::from(id), false).into()],
|
&[ctx.ctx.i32_type().const_int(u64::from(id), false).into()],
|
||||||
false,
|
false,
|
||||||
|
|
Loading…
Reference in New Issue