Skip to content

wamr-compiler: add --llvm-version option #4540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions wamr-compiler/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "wasm_export.h"
#include "aot_export.h"

#include <llvm-c/Core.h>
#include <llvm-c/Support.h>

#if BH_HAS_DLFCN
Expand Down Expand Up @@ -218,6 +219,7 @@ print_help()
printf(" WARNING: enable this feature will largely increase code size\n");
printf(" -v=n Set log verbose level (0 to 5, default is 2), larger with more log\n");
printf(" --version Show version information\n");
printf(" --llvm-version Show LLVM version information\n");
printf("Examples: wamrc -o test.aot test.wasm\n");
printf(" wamrc --target=i386 -o test.aot test.wasm\n");
printf(" wamrc --target=i386 --format=object -o test.o test.wasm\n");
Expand Down Expand Up @@ -676,6 +678,12 @@ main(int argc, char *argv[])
printf("wamrc %u.%u.%u\n", major, minor, patch);
return 0;
}
else if (!strcmp(argv[0], "--llvm-version")) {
unsigned major, minor, patch;
LLVMGetVersion(&major, &minor, &patch);
printf("LLVM %u.%u.%u\n", major, minor, patch);
return 0;
}
else
PRINT_HELP_AND_EXIT();
}
Expand Down
Loading