[llvm] 2805e6f - [llvm-driver] Add driver alias for c++filt (#92803)

via llvm-commits llvm-commits at lists.llvm.org
Tue May 21 10:52:02 PDT 2024


Author: Jordan Rupprecht
Date: 2024-05-21T12:51:58-05:00
New Revision: 2805e6faad7795ed0846010e3e7ad41460030758

URL: https://github.com/llvm/llvm-project/commit/2805e6faad7795ed0846010e3e7ad41460030758
DIFF: https://github.com/llvm/llvm-project/commit/2805e6faad7795ed0846010e3e7ad41460030758.diff

LOG: [llvm-driver] Add driver alias for c++filt (#92803)

Similar to 9d955a63c7b0d2d547a63d4074e03cd5ebd1f162, this allows the
driver to respond to `c++filt`.

Added: 
    

Modified: 
    llvm/test/tools/llvm-driver/symlink-call.test
    llvm/tools/llvm-cxxfilt/CMakeLists.txt
    utils/bazel/llvm-project-overlay/llvm/driver.bzl

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llvm-driver/symlink-call.test b/llvm/test/tools/llvm-driver/symlink-call.test
index eeedf9edc73f2..ca6098216b13a 100644
--- a/llvm/test/tools/llvm-driver/symlink-call.test
+++ b/llvm/test/tools/llvm-driver/symlink-call.test
@@ -14,6 +14,8 @@
 # RUN: %t/cxxfilt-15 --help | FileCheck %s
 # RUN: ln -s %llvm %t/cxxfilt-15.exe
 # RUN: %t/cxxfilt-15.exe --help | FileCheck %s
+# RUN: ln -s %llvm %t/c++filt
+# RUN: %t/c++filt --help | FileCheck %s
 
 # RUN: ln -s %llvm %t/llvm-15
 # RUN: %t/llvm-15 cxxfilt --help | FileCheck %s

diff  --git a/llvm/tools/llvm-cxxfilt/CMakeLists.txt b/llvm/tools/llvm-cxxfilt/CMakeLists.txt
index cbc4c2db61543..a644baffdd90e 100644
--- a/llvm/tools/llvm-cxxfilt/CMakeLists.txt
+++ b/llvm/tools/llvm-cxxfilt/CMakeLists.txt
@@ -17,6 +17,10 @@ add_llvm_tool(llvm-cxxfilt
   GENERATE_DRIVER
   )
 
+if(LLVM_TOOL_LLVM_DRIVER_BUILD)
+  set_property(GLOBAL APPEND PROPERTY LLVM_DRIVER_HIDDEN_TOOL_ALIASES_llvm-cxxfilt c++filt)
+endif()
+
 if(LLVM_INSTALL_BINUTILS_SYMLINKS)
   add_llvm_tool_symlink(c++filt llvm-cxxfilt)
 endif()

diff  --git a/utils/bazel/llvm-project-overlay/llvm/driver.bzl b/utils/bazel/llvm-project-overlay/llvm/driver.bzl
index 10796d9198343..a57a14ebd5f8c 100644
--- a/utils/bazel/llvm-project-overlay/llvm/driver.bzl
+++ b/utils/bazel/llvm-project-overlay/llvm/driver.bzl
@@ -39,6 +39,7 @@ _EXTRA_ALIASES = {
     "clang": ["clang++", "clang-cl", "clang-cpp"],
     "lld": ["ld", "lld-link", "ld.lld", "ld64.lld", "wasm-ld"],
     "llvm-ar": ["ranlib", "lib", "dlltool"],
+    "llvm-cxxfilt": ["c++filt"],
     "llvm-objcopy": ["bitcode-strip", "install-name-tool", "strip"],
     "llvm-objdump": ["otool"],
     "llvm-rc": ["windres"],


        


More information about the llvm-commits mailing list