Do not emit bundle.so or abi files with --emit cfg
@@ -494,7 +494,8 @@ fn process_filename(
fn save_intermediates(binary: &solang::emit::Binary, matches: &ArgMatches) -> bool {
let verbose = matches.is_present("VERBOSE");
- if let Some("llvm-ir") = matches.value_of("EMIT") {
+ match matches.value_of("EMIT") {
+ Some("llvm-ir") => {
if let Some(runtime) = &binary.runtime {
// In Ethereum, an ewasm contract has two parts, deployer and runtime. The deployer code returns the runtime wasm
// as a byte string
@@ -534,10 +535,11 @@ fn save_intermediates(binary: &solang::emit::Binary, matches: &ArgMatches) -> bo
binary.dump_llvm(&llvm_filename).unwrap();
}
- return true;
+
+ true
}
- if let Some("llvm-bc") = matches.value_of("EMIT") {
+ Some("llvm-bc") => {
// In Ethereum, an ewasm contract has two parts, deployer and runtime. The deployer code returns the runtime wasm
// as a byte string
if let Some(runtime) = &binary.runtime {
@@ -577,10 +579,11 @@ fn save_intermediates(binary: &solang::emit::Binary, matches: &ArgMatches) -> bo
binary.bitcode(&bc_filename);
}
- return true;
+
+ true
}
- if let Some("object") = matches.value_of("EMIT") {
+ Some("object") => {
let obj = match binary.code(false) {
Ok(o) => o,
Err(s) => {
@@ -601,8 +604,9 @@ fn save_intermediates(binary: &solang::emit::Binary, matches: &ArgMatches) -> bo
let mut file = File::create(obj_filename).unwrap();
file.write_all(&obj).unwrap();
- return true;
+ true
+ }
+ Some("cfg") => true,
+ _ => false,
}
-
- false
}
