[PATCH] D149283: [llvm-gsymutil] Add gsymuil to llvm driver build
Alex Brachet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 28 08:16:33 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rGe161fcde0622: [llvm-gsymutil] Add gsymutil to llvm driver build (authored by abrachet).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149283/new/
https://reviews.llvm.org/D149283
Files:
llvm/tools/llvm-gsymutil/CMakeLists.txt
llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp
llvm/utils/gn/secondary/llvm/tools/llvm-gsymutil/BUILD.gn
utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
Index: utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
===================================================================
--- utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+++ utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
@@ -3461,12 +3461,21 @@
td_srcs = ["include/llvm/Option/OptParser.td"],
)
+expand_template(
+ name = "gsymutil_main",
+ out = "llvm-gsymutil-driver.cpp",
+ substitutions = {
+ "@TOOL_NAME@": "llvm_gsymutil",
+ },
+ template = "cmake/modules/llvm-driver-template.cpp.in",
+)
+
cc_binary(
name = "llvm-gsymutil",
srcs = glob([
"tools/llvm-gsymutil/*.cpp",
"tools/llvm-gsymutil/*.h",
- ]),
+ ]) + ["llvm-gsymutil-driver.cpp"],
copts = llvm_copts,
stamp = 0,
deps = [
Index: llvm/utils/gn/secondary/llvm/tools/llvm-gsymutil/BUILD.gn
===================================================================
--- llvm/utils/gn/secondary/llvm/tools/llvm-gsymutil/BUILD.gn
+++ llvm/utils/gn/secondary/llvm/tools/llvm-gsymutil/BUILD.gn
@@ -1,11 +1,12 @@
import("//llvm/utils/TableGen/tablegen.gni")
+import("//llvm/utils/gn/build/driver_executable.gni")
tablegen("Opts") {
visibility = [ ":llvm-gsymutil" ]
args = [ "-gen-opt-parser-defs" ]
}
-executable("llvm-gsymutil") {
+driver_executable("llvm-gsymutil") {
deps = [
":Opts",
"//llvm/lib/DebugInfo/DWARF",
Index: llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp
===================================================================
--- llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp
+++ llvm/tools/llvm-gsymutil/llvm-gsymutil.cpp
@@ -19,6 +19,7 @@
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Format.h"
+#include "llvm/Support/LLVMDriver.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/PrettyStackTrace.h"
@@ -492,7 +493,7 @@
OS << "\n";
}
-int main(int argc, char **argv) {
+int llvm_gsymutil_main(int argc, char **argv, const llvm::ToolContext &) {
// Print a stack trace if we signal out.
sys::PrintStackTraceOnErrorSignal(argv[0]);
PrettyStackTraceProgram X(argc, argv);
Index: llvm/tools/llvm-gsymutil/CMakeLists.txt
===================================================================
--- llvm/tools/llvm-gsymutil/CMakeLists.txt
+++ llvm/tools/llvm-gsymutil/CMakeLists.txt
@@ -18,4 +18,6 @@
DEPENDS
GSYMUtilOptsTableGen
+
+ GENERATE_DRIVER
)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149283.517931.patch
Type: text/x-patch
Size: 2453 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230428/794ebaf5/attachment.bin>
More information about the llvm-commits
mailing list