@@ -39,7 +39,6 @@ use std::collections::BTreeSet;
3939use std:: io:: Write ;
4040use std:: path:: PathBuf ;
4141
42- use revive_common:: Keccak256 ;
4342use revive_common:: MetadataHash ;
4443use revive_llvm_context:: OptimizerSettings ;
4544use revive_solc_json_interface:: ResolcWarning ;
@@ -94,7 +93,7 @@ pub fn yul<T: Compiler>(
9493pub fn llvm_ir (
9594 input_files : & [ PathBuf ] ,
9695 libraries : & [ String ] ,
97- metadata_hash : Keccak256 ,
96+ metadata_hash : MetadataHash ,
9897 messages : & mut Vec < SolcStandardJsonOutputError > ,
9998 optimizer_settings : revive_llvm_context:: OptimizerSettings ,
10099 debug_config : revive_llvm_context:: DebugConfig ,
@@ -129,40 +128,34 @@ pub fn standard_output<T: Compiler>(
129128 input_files : & [ PathBuf ] ,
130129 libraries : & [ String ] ,
131130 messages : & mut Vec < SolcStandardJsonOutputError > ,
132- metadata_hash : Keccak256 ,
131+ metadata_hash : MetadataHash ,
133132 solc : & mut T ,
134133 evm_version : Option < revive_common:: EVMVersion > ,
135134 solc_optimizer_enabled : bool ,
136135 optimizer_settings : revive_llvm_context:: OptimizerSettings ,
137136 base_path : Option < String > ,
138137 include_paths : Vec < String > ,
139138 allow_paths : Option < String > ,
140- remappings : Option < BTreeSet < String > > ,
139+ remappings : BTreeSet < String > ,
141140 suppressed_warnings : Vec < ResolcWarning > ,
142141 debug_config : revive_llvm_context:: DebugConfig ,
143142 llvm_arguments : & [ String ] ,
144143 memory_config : SolcStandardJsonInputSettingsPolkaVMMemory ,
145144) -> anyhow:: Result < Build > {
146145 let solc_version = solc. version ( ) ?;
147-
148- let solc_input = SolcStandardJsonInput :: try_from_solidity_paths (
146+ let mut solc_input = SolcStandardJsonInput :: try_from_solidity_paths (
149147 evm_version,
150148 input_files,
151149 libraries,
152150 remappings,
153151 SolcStandardJsonInputSettingsSelection :: new_required ( ) ,
154- SolcStandardJsonInputSettingsOptimizer :: new (
155- solc_optimizer_enabled,
156- None ,
157- & solc_version. default ,
158- optimizer_settings. is_fallback_to_size_enabled ( ) ,
159- ) ,
160- None ,
152+ SolcStandardJsonInputSettingsOptimizer :: default ( ) ,
153+ Default :: default ( ) ,
161154 suppressed_warnings,
162- Some ( SolcStandardJsonInputSettingsPolkaVM :: new (
155+ SolcStandardJsonInputSettingsPolkaVM :: new (
163156 Some ( memory_config) ,
164157 debug_config. emit_debug_info ,
165- ) ) ,
158+ ) ,
166159 false ,
167160 ) ?;
168161 let mut solc_output = solc. standard_json (
@@ -178,9 +171,9 @@ pub fn standard_output<T: Compiler>(
178171 let linker_symbols = solc_input. settings . libraries . as_linker_symbols ( ) ?;
179172
180173 let project = Project :: try_from_standard_json_output (
181- solc_output,
174+ & mut solc_output,
182175 solc_input. settings . libraries ,
183- solc_version,
176+ & solc_version,
184177 & debug_config,
185178 ) ?;
186179 solc_output. take_and_write_warnings ( ) ;
@@ -210,14 +203,16 @@ pub fn standard_json<T: Compiler>(
210203 solc : & mut T ,
211204 detect_missing_libraries : bool ,
212205 messages : & mut Vec < SolcStandardJsonOutputError > ,
213- metadata_hash : Keccak256 ,
206+ metadata_hash : MetadataHash ,
214207 json_path : Option < PathBuf > ,
215208 base_path : Option < String > ,
216209 include_paths : Vec < String > ,
217210 allow_paths : Option < String > ,
218- mut debug_config : revive_llvm_context:: DebugConfig ,
211+ debug_config : revive_llvm_context:: DebugConfig ,
219212 llvm_arguments : & [ String ] ,
213+ memory_config : SolcStandardJsonInputSettingsPolkaVMMemory ,
220214) -> anyhow:: Result < ( ) > {
215+ let solc_version = solc. version ( ) ?;
221216 let mut solc_input = SolcStandardJsonInput :: try_from ( json_path. as_deref ( ) ) ?;
222217 let language = solc_input. language ;
223218 let prune_output = solc_input. settings . selection_to_prune ( ) ;
@@ -247,9 +242,9 @@ pub fn standard_json<T: Compiler>(
247242 ) ?;
248243
249244 let project = Project :: try_from_standard_json_output (
250- solc_output,
245+ & mut solc_output,
251246 solc_input. settings . libraries ,
252- solc . version ( ) ,
247+ & solc_version ,
253248 & debug_config,
254249 ) ?;
255250 if solc_output. has_errors ( ) {
@@ -258,7 +253,7 @@ pub fn standard_json<T: Compiler>(
258253
259254 if detect_missing_libraries {
260255 let missing_libraries = project. get_missing_libraries ( & deployed_libraries) ;
261- missing_libraries. write_to_standard_json ( & mut solc_output, solc_version. as_ref ( ) ) ;
256+ missing_libraries. write_to_standard_json ( & mut solc_output, & solc_version) ;
262257 solc_output. write_and_exit ( prune_output) ;
263258 }
264259
@@ -271,12 +266,12 @@ pub fn standard_json<T: Compiler>(
271266 memory_config,
272267 ) ?;
273268 if build. has_errors ( ) {
274- build. write_to_standard_json ( & mut solc_output, solc . version ( ) . as_ref ( ) ) ?;
269+ build. write_to_standard_json ( & mut solc_output, & solc_version ) ?;
275270 solc_output. write_and_exit ( prune_output) ;
276271 }
277272
278273 let build = build. link ( linker_symbols) ;
279- build. write_to_standard_json ( & mut solc_output, solc . version ( ) . as_ref ( ) ) ?;
274+ build. write_to_standard_json ( & mut solc_output, & solc_version ) ?;
280275 solc_output. write_and_exit ( prune_output) ;
281276}
282277
@@ -286,15 +281,16 @@ pub fn combined_json<T: Compiler>(
286281 format : String ,
287282 input_files : & [ PathBuf ] ,
288283 libraries : & [ String ] ,
289- metadata_hash : Keccak256 ,
284+ messages : & mut Vec < SolcStandardJsonOutputError > ,
285+ metadata_hash : MetadataHash ,
290286 solc : & mut T ,
291287 evm_version : Option < revive_common:: EVMVersion > ,
292288 solc_optimizer_enabled : bool ,
293289 optimizer_settings : revive_llvm_context:: OptimizerSettings ,
294290 base_path : Option < String > ,
295291 include_paths : Vec < String > ,
296292 allow_paths : Option < String > ,
297- remappings : Option < BTreeSet < String > > ,
293+ remappings : BTreeSet < String > ,
298294 suppressed_warnings : Vec < ResolcWarning > ,
299295 debug_config : revive_llvm_context:: DebugConfig ,
300296 output_directory : Option < PathBuf > ,
@@ -305,11 +301,12 @@ pub fn combined_json<T: Compiler>(
305301 let build = standard_output (
306302 input_files,
307303 libraries,
304+ messages,
305+ metadata_hash,
308306 solc,
309307 evm_version,
310308 solc_optimizer_enabled,
311309 optimizer_settings,
312- include_metadata_hash,
313310 base_path,
314311 include_paths,
315312 allow_paths,
0 commit comments