@@ -78,7 +78,7 @@ pub struct CodeGen<'ink> {
78
78
/// Whether we are generating a hot-reloadable binary or not
79
79
pub online_change : OnlineChange ,
80
80
81
- pub got_layout_file : Option < ( String , ConfigFormat ) > ,
81
+ pub got_layout_file : ( String , ConfigFormat ) ,
82
82
83
83
pub module_location : String ,
84
84
}
@@ -97,7 +97,7 @@ impl<'ink> CodeGen<'ink> {
97
97
context : & ' ink CodegenContext ,
98
98
root : Option < & Path > ,
99
99
module_location : & str ,
100
- got_layout_file : Option < ( String , ConfigFormat ) > ,
100
+ got_layout_file : ( String , ConfigFormat ) ,
101
101
optimization_level : OptimizationLevel ,
102
102
debug_level : DebugLevel ,
103
103
online_change : OnlineChange ,
@@ -121,7 +121,7 @@ impl<'ink> CodeGen<'ink> {
121
121
literals : & StringLiterals ,
122
122
dependencies : & FxIndexSet < Dependency > ,
123
123
global_index : & Index ,
124
- got_layout : & Mutex < Option < HashMap < String , u64 > > > ,
124
+ got_layout : & Mutex < HashMap < String , u64 > > ,
125
125
) -> Result < LlvmTypedIndex < ' ink > , Diagnostic > {
126
126
let llvm = Llvm :: new ( context, context. create_builder ( ) ) ;
127
127
let mut index = LlvmTypedIndex :: default ( ) ;
@@ -135,8 +135,14 @@ impl<'ink> CodeGen<'ink> {
135
135
) ?;
136
136
index. merge ( llvm_type_index) ;
137
137
138
- let mut variable_generator =
139
- VariableGenerator :: new ( & self . module , & llvm, global_index, annotations, & index, & mut self . debug ) ;
138
+ let mut variable_generator = VariableGenerator :: new (
139
+ & self . module ,
140
+ & llvm,
141
+ global_index,
142
+ annotations,
143
+ & index,
144
+ & mut self . debug ,
145
+ ) ;
140
146
141
147
//Generate global variables
142
148
let llvm_gv_index =
@@ -175,7 +181,10 @@ impl<'ink> CodeGen<'ink> {
175
181
acc
176
182
} ) ;
177
183
178
- if let Some ( got_entries) = & mut * got_layout. lock ( ) . unwrap ( ) {
184
+
185
+ if self . online_change == OnlineChange :: Enabled {
186
+ let got_entries = & mut * got_layout. lock ( ) . unwrap ( ) ;
187
+
179
188
let mut new_symbols = Vec :: new ( ) ;
180
189
let mut new_got_entries = HashMap :: new ( ) ;
181
190
let mut new_got = HashMap :: new ( ) ;
0 commit comments