Skip to content

Commit 7060fc5

Browse files
authored
[llvm-lto2] Added version command for llvm-lto2 (#148866)
Previously, the only way to check version for llvm-lto2 was to add version as a subcommand: `llvm-lto2 run --version`. This adds version as a main command for llvm-lto2 for more intuitive access. You can now check version with the command `llvm-lto2 --version`.
1 parent d8285df commit 7060fc5

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Show that you can run version as a main command for llvm-lto2
2+
## or a subcommand of llvm-lto2 run.
3+
4+
RUN: llvm-lto2 --version | FileCheck %s
5+
RUN: llvm-lto2 run --version | FileCheck %s
6+
7+
CHECK: version

llvm/tools/llvm-lto2/llvm-lto2.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,5 +616,9 @@ int main(int argc, char **argv) {
616616
outs() << GlobalValue::getGUIDAssumingExternalLinkage(argv[2]) << '\n';
617617
return 0;
618618
}
619+
if (Subcommand == "--version") {
620+
cl::PrintVersionMessage();
621+
return 0;
622+
}
619623
return usage();
620624
}

0 commit comments

Comments
 (0)