Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions llvm/test/tools/llvm-lto2/print-guid.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# RUN: llvm-lto2 print-guid foo | FileCheck %s
# CHECK: 6699318081062747564
8 changes: 7 additions & 1 deletion llvm/tools/llvm-lto2/llvm-lto2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ template <typename T> static T check(ErrorOr<T> E, std::string Msg) {
}

static int usage() {
errs() << "Available subcommands: dump-symtab run\n";
errs() << "Available subcommands: dump-symtab run print-guid\n";
return 1;
}

Expand Down Expand Up @@ -610,5 +610,11 @@ int main(int argc, char **argv) {
return dumpSymtab(argc - 1, argv + 1);
if (Subcommand == "run")
return run(argc - 1, argv + 1);
if (Subcommand == "print-guid" && argc > 2) {
// Note the name of the function we're calling: this won't return the right
// answer for internal linkage symbols.
outs() << GlobalValue::getGUIDAssumingExternalLinkage(argv[2]) << '\n';
return 0;
}
return usage();
}
Loading