[llvm] d5090cd - [llvm-driver] Add various tools to the llvm-driver
Alex Brachet via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 5 22:17:02 PDT 2022
Author: Alex Brachet
Date: 2022-10-06T05:16:13Z
New Revision: d5090cd94a8f256c5721d4cc3e37413326aa3ab0
URL: https://github.com/llvm/llvm-project/commit/d5090cd94a8f256c5721d4cc3e37413326aa3ab0
DIFF: https://github.com/llvm/llvm-project/commit/d5090cd94a8f256c5721d4cc3e37413326aa3ab0.diff
LOG: [llvm-driver] Add various tools to the llvm-driver
The llvm-driver, enabled with LLVM_TOOL_LLVM_DRIVER_BUILD combines many llvm executables
into one to save overall toolchain size. This patch adds a few more llvm tools to the
llvm-driver.
Differential Revision: https://reviews.llvm.org/D135281
Added:
Modified:
llvm/tools/llvm-ifs/CMakeLists.txt
llvm/tools/llvm-ifs/llvm-ifs.cpp
llvm/tools/llvm-lipo/CMakeLists.txt
llvm/tools/llvm-lipo/llvm-lipo.cpp
llvm/tools/llvm-mt/CMakeLists.txt
llvm/tools/llvm-mt/llvm-mt.cpp
llvm/tools/llvm-nm/CMakeLists.txt
llvm/tools/llvm-nm/llvm-nm.cpp
llvm/tools/llvm-profdata/CMakeLists.txt
llvm/tools/llvm-profdata/llvm-profdata.cpp
llvm/tools/llvm-rc/CMakeLists.txt
llvm/tools/llvm-rc/llvm-rc.cpp
llvm/tools/llvm-readobj/CMakeLists.txt
llvm/tools/llvm-readobj/llvm-readobj.cpp
llvm/tools/llvm-size/CMakeLists.txt
llvm/tools/llvm-size/llvm-size.cpp
llvm/utils/gn/secondary/llvm/tools/llvm-ifs/BUILD.gn
llvm/utils/gn/secondary/llvm/tools/llvm-lipo/BUILD.gn
llvm/utils/gn/secondary/llvm/tools/llvm-mt/BUILD.gn
llvm/utils/gn/secondary/llvm/tools/llvm-nm/BUILD.gn
llvm/utils/gn/secondary/llvm/tools/llvm-profdata/BUILD.gn
llvm/utils/gn/secondary/llvm/tools/llvm-rc/BUILD.gn
llvm/utils/gn/secondary/llvm/tools/llvm-readobj/BUILD.gn
llvm/utils/gn/secondary/llvm/tools/llvm-size/BUILD.gn
utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
Removed:
################################################################################
diff --git a/llvm/tools/llvm-ifs/CMakeLists.txt b/llvm/tools/llvm-ifs/CMakeLists.txt
index 483610dce94a0..a7d16d1a0d5c8 100644
--- a/llvm/tools/llvm-ifs/CMakeLists.txt
+++ b/llvm/tools/llvm-ifs/CMakeLists.txt
@@ -1,6 +1,6 @@
set(LLVM_LINK_COMPONENTS
BinaryFormat
- InterfaceStub
+ InterfaceStub
Object
Support
TextAPI
@@ -18,4 +18,6 @@ add_llvm_tool(llvm-ifs
DEPENDS
IFSOptsTableGen
+
+ GENERATE_DRIVER
)
diff --git a/llvm/tools/llvm-ifs/llvm-ifs.cpp b/llvm/tools/llvm-ifs/llvm-ifs.cpp
index 608229033c881..c682a22f840d8 100644
--- a/llvm/tools/llvm-ifs/llvm-ifs.cpp
+++ b/llvm/tools/llvm-ifs/llvm-ifs.cpp
@@ -376,7 +376,7 @@ static DriverConfig parseArgs(int argc, char *const *argv) {
return Config;
}
-int main(int argc, char *argv[]) {
+int llvm_ifs_main(int argc, char *argv[]) {
DriverConfig Config = parseArgs(argc, argv);
if (Config.InputFilePaths.empty())
diff --git a/llvm/tools/llvm-lipo/CMakeLists.txt b/llvm/tools/llvm-lipo/CMakeLists.txt
index 2f582cbb74183..386b50129ad01 100644
--- a/llvm/tools/llvm-lipo/CMakeLists.txt
+++ b/llvm/tools/llvm-lipo/CMakeLists.txt
@@ -16,6 +16,7 @@ add_llvm_tool(llvm-lipo
llvm-lipo.cpp
DEPENDS
LipoOptsTableGen
+ GENERATE_DRIVER
)
if(LLVM_INSTALL_CCTOOLS_SYMLINKS)
diff --git a/llvm/tools/llvm-lipo/llvm-lipo.cpp b/llvm/tools/llvm-lipo/llvm-lipo.cpp
index ab7ff93af90ee..e48be6aa8acb9 100644
--- a/llvm/tools/llvm-lipo/llvm-lipo.cpp
+++ b/llvm/tools/llvm-lipo/llvm-lipo.cpp
@@ -719,7 +719,7 @@ replaceSlices(LLVMContext &LLVMCtx,
exit(EXIT_SUCCESS);
}
-int main(int argc, char **argv) {
+int llvm_lipo_main(int argc, char **argv) {
InitLLVM X(argc, argv);
llvm::InitializeAllTargetInfos();
llvm::InitializeAllTargetMCs();
diff --git a/llvm/tools/llvm-mt/CMakeLists.txt b/llvm/tools/llvm-mt/CMakeLists.txt
index e4e9946809214..2355e966bd7fa 100644
--- a/llvm/tools/llvm-mt/CMakeLists.txt
+++ b/llvm/tools/llvm-mt/CMakeLists.txt
@@ -11,4 +11,5 @@ add_public_tablegen_target(MtTableGen)
add_llvm_tool(llvm-mt
llvm-mt.cpp
+ GENERATE_DRIVER
)
diff --git a/llvm/tools/llvm-mt/llvm-mt.cpp b/llvm/tools/llvm-mt/llvm-mt.cpp
index f9383968ebbb2..aa7582b5d9967 100644
--- a/llvm/tools/llvm-mt/llvm-mt.cpp
+++ b/llvm/tools/llvm-mt/llvm-mt.cpp
@@ -79,7 +79,7 @@ static void error(Error EC) {
});
}
-int main(int Argc, const char **Argv) {
+int llvm_mt_main(int Argc, char **Argv) {
InitLLVM X(Argc, Argv);
CvtResOptTable T;
diff --git a/llvm/tools/llvm-nm/CMakeLists.txt b/llvm/tools/llvm-nm/CMakeLists.txt
index 4ad5370a2315e..a9b3308baa014 100644
--- a/llvm/tools/llvm-nm/CMakeLists.txt
+++ b/llvm/tools/llvm-nm/CMakeLists.txt
@@ -21,6 +21,7 @@ add_llvm_tool(llvm-nm
DEPENDS
NmOptsTableGen
intrinsics_gen
+ GENERATE_DRIVER
)
if(LLVM_INSTALL_BINUTILS_SYMLINKS)
diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp
index 155efd9bf2de2..d2c90dd454c50 100644
--- a/llvm/tools/llvm-nm/llvm-nm.cpp
+++ b/llvm/tools/llvm-nm/llvm-nm.cpp
@@ -2297,7 +2297,7 @@ exportSymbolNamesFromFiles(const std::vector<std::string> &InputFilenames) {
printExportSymbolList(SymbolList);
}
-int main(int argc, char **argv) {
+int llvm_nm_main(int argc, char **argv) {
InitLLVM X(argc, argv);
BumpPtrAllocator A;
StringSaver Saver(A);
@@ -2474,4 +2474,5 @@ int main(int argc, char **argv) {
if (HadError)
return 1;
+ return 0;
}
diff --git a/llvm/tools/llvm-profdata/CMakeLists.txt b/llvm/tools/llvm-profdata/CMakeLists.txt
index 3545bde5c4042..0cf36d183584f 100644
--- a/llvm/tools/llvm-profdata/CMakeLists.txt
+++ b/llvm/tools/llvm-profdata/CMakeLists.txt
@@ -11,4 +11,5 @@ add_llvm_tool(llvm-profdata
DEPENDS
intrinsics_gen
+ GENERATE_DRIVER
)
diff --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp
index 0acc2d0b3f6e9..95a5fc4fdbff2 100644
--- a/llvm/tools/llvm-profdata/llvm-profdata.cpp
+++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp
@@ -2826,7 +2826,8 @@ static int show_main(int argc, const char *argv[]) {
return showMemProfProfile(Filename, ProfiledBinary, OS);
}
-int main(int argc, const char *argv[]) {
+int llvm_profdata_main(int argc, char **argvNonConst) {
+ const char **argv = const_cast<const char **>(argvNonConst);
InitLLVM X(argc, argv);
StringRef ProgName(sys::path::filename(argv[0]));
diff --git a/llvm/tools/llvm-rc/CMakeLists.txt b/llvm/tools/llvm-rc/CMakeLists.txt
index 71b79942b41e2..817cee3dafc35 100644
--- a/llvm/tools/llvm-rc/CMakeLists.txt
+++ b/llvm/tools/llvm-rc/CMakeLists.txt
@@ -19,6 +19,7 @@ add_llvm_tool(llvm-rc
ResourceScriptParser.cpp
ResourceScriptStmt.cpp
ResourceScriptToken.cpp
+ GENERATE_DRIVER
)
add_llvm_tool_symlink(llvm-windres llvm-rc)
diff --git a/llvm/tools/llvm-rc/llvm-rc.cpp b/llvm/tools/llvm-rc/llvm-rc.cpp
index 312cc15e222f3..73991571c3ddf 100644
--- a/llvm/tools/llvm-rc/llvm-rc.cpp
+++ b/llvm/tools/llvm-rc/llvm-rc.cpp
@@ -724,12 +724,12 @@ void doCvtres(std::string Src, std::string Dest, std::string TargetTriple) {
} // anonymous namespace
-int main(int Argc, const char **Argv) {
+int llvm_rc_main(int Argc, char **Argv) {
InitLLVM X(Argc, Argv);
ExitOnErr.setBanner("llvm-rc: ");
- const char **DashDash = std::find_if(
- Argv + 1, Argv + Argc, [](StringRef Str) { return Str == "--"; });
+ char **DashDash = std::find_if(Argv + 1, Argv + Argc,
+ [](StringRef Str) { return Str == "--"; });
ArrayRef<const char *> ArgsArr = makeArrayRef(Argv + 1, DashDash);
ArrayRef<const char *> FileArgsArr;
if (DashDash != Argv + Argc)
diff --git a/llvm/tools/llvm-readobj/CMakeLists.txt b/llvm/tools/llvm-readobj/CMakeLists.txt
index 9d2d8882ee832..13243b853481d 100644
--- a/llvm/tools/llvm-readobj/CMakeLists.txt
+++ b/llvm/tools/llvm-readobj/CMakeLists.txt
@@ -27,6 +27,7 @@ add_llvm_tool(llvm-readobj
Win64EHDumper.cpp
WindowsResourceDumper.cpp
XCOFFDumper.cpp
+ GENERATE_DRIVER
)
add_llvm_tool_symlink(llvm-readelf llvm-readobj)
diff --git a/llvm/tools/llvm-readobj/llvm-readobj.cpp b/llvm/tools/llvm-readobj/llvm-readobj.cpp
index 06c6f7c4bff79..690859965bdc7 100644
--- a/llvm/tools/llvm-readobj/llvm-readobj.cpp
+++ b/llvm/tools/llvm-readobj/llvm-readobj.cpp
@@ -613,7 +613,7 @@ std::unique_ptr<ScopedPrinter> createWriter() {
return std::make_unique<ScopedPrinter>(fouts());
}
-int main(int argc, char *argv[]) {
+int llvm_readobj_main(int argc, char *argv[]) {
InitLLVM X(argc, argv);
BumpPtrAllocator A;
StringSaver Saver(A);
diff --git a/llvm/tools/llvm-size/CMakeLists.txt b/llvm/tools/llvm-size/CMakeLists.txt
index 0d1f660236809..1938f0251c64d 100644
--- a/llvm/tools/llvm-size/CMakeLists.txt
+++ b/llvm/tools/llvm-size/CMakeLists.txt
@@ -12,6 +12,7 @@ add_llvm_tool(llvm-size
llvm-size.cpp
DEPENDS
SizeOptsTableGen
+ GENERATE_DRIVER
)
if(LLVM_INSTALL_BINUTILS_SYMLINKS)
diff --git a/llvm/tools/llvm-size/llvm-size.cpp b/llvm/tools/llvm-size/llvm-size.cpp
index d65505f3056dc..77f68c0e659cc 100644
--- a/llvm/tools/llvm-size/llvm-size.cpp
+++ b/llvm/tools/llvm-size/llvm-size.cpp
@@ -866,7 +866,7 @@ static void printBerkeleyTotals() {
<< "(TOTALS)\n";
}
-int main(int argc, char **argv) {
+int llvm_size_main(int argc, char **argv) {
InitLLVM X(argc, argv);
BumpPtrAllocator A;
StringSaver Saver(A);
@@ -941,4 +941,5 @@ int main(int argc, char **argv) {
if (HadError)
return 1;
+ return 0;
}
diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-ifs/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/llvm-ifs/BUILD.gn
index 77b4b05e277ea..93542eba7eae3 100644
--- a/llvm/utils/gn/secondary/llvm/tools/llvm-ifs/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/tools/llvm-ifs/BUILD.gn
@@ -1,11 +1,12 @@
import("//llvm/utils/TableGen/tablegen.gni")
+import("//llvm/utils/gn/build/driver_executable.gni")
tablegen("Opts") {
visibility = [ ":llvm-ifs" ]
args = [ "-gen-opt-parser-defs" ]
}
-executable("llvm-ifs") {
+driver_executable("llvm-ifs") {
deps = [
":Opts",
"//llvm/lib/InterfaceStub",
diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-lipo/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/llvm-lipo/BUILD.gn
index 6530a54f083f3..a5b734ef92ef9 100644
--- a/llvm/utils/gn/secondary/llvm/tools/llvm-lipo/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/tools/llvm-lipo/BUILD.gn
@@ -1,5 +1,6 @@
import("//llvm/tools/cctools_symlinks.gni")
import("//llvm/utils/TableGen/tablegen.gni")
+import("//llvm/utils/gn/build/driver_executable.gni")
import("//llvm/utils/gn/build/symlink_or_copy.gni")
tablegen("LipoOpts") {
@@ -23,7 +24,7 @@ group("symlinks") {
}
}
-executable("llvm-lipo") {
+driver_executable("llvm-lipo") {
deps = [
":LipoOpts",
"//llvm/lib/Object",
diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-mt/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/llvm-mt/BUILD.gn
index 221637036cecd..3ff9f1ba81100 100644
--- a/llvm/utils/gn/secondary/llvm/tools/llvm-mt/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/tools/llvm-mt/BUILD.gn
@@ -1,11 +1,12 @@
import("//llvm/utils/TableGen/tablegen.gni")
+import("//llvm/utils/gn/build/driver_executable.gni")
tablegen("Opts") {
visibility = [ ":llvm-mt" ]
args = [ "-gen-opt-parser-defs" ]
}
-executable("llvm-mt") {
+driver_executable("llvm-mt") {
deps = [
":Opts",
"//llvm/lib/Option",
diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-nm/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/llvm-nm/BUILD.gn
index fd024468a830a..d2fb5a4a85905 100644
--- a/llvm/utils/gn/secondary/llvm/tools/llvm-nm/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/tools/llvm-nm/BUILD.gn
@@ -1,5 +1,6 @@
import("//llvm/tools/binutils_symlinks.gni")
import("//llvm/utils/TableGen/tablegen.gni")
+import("//llvm/utils/gn/build/driver_executable.gni")
import("//llvm/utils/gn/build/symlink_or_copy.gni")
tablegen("Opts") {
@@ -23,7 +24,7 @@ group("symlinks") {
}
}
-executable("llvm-nm") {
+driver_executable("llvm-nm") {
deps = [
":Opts",
"//llvm/lib/Bitcode/Reader",
diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-profdata/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/llvm-profdata/BUILD.gn
index df13636e433cf..e83944ff73548 100644
--- a/llvm/utils/gn/secondary/llvm/tools/llvm-profdata/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/tools/llvm-profdata/BUILD.gn
@@ -1,4 +1,6 @@
-executable("llvm-profdata") {
+import("//llvm/utils/gn/build/driver_executable.gni")
+
+driver_executable("llvm-profdata") {
deps = [
"//llvm/lib/IR",
"//llvm/lib/ProfileData",
diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-rc/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/llvm-rc/BUILD.gn
index f3ddb0ff811ae..0942e1b0dd0d6 100644
--- a/llvm/utils/gn/secondary/llvm/tools/llvm-rc/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/tools/llvm-rc/BUILD.gn
@@ -1,5 +1,6 @@
import("//llvm/tools/binutils_symlinks.gni")
import("//llvm/utils/TableGen/tablegen.gni")
+import("//llvm/utils/gn/build/driver_executable.gni")
import("//llvm/utils/gn/build/symlink_or_copy.gni")
tablegen("Opts") {
@@ -33,7 +34,7 @@ group("symlinks") {
}
}
-executable("llvm-rc") {
+driver_executable("llvm-rc") {
deps = [
":Opts",
":WindresOpts",
diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-readobj/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/llvm-readobj/BUILD.gn
index 921cc1dc72f18..3447736e09d6c 100644
--- a/llvm/utils/gn/secondary/llvm/tools/llvm-readobj/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/tools/llvm-readobj/BUILD.gn
@@ -1,5 +1,6 @@
import("//llvm/tools/binutils_symlinks.gni")
import("//llvm/utils/TableGen/tablegen.gni")
+import("//llvm/utils/gn/build/driver_executable.gni")
import("//llvm/utils/gn/build/symlink_or_copy.gni")
tablegen("Opts") {
@@ -27,7 +28,7 @@ group("symlinks") {
}
}
-executable("llvm-readobj") {
+driver_executable("llvm-readobj") {
deps = [
":Opts",
"//llvm/lib/BinaryFormat",
diff --git a/llvm/utils/gn/secondary/llvm/tools/llvm-size/BUILD.gn b/llvm/utils/gn/secondary/llvm/tools/llvm-size/BUILD.gn
index e41f765b2a309..bbb04ebfea1d3 100644
--- a/llvm/utils/gn/secondary/llvm/tools/llvm-size/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/tools/llvm-size/BUILD.gn
@@ -1,5 +1,6 @@
import("//llvm/tools/binutils_symlinks.gni")
import("//llvm/utils/TableGen/tablegen.gni")
+import("//llvm/utils/gn/build/driver_executable.gni")
import("//llvm/utils/gn/build/symlink_or_copy.gni")
tablegen("Opts") {
@@ -23,7 +24,7 @@ group("symlinks") {
}
}
-executable("llvm-size") {
+driver_executable("llvm-size") {
deps = [
":Opts",
"//llvm/lib/Object",
diff --git a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
index d4d11270c6ed8..17cdf5f068eb7 100644
--- a/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
@@ -3124,12 +3124,21 @@ gentbl(
td_srcs = ["include/llvm/Option/OptParser.td"],
)
+expand_template(
+ name = "ifs_main",
+ out = "llvm-ifs-driver.cpp",
+ substitutions = {
+ "@TOOL_NAME@": "llvm_ifs",
+ },
+ template = "cmake/modules/llvm-driver-template.cpp.in",
+)
+
cc_binary(
name = "llvm-ifs",
srcs = glob([
"tools/llvm-ifs/*.cpp",
"tools/llvm-ifs/*.h",
- ]),
+ ]) + ["llvm-ifs-driver.cpp"],
copts = llvm_copts,
stamp = 0,
deps = [
@@ -3232,11 +3241,20 @@ gentbl(
td_srcs = ["include/llvm/Option/OptParser.td"],
)
+expand_template(
+ name = "lipo_main",
+ out = "llvm-lipo-driver.cpp",
+ substitutions = {
+ "@TOOL_NAME@": "llvm_lipo",
+ },
+ template = "cmake/modules/llvm-driver-template.cpp.in",
+)
+
cc_binary(
name = "llvm-lipo",
srcs = [
"tools/llvm-lipo/llvm-lipo.cpp",
- ],
+ ] + ["llvm-lipo-driver.cpp"],
copts = llvm_copts,
stamp = 0,
deps = [
@@ -3391,12 +3409,21 @@ gentbl(
td_srcs = ["include/llvm/Option/OptParser.td"],
)
+expand_template(
+ name = "mt_main",
+ out = "llvm-mt-driver.cpp",
+ substitutions = {
+ "@TOOL_NAME@": "llvm_mt",
+ },
+ template = "cmake/modules/llvm-driver-template.cpp.in",
+)
+
cc_binary(
name = "llvm-mt",
srcs = glob([
"tools/llvm-mt/*.cpp",
"tools/llvm-mt/*.h",
- ]),
+ ]) + ["llvm-mt-driver.cpp"],
copts = llvm_copts,
stamp = 0,
deps = [
@@ -3419,12 +3446,21 @@ gentbl(
td_srcs = ["include/llvm/Option/OptParser.td"],
)
+expand_template(
+ name = "nm_main",
+ out = "llvm-nm-driver.cpp",
+ substitutions = {
+ "@TOOL_NAME@": "llvm_nm",
+ },
+ template = "cmake/modules/llvm-driver-template.cpp.in",
+)
+
cc_binary(
name = "llvm-nm",
srcs = glob([
"tools/llvm-nm/*.cpp",
"tools/llvm-nm/*.h",
- ]),
+ ]) + ["llvm-nm-driver.cpp"],
copts = llvm_copts,
stamp = 0,
deps = [
@@ -3657,12 +3693,21 @@ cc_binary(
],
)
+expand_template(
+ name = "profdata_main",
+ out = "llvm-profdata-driver.cpp",
+ substitutions = {
+ "@TOOL_NAME@": "llvm_profdata",
+ },
+ template = "cmake/modules/llvm-driver-template.cpp.in",
+)
+
cc_binary(
name = "llvm-profdata",
srcs = glob([
"tools/llvm-profdata/*.cpp",
"tools/llvm-profdata/*.h",
- ]),
+ ]) + ["llvm-profdata-driver.cpp"],
copts = llvm_copts,
stamp = 0,
deps = [
@@ -3717,12 +3762,21 @@ cc_library(
textual_hdrs = glob(["tools/llvm-rc/*.def"]),
)
+expand_template(
+ name = "rc_main",
+ out = "llvm-rc-driver.cpp",
+ substitutions = {
+ "@TOOL_NAME@": "llvm_rc",
+ },
+ template = "cmake/modules/llvm-driver-template.cpp.in",
+)
+
cc_binary(
name = "llvm-rc",
srcs = glob([
"tools/llvm-rc/*.cpp",
"tools/llvm-rc/*.h",
- ]),
+ ]) + ["llvm-rc-driver.cpp"],
copts = llvm_copts,
stamp = 0,
deps = [
@@ -3752,12 +3806,21 @@ gentbl(
td_srcs = ["include/llvm/Option/OptParser.td"],
)
+expand_template(
+ name = "readobj_main",
+ out = "llvm-readobj-driver.cpp",
+ substitutions = {
+ "@TOOL_NAME@": "llvm_readobj",
+ },
+ template = "cmake/modules/llvm-driver-template.cpp.in",
+)
+
cc_binary(
name = "llvm-readobj",
srcs = glob([
"tools/llvm-readobj/*.cpp",
"tools/llvm-readobj/*.h",
- ]),
+ ]) + ["llvm-readobj-driver.cpp"],
copts = llvm_copts,
stamp = 0,
deps = [
@@ -3848,12 +3911,21 @@ gentbl(
td_srcs = ["include/llvm/Option/OptParser.td"],
)
+expand_template(
+ name = "size_main",
+ out = "llvm-size-driver.cpp",
+ substitutions = {
+ "@TOOL_NAME@": "llvm_size",
+ },
+ template = "cmake/modules/llvm-driver-template.cpp.in",
+)
+
cc_binary(
name = "llvm-size",
srcs = glob([
"tools/llvm-size/*.cpp",
"tools/llvm-size/*.h",
- ]),
+ ]) + ["llvm-size-driver.cpp"],
copts = llvm_copts,
stamp = 0,
deps = [
More information about the llvm-commits
mailing list