forked from M-Labs/nac3
[artiq] symbol_resolver: Set private linkage for constants
This commit is contained in:
parent
a0f6961e0e
commit
0b074c2cf2
@ -1,4 +1,6 @@
|
||||
use crate::PrimitivePythonId;
|
||||
use inkwell::{
|
||||
module::Linkage,
|
||||
types::{BasicType, BasicTypeEnum},
|
||||
values::BasicValueEnum,
|
||||
AddressSpace,
|
||||
@ -34,8 +36,6 @@ use std::{
|
||||
},
|
||||
};
|
||||
|
||||
use crate::PrimitivePythonId;
|
||||
|
||||
pub enum PrimitiveValue {
|
||||
I32(i32),
|
||||
I64(i64),
|
||||
@ -133,6 +133,8 @@ impl StaticValue for PythonValue {
|
||||
format!("{}_const", self.id).as_str(),
|
||||
);
|
||||
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(
|
||||
&[ctx.ctx.i32_type().const_int(u64::from(id), false).into()],
|
||||
false,
|
||||
|
Loading…
Reference in New Issue
Block a user