wamrc: More friendly to print help info (#2451)
Allow wamrc to print help info like below: ```bash wamrc --target=help wamrc --target-abi=help wamrc --target=<target> --cpu=help wamrc --target=<target> --cpu=help --cpu-features=+help ```
This commit is contained in:
@ -2752,6 +2752,16 @@ aot_create_comp_context(const AOTCompData *comp_data, aot_comp_option_t option)
|
||||
aot_set_last_error("create LLVM target machine failed.");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* If only to create target machine for querying information, early stop
|
||||
*/
|
||||
if ((arch && !strcmp(arch, "help")) || (abi && !strcmp(abi, "help"))
|
||||
|| (cpu && !strcmp(cpu, "help"))
|
||||
|| (features && !strcmp(features, "+help"))) {
|
||||
LOG_DEBUG(
|
||||
"create LLVM target machine only for printing help info.");
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
triple = LLVMGetTargetMachineTriple(comp_ctx->target_machine);
|
||||
|
||||
Reference in New Issue
Block a user